Unverified 2026

Cocycle-Twisted Attention

Implementation & benchmark of arXiv:2608.02795 — Zesting and the relative complexity of Reshetikhin-Turaev invariants

Usefulness5/10
Difficulty5/10
Novelty7/10

Source paper: Zesting and the relative complexity of Reshetikhin-Turaev invariants arXiv:2608.02795 ⓘ · analyzed Aug 31, 2026

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

Idea description

Attach each token or graph node a discrete grade a in a finite group A, and modify attention value composition with a normalized group 2-cocycle rather than independent pairwise gates. The cocycle provides a globally consistent projective interaction rule, so composing three messages gives the same result under either parenthesization. This may improve relational reasoning while reducing the number of freely learned interaction parameters.

Formulas

$$\frac{\epsilon(ab)}{\epsilon(a)\epsilon(b)}=\dim(\lambda(a,b)),\qquad \epsilon(a)^2=1.$$
$$\nu(e,b,c)=\operatorname{id}_{\lambda(b,c)},\quad \nu(a,e,c)=\operatorname{id}_{\lambda(a,c)},\quad \nu(a,b,e)=\operatorname{id}_{\lambda(a,b)}.$$
$$j_{\zeta}(S\amalg B)=\nu(i,b,a)^{-1}\circ(t(a,b)\otimes\operatorname{id}_{\lambda(i,a,b)})\circ\nu(i,a,b).$$
$$\omega(a,b)\omega(ab,c)=\omega(b,c)\omega(a,bc),\qquad \omega(e,a)=\omega(a,e)=1.$$

Mathematical statement

The paper assumes an A-graded category C = direct sum over a in A of C_a, with homogeneous objects satisfying X_a tensor Y_b in C_{ab}. Zesting introduces invertible objects lambda(a,b) and associator isomorphisms nu(a,b,c): lambda(ab,c) tensor lambda(a,b) -> lambda(a,bc) tensor lambda(b,c), normalized by nu(e,b,c) = id, nu(a,e,c) = id, and nu(a,b,e) = id. It also introduces t(a,b): lambda(a,b) -> lambda(b,a), and a scalar function epsilon obeying epsilon(ab)/(epsilon(a) epsilon(b)) = dim(lambda(a,b)) and epsilon(a)^2 = 1. For a scalar neural analogue, take lambda(a,b) one-dimensional and encode its action by omega(a,b) in {+1,-1} or U(1). The associator coherence becomes the normalized 2-cocycle identity omega(a,b) omega(ab,c) = omega(b,c) omega(a,bc), with omega(e,a) = omega(a,e) = 1. The paper's explicit non-strict tensor rule is j_zeta(S disjoint-union B) = nu(i,b,a)^(-1) composed with (t(a,b) tensor id_lambda(i,a,b)) composed with nu(i,a,b); this motivates applying the cocycle factor whenever messages with grades a and b are composed.

Implementation notes

Integrate the modification into the value-composition line of a Transformer self-attention block or into edge-message aggregation in a graph neural network. Give every token or node i a grade a_i in a small finite group A, obtained from known structured labels, a learned classifier, or synthetic metadata. Compute ordinary queries, keys, and values. For an edge from j to i, use the usual attention coefficient alpha_ij and multiply the value contribution by omega(a_i,a_j). Start with real signs omega in {+1,-1}; this avoids requiring complex-valued neural layers. For multi-hop composition, maintain an accumulated grade g and phase s. When appending a message with grade b, update s <- s * omega(g,b), then update g <- g b. The identity omega(a,b) omega(ab,c) = omega(b,c) omega(a,bc) ensures that the phase is invariant to whether three grades are grouped as (a b) c or a (b c). Use omega = 1 as the exact baseline. Compare the constrained cocycle layer against unconstrained learned pairwise grade gates with the same parameter count. The paper supplies the coherence equations and the local braiding factor; the initial omega table can be a fixed nontrivial cocycle, while a learned version can optimize a phase table and periodically project it onto the cocycle constraints. The first experiment should use a 4- or 8-element cyclic group, a synthetic multi-step composition or parity task, and a 2-layer 4-head Transformer. Record validation accuracy, seed variance, loss under reordered computation, and FLOPs. A successful result is higher accuracy and lower seed variance at equal compute, especially on examples requiring three or more relational compositions.

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.