Shifted-Mask Defect Regularization
Implementation & benchmark of arXiv:2608.15358 — Stability of Shifted Complexes via the Second-Moment Defect of the Up-Laplacian
Source paper: Stability of Shifted Complexes via the Second-Moment Defect of the Up-Laplacian arXiv:2608.15358 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Represent a learned sparse attention or routing pattern as a graph and penalize its second-moment defect, which measures distance from a shifted family and therefore from nested, threshold-like neighborhoods. At inference, optionally replace the learned mask by a nearby shifted mask to obtain more structured sparse indexing and predictable routing patterns.
Formulas
Mathematical statement
For a finite pure k-dimensional simplicial complex K, let d^{v,T}_r(K) be the number of vertices contained in at least r facets, so d^{v,T}(K) is the conjugate vertex-degree partition. Let lambda_r(K) be the nonzero eigenvalues of the (k-1)-dimensional up-Laplacian. The failed-shift count is shdef(K)=sum_{i<j}(N_{ij}-R_{ij}), where vertices are ordered by nonincreasing degree, N_{ij} counts facets for which replacing j by i is possible, and R_{ij} counts replacements that produce another facet. The exact identity D(K):=sum_{r>=1}(d^{v,T}_r(K))^2-sum_r lambda_r(K)^2=2 shdef(K) measures the number of failed elementary shifts. The stability result gives a shifted family H with the same number of facets and (1/2)|K_k triangle H| <= D(K)/2, where triangle denotes symmetric difference. Use k=1 for a simple graph G=(V,E): d_i is the degree of vertex i, m=|E|, c_r=#{i:d_i>=r}, and L=diag(d)-A is the graph Laplacian. Since tr(L^2)=sum_i d_i^2+2m=sum_r lambda_r^2, the implementable defect is D(G)=sum_{r>=1}c_r^2-sum_i d_i^2-2m. The defect is nonnegative and vanishes exactly for shifted graphs up to relabeling; D(G)/2 upper-bounds the number of edge exchanges needed to reach a shifted graph.
Implementation notes
Integrate the method at the binary sparse-mask or router-assignment level rather than in dense attention logits. For a self-attention layer with n tokens, obtain dense scores S, select the k largest neighbors per row, and symmetrize the resulting mask M in {0,1}^{n x n}; alternatively apply the same procedure to a token-expert coactivation graph. Compute d_i=sum_j M_ij, m=sum_{i,j}M_ij/2, sort the degrees, and calculate c_r=sum_i 1[d_i>=r] for r=1,...,max_i d_i. Add lambda_shift times D/(n^2+epsilon) to the task loss, where D=sum_r c_r^2-sum_i d_i^2-2m. Because top-k selection and threshold counts are discrete, use a straight-through estimator: forward with the hard mask, backward through M_ij=sigmoid((S_ij-tau)/T), annealing T. During training, recompute the defect every few steps to reduce overhead. The paper supplies the exact defect identity and exchange-distance guarantee; no eigenvalue estimation is needed in the graph case. For post-training structured sparsity, order vertices by degree and repeatedly apply failed elementary shifts, replacing an eligible edge containing j by the corresponding edge containing i when absent while preserving m edges. First test a 2-4 layer Transformer on WikiText-2 or CIFAR-10 with fixed average attention degree, comparing ordinary top-k sparse attention against defect-regularized masks. Record validation perplexity or accuracy at equal FLOPs, defect value, number of unique sparse-index patterns, routing imbalance, and mask/index construction time. A positive result is lower indexing cost or better load balance at equal accuracy, or faster and less oscillatory loss descent at equal sparsity.
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.