Polymer-compatible sparse attention
Implementation & benchmark of arXiv:2608.08396 — New results on the domain of analyticity of the free energy for the Ising model
Source paper: New results on the domain of analyticity of the free energy for the Ising model arXiv:2608.08396 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace dense token-to-token attention with attention over connected token groups, called polymers, while forbidding nearby polymers from being simultaneously selected. Each candidate group receives an exponentially decaying size and boundary penalty, and the layer sums or samples only compatible collections of groups. The construction should create structured sparsity and prevent redundant overlapping attention regions.
Formulas
Mathematical statement
The paper defines two subsets S and S' of the lattice to be compatible when d(S,S') >= 2, where d(S,S') = inf{d(kappa,l): kappa in S, l in S'} and d(i,j) = ||i-j||_infinity. The compatibility indicator is zeta(S,S') = 1 if S is compatible with S' and 0 otherwise. For the set P_Lambda of nonempty connected subsets S of a finite domain Lambda, the large-field polymer partition function is Xi_Lambda^LF(beta,h) = 1 + sum_{n>=1} (1/n!) sum_{(S_1,...,S_n) in P_Lambda^n} product_{i<j} zeta(S_i,S_j) product_i w_beta,h(S_i), with polymer weight w_beta,h(S) = exp(-2 beta |partial S| - 2 h |S|). Here beta >= 0 and h are scalar parameters, |S| is the number of sites in S, and |partial S| is the boundary size. The neural adaptation treats token positions as sites, connected token subsets as candidate polymers, zeta as a hard exclusion mask, and beta and h as learned or scheduled penalties controlling boundary complexity and group size. The useful property is factorization over mutually compatible connected objects, enabling a truncated sparse expansion.
Implementation notes
Integrate this into a local-attention or MoE-routing block between the token projection and the value aggregation. Let X in R^{L x d_model} be a sequence, and create a candidate set P containing connected intervals for text, connected patches for images, or connected subgraphs for graph data. Use lengths 1 through s_max; for each candidate S compute a pooled query/key representation q_S and k_S, a boundary estimate |partial S| equal to the number of neighboring positions outside S, and a score g_theta(S,X) = q_S^T k_S / sqrt(d_head). Set the polymer weight to w_tilde(S) = exp(-beta_theta |partial S| - h_theta |S| + g_theta(S,X)). Build a conflict matrix C_ab equal to 1 when d(S_a,S_b) < 2. First implement a greedy truncated expansion: sort candidates by log w_tilde, accept a candidate if it conflicts with no already accepted candidate, and stop after K polymers or when the cumulative weight falls below epsilon. A closer partition-function approximation can use K rounds of masked parallel top-k selection, with logits for candidate a set to negative infinity whenever C_ab = 1 for an accepted candidate b. Aggregate values inside each selected S using mean or learned intra-polymer attention, then scatter the resulting group outputs back to member tokens; add a residual path for uncovered tokens. beta_theta and h_theta may be fixed initially, for example beta=0.1 and h=log(1.5), and later learned with positivity enforced by softplus. The exact mathematics provides the connected-set compatibility product and exponential weight; candidate enumeration, boundary computation, truncation K, and the learned content score are engineering choices. Start on CIFAR-10 ViT-Tiny with 8x8 patch tokens and compare dense attention, windowed attention, and this router at equal hidden size. Measure attention FLOPs, peak activation memory, top-1 accuracy, and the fraction of tokens covered. The first success criterion is at least 2x lower attention memory or FLOPs with no more than 1 percentage point accuracy loss; a secondary signal is improved stability when h is increased to suppress oversized groups.
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.