Jumbled sparse attention masks
Implementation & benchmark of arXiv:2608.21058 — Rigidity of expanders and pseudorandom graphs
Source paper: Rigidity of expanders and pseudorandom graphs arXiv:2608.21058 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Design sparse attention masks using a graph discrepancy criterion rather than selecting only local or nearest-neighbor edges. A mask with approximately uniform edge counts between every pair of token subsets spreads information globally, while the rigidity consequence provides a principled way to preserve enough independent pairwise constraints for latent geometric features.
Formulas
Mathematical statement
The relevant object is a (p,beta)-jumbled graph: p is the target probability that a pair is connected, e(A,B) counts ordered edges between arbitrary vertex sets A and B, and beta is the worst discrepancy from the ideal count p|A||B| after normalization by sqrt(|A||B|). The inequality |e(A,B)-p|A||B|| <= beta sqrt(|A||B|) prevents large vertex subsets from being nearly disconnected or over-connected. Theorem 1.6 further guarantees a large subset S, losing at most 2(beta/(np))^2 of the vertices, whose graph is d-rigid with d proportional to np. For attention, this is adapted as a mask-quality objective: minimize empirical discrepancy over random and adversarial subset pairs while fixing the number of edges, obtaining a sparse mask with balanced global coverage rather than a purely local mask. The attention logits remain standard; only the support mask is changed.
Implementation notes
Modify the attention-mask construction in a sparse transformer or graph transformer; the QK^T computation remains unchanged, but only edges in E are materialized. Start with a fixed edge budget m equal to the baseline kNN or block-sparse mask. Generate a random d_graph-regular directed or undirected mask, then optimize it offline by degree-preserving edge swaps. At every mask-optimization step, sample a set Q of subset pairs (A,B), including uniformly sampled subsets, high-degree subsets, and contiguous groups when tokens have an ordering. Compute e(A,B), set p=m/(n(n-1)), and evaluate Delta(A,B) and L_jumbled. Accept swaps that lower the moving average of L_jumbled while preserving degrees and preventing isolated nodes. Freeze the resulting mask during neural-network training, avoiding per-iteration mask optimization overhead. Implement sparse attention with the same kernel and edge count as the baseline so the comparison is fair. Measure beta_hat on held-out subset pairs, average shortest-path length, and the fraction of tokens reached after two and four mask hops. The first cheap test is a 6-layer, 256-token language or synthetic-sequence transformer with 1/8 of dense-attention edges, compared against local sliding-window and unoptimized random masks at identical FLOPs. Evaluate validation perplexity and a long-range retrieval task requiring a token to recover information from a distant position. The expected signal is lower perplexity at equal edge budget, better long-range retrieval, lower gradient variance, and no disconnected-subgraph failures. A negative result is clear if the jumbled mask has lower discrepancy but does not improve perplexity, retrieval accuracy, or optimization stability.
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.