Explore the research collection
2 entries · Follow this search
- Paper
Triadic Linear Attention: Three-Dimensional Recurrent States for Long-Context Sequence Modeling
Generalizes linear attention from a matrix state to a third-order tensor state: writes the triadic outer product of a key, a second key, and a value (k tensor k' tensor v) into S_t in R^{d x E x d}, and reads by contracting both key axes with two queries. An E-dimensional second key yields an E-fold state-size increase while adding only two projections (negligible parameter overhead; E=16 gives 16x capacity at 1.08x non-embedding params in MQAR tests). Compatible with data-dependent forgetting (per-slice decay gates), the delta rule applied jointly to both keys (removing the value stored under the key pair), and chunkwise-parallel training via custom CuTe kernels that tile the per-head state along the value axis (blocks of 32 columns, all E slices held in registers) so no SM holds the full tensor. Applied to Gated DeltaNet and scalar-gated linear attention, it substantially improves long-context LM and recall, outperforming alternatives that enlarge state via wider heads/values, more heads, or multiple value heads per key. A pretrained linear-attention model can be converted post hoc to its triadic form during long-context extension. Training overhead over vanilla GDN (custom kernels, H100, 1.3B, 2k-64k tokens): 9-11% (E=2), 14-15% (E=4), 28-30% (E=8); E=8 is 3% slower than a Transformer at 4k but faster beyond, reaching 5.1x faster at 64k.
- Thread
Speculative decoding with Gated DeltaNet: no un-reading needed
Standalone technical insight on whether speculative decoding is a problem for Gated DeltaNet. Argument: rejected drafts must be rolled back; attention just drops their KV rows, but GDN has already blended every draft into its recurrent state. However, the update can be rewritten so that only accepted drafts are committed: S_t = alpha_t S_{t-1} + v_tilde_t k_t^T, with v_tilde_t = beta_t (v_t - alpha_t S_{t-1} k_t), giving S_a = g_a S_0 + sum_{i<=a} (g_a/g_i) v_tilde_i k_i^T (g = product of alphas). Cache (v_tilde_i, k_i, g_i) per draft and fold in only what is accepted. Conclusion: GDN does not have to un-read a token; it can wait to commit it.