Spectral-gap regularized doubly stochastic attention
Implementation & benchmark of arXiv:2608.11760 — Tight Nonasymptotic Local Convergence of Sinkhorn-Knopp
Source paper: Tight Nonasymptotic Local Convergence of Sinkhorn-Knopp arXiv:2608.11760 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Train attention logits so that the associated Sinkhorn-scaled operator has a favorable local spectral gap, making iterative normalization contract faster. Add a differentiable penalty on the second eigenvalue of the normalized operator while retaining the task loss and marginal-feasibility loss.
Formulas
Mathematical statement
The relevant operator is $$B=P^{-1/2}A^{\star}Q^{-1}(A^{\star})^{\top}P^{-1/2},$$ with P=diag(p), Q=diag(q), and A^{\star}=diag(u^{\star})A diag(v^{\star}) the Sinkhorn-scaled kernel. The paper's local contraction factor is \rho=1-\sigma_2, where \sigma_2=\lambda_{m-1}(B) is the second-largest eigenvalue. A larger spectral gap \sigma_2 means a smaller contraction factor and therefore faster local convergence. In a neural network, A=exp(S/ au) depends on attention logits S, so penalize \lambda_{m-1}(B) or maximize the gap surrogate \sigma_2. Estimate the second eigenvalue using power iteration after projecting away from the dominant eigenvector. For robustness, use a squared penalty on excess eigenvalue rather than maximizing the gap without bounds.
Implementation notes
Insert the regularizer in a Sinkhorn-based attention layer during training. For each batch element, form A=exp((S-c)/tau), run a detached or low-iteration Sinkhorn pass to obtain A_star=diag(u)A diag(v), and define B=P^{-1/2}A_star Q^{-1}A_star^T P^{-1/2}. For square self-attention with uniform marginals p=q=1/L, P and Q are scalar multiples of the identity; for general marginals use the supplied diagonal vectors. Estimate the dominant eigenvector w with 5 power iterations on B, normalize it, then run 3-5 projected power iterations z <- (I-ww^T)Bz followed by normalization. Estimate lambda2=z^T Bz and add L_gap=[lambda2-lambda_target]_+^2 to the task loss. Set lambda_target initially to 0.7 or to the median lambda2 observed during a warm-up epoch; use beta between 1e-4 and 1e-2 so the regularizer cannot dominate language-model loss. Compute the marginal residual r and optionally include gamma||r||^2, but do not backpropagate through more Sinkhorn iterations than the baseline. The eigenvalue estimate and regularizer come from the paper's contraction formula; lambda_target, beta, and power-iteration count are empirical hyperparameters. First test on a 2-layer, 4-head Transformer on a synthetic permutation/assignment dataset and WikiText-2, comparing ordinary Sinkhorn attention with the regularized version at the same fixed iteration budget. Track estimated lambda2, actual residual decay per iteration, task accuracy or perplexity, gradient stability, and wall-clock overhead. The hypothesis is that training lowers lambda2, produces steeper residual decay, and permits reducing fixed Sinkhorn iterations by 25-50% without increasing marginal error or validation loss.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.