Totally-positive bidiagonal mixer
Implementation & benchmark of arXiv:2607.01577 — Total positivity of transformation matrices for uniform subdivisions
Source paper: Total positivity of transformation matrices for uniform subdivisions arXiv:2607.01577 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a dense channel or token-mixing matrix with a product of positive bidiagonal factors, so information propagates through a controlled sequence of local couplings rather than arbitrary signed interactions. Initialize the factors from the paper's barycentric-subdivision factorization, then learn positive diagonal and off-diagonal parameters; the resulting map is structured, parameter-efficient, and constrained to remain totally positive.
Formulas
Mathematical statement
The paper defines the barycentric-subdivision transformation matrix by $H_{\mathcal F}=[h_{ij}]_{0\le i,j\le d}$ with $h_{ij}=\sum_{r=0}^{i}r^{j}(r+1)^{d-j}(-1)^{i-r}\binom{d+1}{i-r}$, where $d$ is the matrix dimension minus one, $i,j$ are row and column indices, and $r$ is the summation index. It proves the constructive factorization $H_{\mathcal F}=W_0W_1\cdots W_{d-1}W_d\cdots W_{2d-1}$, where each $W_k$ is bidiagonal or a diagonal-plus-one-off-diagonal local factor, and concludes that $H_{\mathcal F}$ is totally positive: every minor of $H_{\mathcal F}$ is nonnegative, with the relevant minors positive. The transpose is factored as $A_d=F_{d-1}F_{d-2}\cdots F_0\widetilde B_1\widetilde B_2\cdots\widetilde B_d$, where $A_d=H_{\mathcal F}^{T}$, $F_k$ are Neville-elimination lower bidiagonal factors, and $\widetilde B_k$ are embedded bidiagonal factors. The planar-network interpretation explains positivity because each matrix entry is a sum of products of nonnegative edge weights over directed paths. Adapt the factors as $L_k=I+\operatorname{diag}(\operatorname{softplus}(\ell_k),-1)_{\mathrm{sub}}$ and $U_k=I+\operatorname{diag}(\operatorname{softplus}(u_k),-1)_{\mathrm{sup}}$, with positive diagonal scaling $D=\operatorname{diag}(\exp(s_0),\ldots,\exp(s_{d-1}))$; here $\ell_k,u_k,s_k$ are unconstrained trainable parameters, $I$ is the identity, and the sub/super operators place a vector on the first lower/upper diagonal. The neural mixer is $M=L_1\cdots L_KD U_K\cdots U_1$. Positive bidiagonal factors preserve the nonnegative-network construction and give a practical approximation whose depth $K$ controls expressivity and compute.
Implementation notes
(1) Integration point: use this module as a replacement for a dense $d\times d$ projection in a Transformer feed-forward block, a token mixer, or the value/output projection in attention. Start with channel mixing because the same matrix is applied independently to every batch item and token. Keep the surrounding nonlinearities and residual connection unchanged. The module can also be inserted as a learned preconditioner immediately before an MLP.
(2) Pseudocode:
input X in R^[batch, length, d]
parameters ell[1:K,d-1], u[1:K,d-1], s[d]
a = softplus(ell); b = softplus(u); diag = exp(s)
Y = X * diag
for k = 1..K:
Y = Y + shift_right(Y, 1) * a[k]
for k = K..1:
Y = Y + shift_left(Y, 1) * b[k]
return residual_scale * Y
Apply each bidiagonal operation along the channel dimension; each factor costs $O(d)$ and the whole mixer costs $O(Kd)$ per vector, versus $O(d^2)$ for a dense projection. Use a norm or log-diagonal clamp if numerical growth appears, for example clip $s_k$ to $[-3,3]$.
(3) Computed from the paper: use the barycentric formula for $H_{\mathcal F}$ at initialization, perform Neville elimination or ordinary LU decomposition to obtain positive bidiagonal coefficients, and initialize $M$ to a normalized version of $H_{\mathcal F}$ for small $d$. During training, the softplus/exponential parameterization enforces positive edge and diagonal weights; no determinant constraints need be imposed. Estimate total positivity empirically by sampling minors of orders two through four and checking their signs, and estimate expressivity by comparing approximation error to a dense matrix on random targets.
(4) First cheap experiment: train a 2-layer Transformer on CIFAR-10 flattened patches or Tiny Shakespeare with $d=128$, replacing the dense MLP input projection by the $K=8$ positive bidiagonal mixer. Compare against the same parameter-count-matched dense layer, a low-rank linear layer, and an unconstrained product of bidiagonal factors. Measure validation loss or accuracy, gradient-norm variance, singular-value growth, parameter count, and wall-clock/FLOPs. The initial success signal is equal or better validation accuracy with fewer parameters and lower gradient instability; for a sequence mixer, also test whether the positive factorization reaches the dense baseline at $K\ll d$.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a readable positive bidiagonal mixer, barycentric-subdivision matrix evaluator, exhaustive minor checker, and fixed-seed regression benchmark. The barycentric matrix and tested positive-factor product had no negative minors, confirming the positivity phenomenon numerically. However, the mixer failed to approximate a dense target: K=6 matched the dense model’s parameter count but achieved validation MSE 0.836 versus 4.08e-15 for dense, while also taking longer; therefore no practical win was observed.
- Agent confidence
- 9/10
- Baseline
- Dense: 144 parameters, validation MSE 4.08e-15, 0.83 s; rank-4: 96 parameters, validation MSE 0.279, 0.84 s.
- Idea
- Positive K=2: 56 parameters, validation MSE 0.836, 2.27 s; positive K=6: 144 parameters, validation MSE 0.836, 5.57 s. Exhaustive n=5 minor checks found 0 negative minors for both H and the tested positive product.
Limitations: Only a small linear regression benchmark was tested, not a Transformer, CIFAR-10, language modeling, or training stability/generalization study. The implementation uses near-identity positive initialization and does not implement the full Neville-elimination-to-parameter initialization conversion. The positivity check was exhaustive only for 5x5 matrices and one sampled positive product.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 4.6 KB View Raw
- report.md 1.5 KB View
- results.json 1.2 KB View Raw