Muir: Linear Attention with Sensitivity-Allocated Gating and Matched-Filter Readout
Authors: Tushaar Gangavarapu¹, Gil Tabak², Clemens JS Schaefer²
¹University of Texas at Austin, ²Google
Summary (Overview)
- Muir is a novel gated delta-rule linear attention architecture that fuses all recurrence gates (decay, erase, write, output, and a new query readout gain) into a single sensitivity-allocated low-rank projection, replacing the dense gate matrices in Gated DeltaNet-2 (GDN-2).
- The paper provides theoretical analysis showing that state updates are 13× more sensitive to write perturbations than erase perturbations (due to key sparsity from SiLU activation and ℓ₂-normalization), and derives a closed-form stationary row-energy law that explains why slow-decaying state rows accumulate much larger norms than fast rows.
- A matched-filter readout gate (combining static channel profile with dynamic per-token modulation) re-weights state rows, reducing write-time erasure and extending memory horizon—improving multi-hop retrieval, extractive recall, and length extrapolation.
- A boundary-pivoted chunkwise kernel enables numerically stable training on wide-matrix-unit accelerators (TPUs) by avoiding cumulative decay division overflow and 3D decay tensors, using divide-and-conquer block decomposition with leaf-level Neumann series inversion.
- Across 166M–1.34B parameters, Muir lowers perplexity by 1.8–2.0% over GDN-2 and 2.5–3.6% over Transformer, improves commonsense accuracy by up to 1.9 points, extrapolates 2,560× from 4K to 10M-token streams without perplexity drift, and maintains near-100% passkey retrieval to 1M tokens.
Introduction and Theoretical Foundation
Background and Motivation
Linear attention compresses context into a fixed-size key-value state for linear-time training and constant-memory inference. However, a finite-dimensional state admits only finitely many orthogonal key directions, forcing cross-key interference. Delta-rule recurrences mitigate this by erasing the current prediction for an incoming key before writing a new value.
The paper identifies three bottlenecks in channel-wise gated delta models:
-
Parameter allocation: GDN-2 uses full-rank projections for erase and write gates, consuming parameters (one-sixth of the layer budget), shrinking the FFN by over 25%.
-
State readout: Slow-decaying state rows accumulate much larger norms than fast rows, dominating unweighted readout and forcing stronger write-time erasure that prematurely overwrites stored associations.
-
Parallel training: Channel-wise decay breaks commutativity with rank-one erasure, making standard chunkwise algorithms numerically unstable at the large chunk sizes needed for wide matrix units.
Theoretical Foundation
GDN-2 State Update (Equation 1):
where is the decay gate, the erase gate, the write gate, and the output gate.
Key theoretical results:
Proposition 3.1 (State sensitivity asymmetry): The expected squared Frobenius sensitivity to erase perturbations is:
while for write perturbations:
Since keys concentrate energy on active channels (participation ratio ≈ 5–7 out of 128), erase perturbations have limited effect, while writes scale all channels.
Proposition 3.4 (Stationary row-energy law):
where is the stationary row RMS norm, the key energy concentration, the value variance, the mean squared decay, and the mean erase rate.
Proposition 3.6 (Matched-filter readout): The optimal readout gain for retrieval lag is:
Proposition 3.10 (Erase-readout substitution): Matched-filter readout suppresses interference at query time, shifting the equilibrium erase rate downward and extending the effective memory horizon of every state channel.
Methodology
Muir Architecture
Fused Low-Rank Gate Projection (Equation 9):
Gate ranks with for MXU tile alignment.
Gate parameterizations:
Iso-parameter FFN reallocation: Setting maintains the per-layer budget while widening the FFN from 5,888 to 7,680 channels at (+30.4%).
Boundary-Pivoted Chunkwise Kernel
The chunkwise solve requires forming the triangular system matrix with entries . The kernel uses:
- Divide-and-conquer block decomposition (Equation 11):
- Boundary-pivoted decay splitting without division:
- Leaf-level Neumann series (Equation 12):
- Custom backward pass using saved and :
Empirical Validation / Results
Language Modeling (Table 1, 1.34B scale)
| Model | FW-Edu NLL ↓ | Wiki. ppl ↓ | LMB. ppl ↓ | Avg. Commonsense ↑ | 5-shot TQA ↑ |
|---|---|---|---|---|---|
| Transformer | 2.0335 | 17.17 | 10.30 | 52.05 | 14.56 |
| GDN-2 | 2.0177 | 16.80 | 10.38 | 52.46 | 16.48 |
| Muir (no γ) | 2.0006 | 16.46 | 10.26 | 53.79 | 16.52 |
| Muir (static γ) | 1.9994 | 16.35 | 10.15 | 53.40 | 17.71 |
| Muir (ours) | 1.9973 | 16.41 | 10.00 | 53.84 | 19.32 |
Associative Recall
- Single-needle (S-NIAH-1/2/3): Muir holds 100% on S-NIAH-1 through 8K; all Muir variants mitigate the 4K degradation of GDN-2.
- Multi-hop (VT): Dynamic γₜ leads all models at every context length; static γ fails on varying hop lags.
- Multi-needle (MV/MQ-NIAH): Dynamic γₜ matches or outperforms both baselines across 1K–4K.
- Real-world extractive recall: Muir improves over GDN-2 on all six Based/JRT tasks, with dynamic γₜ driving 69% of the gain.
Length Extrapolation
- Zero-shot: Muir (dynamic γ) extrapolates from 4K to 10M-token streams (2,560×) without perplexity drift; Dynamic YaRN Transformer diverges past 8K.
- Passkey retrieval: Muir (static γ) reaches 90.0% zero-shot and 99.4% post-cooldown recall at 1M tokens (256× pretraining length); GDN-2 collapses past 4K–8K.
Training Throughput
- Muir matches GDN-2 at 4K (179.4 vs. 179.3 K tokens/s) and runs +1.0–1.6% faster at 16K–32K.
- Muir trains 1.64× and 2.74× faster than Transformer at 16K and 32K respectively.
Numerical Stability
- Boundary-pivoted kernel eliminates decay overflow (NaN) on fast-decaying channels.
- Condition number for trained models (max across 1,536 chunk systems).
- Muir attains lower p90 than GDN-2 (7.7 vs. 11.1).
Mechanistic Validation (Table 3)
| Diagnostic | GDN-2 | Muir | Effect |
|---|---|---|---|
| Key participation ratio | 7.43 | 5.98 | ≪ 128 channels |
| Write-erase sensitivity ratio | 13.2 | 13.3 | 13× w vs. b |
| Stationary row-law fit () | 0.957 | 0.960 | +0.003 |
| Readout energy spread (p90/p10) | 14.7 | 9.6 | −34.7% |
| Parallel erase rate | 0.782 | 0.652 | −16.6% |
| Adjacent self-erasure | 0.406 | 0.328 | −19.2% |
Theoretical and Practical Implications
Theoretical Implications
-
Sensitivity-allocated gating is a general principle: State updates in delta-rule recurrences have fundamentally different sensitivity to erase vs. write gates due to input normalization and activation sparsity. This asymmetry justifies asymmetric rank allocation—a principle that extends beyond gated delta rules to any linear recurrent model with channel-wise gating.
-
Matched-filter readout is a principled remedy for state imbalance: The stationary row-energy law provides a closed-form prediction for how multi-timescale decay creates energy imbalance, and the matched-filter framework (balancing signal survival against interference) provides the optimal readout. The fractional power-law exponent (measured at ) is theoretically derived, not empirically tuned.
-
Erase-readout substitution: Decoupling interference suppression from write-time erasure is a fundamental mechanism for extending memory horizon—readout filtering and write-time erasure are substitutable control mechanisms.
Practical Implications
-
Iso-parameter efficiency: Muir's fused low-rank gating reduces gate-projection parameters by 4.5×, enabling a 30.4% wider FFN at zero parameter cost—improving both recurrent memory and parametric knowledge capacity.
-
Hardware-aligned algorithm design: The boundary-pivoted chunkwise kernel demonstrates that numerical stability and hardware efficiency can be jointly achieved through divide-and-conquer block decomposition with leaf-level Neumann series, routing 98% of chunkwise arithmetic onto matrix units.
-
Long-context capability at constant memory: At 1.34B, Muir maintains a 25 MB float32 state for 10M-token streams, versus 2.1 TB bfloat16 KV cache for Transformer—a fundamental advantage for deployment in memory-constrained settings.
Conclusion
Muir addresses three bottlenecks in channel-wise gated delta-rule models through theory-guided architecture design:
-
Parameter efficiency: Fusing all gates into a sensitivity-allocated low-rank projection (with smaller decay/erase bottlenecks) widens the FFN by up to 30.4% at fixed parameters and FLOPs.
-
State readout: Matched-filter readout (static profile × dynamic modulation) balances state rows, reduces write-time erasure by 17%, improves multi-hop retention from 37% to 45%, and enables 2,560× length extrapolation without perplexity drift.
-
Parallel training: The boundary-pivoted chunkwise kernel eliminates numerical instability at large chunk sizes, matching GDN-2 throughput and training 2.74× faster than Transformer at 32K.
Limitations and future directions:
- Static and dynamic readout trade single-horizon retention against multi-lag adaptability under a fixed gate-rank budget.
- Pure-JAX kernel is slower than hand-tuned Splash Attention at short contexts (< 11K).
- Future work: predicting one lag per head to unify passkey recall and multi-lag routing; pairing sliding-window attention with static-readout Muir; fusing the chunkwise kernel into a single Pallas kernel; extending sensitivity-allocated gating to matrix-state test-time optimization models.
Related papers
- SWE-Stream: Scaling Executable Training Data for SWE Agents via Progressive Construction and Elastic Streaming
SWE-Stream's progressive task construction and elastic streaming pipeline yields 80,874 executable SWE tasks, achieving 69.0% on SWE-bench Verified with 1.45x throughput over batch methods.
- Loopback Transformer: Towards a Unified View of Residual Looped Transformers
The Loopback Transformer stores block updates separately with decay-bounded attention, beating standard Transformers with 40-75% of their parameters.
- There Is No Free Loop: When Does Looping a Trained Model Pay for Its Inference Compute?
Looping transformer layers only improves accuracy in small 0.8B models, not at 4B or 9B, and is only worthwhile under a fixed parameter budget.