Unverified 2026

Homotopy-Associative Attention

Implementation & benchmark of arXiv:2607.25944 — Hochschild Cohomology of the Symmetric Square of an Annulus with Stops

Usefulness6/10
Difficulty5/10
Novelty7/10

Source paper: Hochschild Cohomology of the Symmetric Square of an Annulus with Stops arXiv:2607.25944 ⓘ · analyzed Aug 31, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Augment standard pairwise attention composition with a shared ternary correction m_3(a,b,c), so two different parenthesizations of a three-token or three-edge composition need not agree exactly but are forced to differ by a learned bounded correction. This gives the network a structured way to represent context-dependent compositionality without replacing efficient quadratic attention with unrestricted third-order attention.

Formulas

$$(\mathcal{A},m_2,m_3,\dots),\\qquad m_i=0\\ \text{for all }i>3$$
$$d(z_{i,i+1})=x_{i,i+1}y_{i,i+2},\qquad 1\leq i\leq n_1+n_2-2$$
$$m_2(m_2(a,b),c)-m_2(a,m_2(b,c))\approx m_3(a,b,c)$$
$$\mathcal{L}_{\mathrm{assoc}}=\frac{1}{|\mathcal{T}|}\sum_{(a,b,c)\in\mathcal{T}}\left\|m_2(m_2(a,b),c)-m_2(a,m_2(b,c))-m_3(a,b,c)\right\|_2^2+\lambda\left\|m_3(a,b,c)\right\|_2^2$$

Mathematical statement

The paper proves that its minimal model has (A,m_2,m_3,...) with m_i=0 for every i>3, while m_3 is nonzero when both stop counts exceed one. Here m_2(a,b) is ordinary binary composition and m_3(a,b,c) is a ternary operation measuring failure of strict associativity. The relevant homotopy-associativity identity is m_2(m_2(a,b),c)-m_2(a,m_2(b,c))=m_3(a,b,c). The dg presentation supplies the certificate pattern d(z_{i,i+1})=x_{i,i+1}y_{i,i+2}: an auxiliary generator z has differential equal to a two-step composition. In the neural adaptation, a and b are token or edge embeddings, m_2 is a pairwise attention composition, and m_3 is a low-rank gated ternary correction.

Implementation notes

(1) Integration point: add the module after value aggregation in one or two transformer layers. For token states h_i in R^d, use a binary composition m_2(a,b)=MLP_2([a,b,a elementwise-product b]). (2) Pseudocode: for sampled triples (a,b,c), compute left=m_2(m_2(a,b),c), right=m_2(a,m_2(b,c)); compute u_a=sigma(W_a a), u_b=sigma(W_b b), and u_c=sigma(W_c c); set m3=W_o(u_a elementwise-product u_b elementwise-product u_c); set g=sigmoid(w_g transposed times [b,a elementwise-product c]); replace the selected two-hop output by left+g times m3; add the associator loss shown above. (3) Use a low rank r much smaller than d to reduce cost. The paper-derived ingredients are the ternary-only truncation and the requirement that m3 explain the binary associator. Rank, gating, lambda, and sampling are estimated empirically. Sample adjacent positions, top-attended triples, or length-two graph paths. Clip the ternary residual norm to the median binary-composition norm if training is unstable. (4) First experiment: use a 2-layer 4-head Transformer on SCAN or ListOps, comparing against the same model and a parameter-matched unconstrained gated MLP. Measure validation accuracy, length-generalization accuracy, associator error, gradient variance, and wall-clock overhead. Success is improved compositional or extrapolation accuracy with less than 15 percent training-time overhead and a nonuniform m3 that activates on ambiguous or long-range triples.

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.