Full text not available for this paper
Summary (Overview)
- Problem: Gated-delta linear attention layers (GDN, KDA, GDN-2) are tuned for GPUs and map poorly onto Google TPUs, which use wide 256×256 systolic matrix units with a much slower vector unit (~128× throughput gap vs. ~15× on H100).
- Solution: Systolic Linear Attention (SLA) reshapes gated delta attention around the TPU's matrix unit via three key changes: (1) widening keys to 256 dimensions and sharing keys and write gates across grouped value heads (R× fewer chunk solves), (2) grouping decay gates into four 64-channel tiles, and (3) fusing exact FP32 block-doubling chunk inversion and backward reuse inside one on-chip VMEM kernel.
- Performance: SLA-R4 runs 2.1×–2.6× faster than open-source MaxText KDA and 1.4×–2.4× faster than Tokamax KDA on TPU v7x, while using 49%–61% less temporary HBM.
- Quality: Across a 2,048-chip TPU v7x pre-training study of MoE models (6.5B–63.1B parameters), SLA trains 11%–24% faster than MaxText KDA, matches KDA perplexity on paired seeds at 12.5B, and stays within 3% at other scales.
- Extrapolation: Without clamping decay gates, SLA extrapolates from 8K training to 32K–64K context far better than unclamped KDA.
Introduction and Theoretical Foundation
Background
Linear attention removes the quadratic compute and KV cache of softmax attention by storing context in a fixed-size state matrix , updated at each token with key and value :
Because this sum grows without bound, gated models add a data-dependent forget (decay) gate :
Evolution of Gated Delta Attention
DeltaNet introduced the delta rule with unit-norm key (), scalar write gate , and identity :
Gated DeltaNet (GDN) combines decay with the delta rule, using one scalar decay per head ():
Kimi Delta Attention (KDA) expands GDN's scalar forget gate into a per-channel diagonal gate ():
GDN-2 retains per-channel decay and replaces scalar with separate channel-wise erase and write gates.
Three Hardware Bottlenecks on TPUs
-
Narrow states and fixed per-step scan cost: A 128-wide state leaves half of each 256×256 MXU tile's key axis padded, while paying full per-step cost for every head. Each scan step costs ≈12μs regardless of chunk size.
-
Per-channel decay: KDA/GDN-2 kernels must rescale keys elementwise in 16-token sub-blocks to avoid FP32 overflow. GPUs absorb this vector work cheaply; on TPUs where matrix:vector throughput is ~128×, it stalls the kernel.
-
Per-value-head chunk solves: Independent write gates per value head force solves per chunk, with unfused HBM round-trips. Ops 3–5 account for ~45% of core stateless KDA time.
Methodology
SLA Recurrence (Definition 2.1)
SLA uses value heads of width and query-key heads of width , where each query-key head is shared across value heads:
- Shared query, key, write gate: L2-normalized with , and scalar step size
- Packed values: value vectors stacked as
- Four-tile forget gate: Block-diagonal gate splitting 256 channels into contiguous tiles of channels:
Token-level recurrence:
Three Algorithmic Pillars
1. Wide Keys and Shared Across Grouped Value Heads
SLA widens keys to and shares both each key head and the scalar write gate across value heads. This packs value heads into full 256× MXU tiles and cuts chunk solves by (2.45×–3.28× faster core forward, 1.87×–2.48× faster full-layer F+B).
2. Tile-Grouped Forget Gate
SLA splits 256 key channels into 4 tiles of 64 channels, each with one scalar decay rate. Intra-chunk scores become four 64-wide MXU matmuls scaled by decay masks, with no VPU rescaling. This middle point between GDN's single rate () and KDA's per-channel rate () runs at near-scalar single-kernel VMEM speed while lowering perplexity over .
3. Fused VMEM Exact Inversion with Backward Reuse
SLA fuses -fewer exact FP32 recursive block-doubling solves and custom-VJP backward reuse inside one VMEM kernel, with a chunk-size-independent conditioning bound (Theorem 2.3). Exact FP32 block-doubling holds accuracy through while adding only 4.0%–7.7% to full-LM step time.
Chunkwise WY Parallelization
The chunkwise WY algorithm partitions the sequence into contiguous chunks. Within chunk starting from boundary state , the chunk writes satisfy:
where is the strictly lower-triangular Gram matrix of decayed key overlaps, and is computed via exact FP32 block-doubling.
Empirical Validation / Results
Kernel and Layer Performance
Table 1: SLA vs. KDA at a glance on TPU v7x
| Benchmark | KDA | SLA | SLA vs. KDA |
|---|---|---|---|
| Full layer, 32K fwd+bwd (2-stage; MaxText/Tokamax) | 48.7/42.4 ms | 20.2 ms | 2.4×/2.1× faster |
| Temporary HBM, 32K layer | 9.1/9.3 GiB | 3.7 GiB | 60%/61% less |
| 131K prefill, 32-layer hybrid (Exact Inv., BF16) | 2.66 s | 1.62 s | 1.64× faster |
| MoE training throughput, 6.5B–63.1B (vs. MaxText KDA) | 1.00× | 1.11×–1.24× | 11%–24% faster |
| 12.5B equal-chip-h PPL vs. Tokamax (42.7 chip-h, n=3) | 19.52 | 19.15 [19.11] | −0.37 [−0.41] (3/3 seeds) |
| 63.1B equal-chip-h PPL vs. Tokamax (37.3 chip-h, n=3) | 26.56 | 25.08 [25.14] | −1.48 [−1.41] (3/3 seeds) |
| 12.5B iso-token PPL vs. MaxText (60.4B tok, n=3) | 15.60 | 15.58 | −0.02 (within noise) |
| 63.1B iso-token PPL vs. MaxText (120.8B tok, n=1) | 12.60 | 12.45 | −0.15 |
| 64K HotpotQA, 12.5B, no clamping | 50.3% | 77.9% | +27.6 pts |
Pre-training Results
- 2,048-chip TPU v7x study: MoE models from 6.5B to 63.1B nominal parameters. SLA trains 11%–24% faster than MaxText KDA (4%–21% faster than Tokamax KDA).
- Equal-chip-hour comparisons (64-chip slices, n=3 paired seeds): 1-kernel fused SLA-R4 lowers perplexity on all 3/3 seeds at both 12.5B (−0.37 ± 0.11) and 63.1B (−1.48 ± 0.21).
- Fused SLA-R4 + GDN-2 hybrid: Also beats safe-clipped Tokamax KDA on all 3/3 seeds at both scales (−0.41 ± 0.35 at 12.5B, −1.41 ± 0.16 at 63.1B).
- outperforms scalar across 6/6 paired 12.5B MoE and dense-LM seeds.
Hardware Specifications
Table 2: Documented hardware specifications per chip
| Accelerator | Cores | Array Tile | BF16 TF/s | 8-bit TF/s | VPU TF/s | MXU:VPU | HBM (GB) | HBM GB/s | Ridge |
|---|---|---|---|---|---|---|---|---|---|
| H100 SXM | 132 SM | 16×16 | 989 | 1,979 | 67.0 | 14.8× | 80 | 3,350 | 295 |
| TPU v4 | 2 | 128×128 | 275 | 275 | 3.2 | 85.9× | 32 | 1,200 | 229 |
| TPU v5p | 2 | 128×128 | 459 | 918 | 5.4 | 85.0× | 95 | 2,765 | 166 |
| TPU v6e | 1 | 256×256 | 918 | 1,836 | 7.2 | 127.5× | 32 | 1,600 | 574 |
| TPU v7x | 2 | 256×256 | 2,307 | 4,614 | 18.0 | 128.2× | 192 | 7,373 | 313 |
Ablation Breakdown
The speedup against open-source Tokamax KDA decomposes into:
- 1.28×–1.41× from 4:1 head packing
- 1.10×–1.12× from VMEM fusion
- 1.07×–1.20× from tile grouping
Theoretical and Practical Implications
Theoretical Contributions
- Conditioning guarantee: Theorem 2.3 proves a chunk-size-independent conditioning bound for SLA's exact FP32 block-doubling inversion.
- Chunk-boundary momentum: SLA offers an optional Schur-guarded momentum mode with for unconditional chunk-to-chunk stability, though is the recommended default.
- Step-size extension: SLA adopts , widening the eigenvalue range of to .
Practical Implications
- Hardware-aware architecture design: SLA demonstrates that co-designing attention architectures around specific hardware (TPU systolic arrays) can yield substantial gains over simply optimizing kernels for existing GPU-tuned architectures.
- Memory efficiency: 49%–61% reduction in temporary HBM usage enables longer sequences and larger models on the same hardware.
- Long-context extrapolation: Without clamping decay gates, SLA extrapolates from 8K training to 32K–64K context far better than unclamped KDA, achieving 77.9% vs. 50.3% on 64K HotpotQA.
- Complementary to richer update rules: SLA is best understood as a hardware-efficient operating point complementary to richer update rules such as GDN-2; combining them (fused SLA-R4 + GDN-2) yields the best equal-chip-hour results.
Conclusion
SLA demonstrates that reshaping gated delta attention around the TPU's 256×256 systolic matrix unit—rather than merely porting GPU-tuned kernels—yields substantial improvements in both speed (2.1×–2.8× faster than open-source KDA implementations) and memory efficiency (49%–61% less temporary HBM), while maintaining or improving model quality across scales from 6.5B to 63.1B parameters.
Key design choices—wide 256-dimensional keys with shared write gates across grouped value heads, four-tile grouped decay gates, and fused exact FP32 block-doubling chunk inversion with backward reuse inside a single VMEM kernel—directly address the three TPU-specific bottlenecks of narrow states, per-channel decay rescaling, and per-value-head chunk solves.
Future directions include:
- Exploring the SPD-SLA-W extension with chunk preconditioning for whitened keys
- Further combinations with richer update rules like GDN-2
- Application of the tile-grouped decay principle to other linear attention variants
- Extension to other systolic-array accelerators beyond TPUs
The paper positions SLA as a hardware-efficient operating point complementary to more expressive update rules, with the caveat that unclamped per-channel decay in KDA exhibits slow-channel long-context drift that SLA's tile-grouped decay naturally avoids.
Related papers
- Robust Code RL via Faulty-Code-Driven Test case Synthesis and Dense Reward Shaping (RobustTests)
RobustTests improves LLM code RL by generating test cases from near-correct faulty code and using dense rewards, yielding 3% absolute gains on LiveCodeBench and CodeForces.
- You don't need long context
Compaction and selective input reading let frontier models match full-context accuracy on long-context benchmarks while cutting context length and cost by up to 233x.
- The Teacher Is Already Inside: Self-Distilling Looped Language Models Beyond Their Last Loop
ELPSD enables a looped language model to self-distill without rewards by training its last loop against an extrapolated contrastive teacher from its own frozen weights, beating GRPO on math benchmarks.