Muir: Linear Attention with Sensitivity-Allocated Gating and Matched-Filter Readout
Organizations: University of Texas at Austin · Google
Abstract
Linear attention compresses context into a fixed-size key-value state for linear-time training and constant-memory inference. Gated delta-rule models decay this state and erase its prediction for an incoming key before writing a new value; Gated DeltaNet-2 (GDN-2) generalizes this with channel-wise decay and decoupled, full-rank erase and write gates. However, we show that state updates are far less sensitive to erasure than to writes: key activation and unit normalization concentrate key energy onto a sparse subset of channels, whereas value writes scale all channels, so the erase gate can be parameterized at lower rank. Furthermore, slow-decaying state rows accumulate much larger norms than fast rows, dominating unweighted readout and forcing stronger write-time erasure to suppress interference. Guided by this analysis, we introduce Muir, which fuses all gates into a sensitivity-allocated low-rank projection, re-weights state rows with a matched-filter readout gate, and reinvests the saved parameters in a wider feed-forward network. Because standard chunkwise algorithms become numerically unstable at the large chunk sizes needed to saturate wide matrix units, we design a parallel update for stable, efficient training. Across 166M-1.34B parameters, Muir lowers perplexity by 1.8-2.0% over GDN-2 and 2.5-3.6% over Transformer, raises commonsense accuracy by up to 1.9 points, and improves extractive recall over GDN-2. At 1.34B, Muir outperforms both baselines on multi-hop and multi-needle recall, extrapolates 2,560x from its 4K training length to 10M-token streams without perplexity drift, and maintains near-100% passkey retrieval to 1M tokens with static readout. Muir achieves these gains while matching GDN-2 throughput, reaching its 100B-token validation loss 1.2x faster, and training 2.7x faster than Transformer at 32K.
Figures & tables
| Language Modeling | Zero-Shot Commonsense Reasoning | 5-Shot | |||||||||||||
| Model | FW-Edu | Wiki. | LMB. | LMB. | PIQA | Hella. | Wino. | ARC-e | ARC-c | OBQA | SIQA | Avg. | Wino. | TQA | |
| NLL | ppl | ppl | acc | acc | acc n | acc | acc | acc n | acc | acc | acc | acc | acc | ||
| 166M | Transformer | 2.4569 | 31.64 | 52.69 | 28.47 | 65.67 | 35.95 | 50.99 | 55.35 | 26.28 | 20.20 | 36.39 | 39.91 | 49.96 | 4.74 |
| GDN-2 | 2.4466 | 30.84 | 39.89 | 30.60 | 64.74 | 37.02 | 50.28 | 56.61 | 26.45 | 20.40 | 37.92 | 40.50 | 50.12 | 5.80 | |
| Muir (no ) | 2.4322 | 30.31 | 34.87 | 32.68 | 65.51 | 38.19 | 52.01 | 56.48 | 27.82 | 20.80 | 38.95 | 41.55 | 52.49 | 3.77 | |
| Muir (static ) | 2.4273 | 29.83 | 40.98 | 30.58 | 66.43 | 37.92 | 51.78 | 55.30 | 26.54 | 20.80 | 38.18 | 40.94 | 51.54 | 4.32 | |
| Configuration | FineWeb-Edu Validation NLL | 1.34B PPL | 1.34B Accuracy | |||||||||||||
| Model | 166M | 406M | 834M | 1.34B | Wiki. | LMB. | LM-Eval | Based | TQA | |||||||
| Base | Transformer | – | – | – | – | – | 8,192 | 2.4569 | 2.2424 | 2.1186 | 2.0335 | 17.17 | 10.30 | 52.05 | 45.92 | 14.56 |
| GDN-2 | 128 | 128 | – | 5,888 | 2.4466 | 2.2354 | 2.1060 | 2.0177 | 16.80 | 10.38 | 52.46 | 32.08 | 16.48 | |||
| Ours | Muir (no ) | 64 | 64 | 128 | 256 | 0 | 7,680 | 2.4322 | 2.2230 | 2.0876 | 2.0006 | 16.46 | 10.26 | 53.79 | 32.86 | 16.52 |
| Muir (static ) | 64 | 64 | 128 | 256 | 0 | 7,680 | 2.4273 | 2.2191 | 2.0869 | 1.9994 | 16.35 | 10.15 | 53.40 | 33.02 | 17.71 | |
| Muir (ours) | 64 | 64 | 128 | 128 | 128 | 7,680 | 2.4276 | 2.2174 | 2.0862 | 1.9973 | 16.41 | 10.00 | 53.84 | 34.60 | 19.32 | |
| Diagnostic | Statistic | Scale | GDN-2 | Muir | Effect | Theory | |
| Sens. | Key participation ratio | 166M | 7.43 | 5.98 | ch. | Remark 3.2 | |
| Write-erase sensitivity | Layer-mean | 166M | 13.2 | 13.3 | vs. | Proposition 3.1 | |
| Energy | Stationary row-law fit | Median within-head | 166M | 0.957 | 0.960 | Proposition 3.4 | |
| Raw row-energy spread | Median within-head of | 1.34B | 14.7 | 17.2 | 17.0% | Proposition 3.4 | |
| Readout energy spread | Median within-head of | 1.34B | 14.7 | 9.6 | 34.7% | Corollary 3.8 | |
| Erase | Parallel erase rate | 1.34B | 0.782 | 0.652 | 16.6% | Proposition 3.10 |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Definition | |
|---|---|---|
| Number of residual layers | ||
| Model residual-stream width | ||
| FFN intermediate width ( in Transformer, in GDN-2, in Muir) | ||
| Per-head key and value dimensions ( ) | ||
| Number of attention heads ( ) | ||
| Sequence length and chunk length ( ) |
| Per-Head Recurrence and Readout | Gate Projections | ||||||
|---|---|---|---|---|---|---|---|
| Model | Decay | Erase | Write | Readout | Scalar | Low-Rank | Dense |
| Lin. Attn. [ Katharopoulos et al., 2020 ] | – | – | – | ||||
| RetNet [ Sun et al., 2023 ] | – † | – | |||||
| Mamba-2 [ Dao and Gu, 2024 ] | – | ||||||
| GLA [ Yang et al., 2023 ] | – | ||||||
| DeltaNet [ Yang et al., 2024 ] | – | ||||||
| Row-Energy Law | Key Rank | Max / Min | RMS Spread | Energy | Spearman | Log-Pearson | |
|---|---|---|---|---|---|---|---|
| Diagnostic ( ) | |||||||
| Stationary row energy | 12.24 | 52.4 | 5.69 | 32.3 | 1.0000 | 1.0000 | |
| Normalized Retrieval MSE | Optimal Erase | ||||||
| Geometric Horizon Readout | Horizon | Horizon | Horizon | ||||
| Geometric | Unit gain (GDN-2) | 0.3599 0.0019 | 0.6389 0.0017 | 0.8607 0.0017 | 0.90 | 0.60 | 0.30 |
| Full whitening ( ) | 0.4068 0.0025 | 0.6802 0.0021 | 0.8817 0.0016 | 0.80 | 0.50 | 0.20 | |
| Gate Config | Associative Recall Accuracy (%) | Diagnostics | ||||||||
| Model | Overall | Short | Medium | Long | Erase | Row Ener. | ||||
| acc | tok var | |||||||||
| Dense (GDN-2) | 64 | 64 | 90.40 3.79 | 96.29 2.77 | 77.32 8.49 | 33.68 9.47 | 27.9% | 1,593.0 | ||
| Erase | Erase rank | 1 | 64 | 91.28 3.26 | 97.06 2.10 | 79.01 8.12 | 35.77 9.03 | 8.4% | 1,451.0 | |
| Erase rank | 2 | 64 | 91.33 2.91 | 97.04 1.68 | 79.30 7.46 | 35.76 9.45 | 3.0% | 1,436.1 | ||
| Erase rank | 4 | 64 | 91.51 3.37 | 97.03 2.36 | 80.05 7.91 | 36.91 9.07 | 4.0% | 1,446.3 | ||
| Naive Chunkwise | Boundary-Pivoted Kernel (Ours) | |||||
| Kernel Stage | MXU | VPU | MXU | MXU | VPU | MXU |
| FLOPs | FLOPs | Share | FLOPs | FLOPs | Share | |
| Diag. blocks ( ), ( 12 ) | 0.0% | 6.3% | ||||
| Off-diag. blocks ( ) | 0.0% | 96.6% | ||||
| block-tri. merges ( 11 ) | – | 100.0% | ||||
| Tri. solve | 0.0% | 100.0% | ||||
| Throughput ( K tokens/s ) | XLA Profile ( ) | ||||||||
| Model ( ) | Compiled | Achieved | HBM Traffic | ||||||
| ( ) | ( ) | ( ) | ( ) | ( ) | TFLOP/dev | MFU ( ) | (GB/dev) | ||
| Transformer ( ) | 523.5 | 396.9 | 267.9 | 163.6 | 93.6 | 348 652 | 18.2 8.6 | 613 750 | |
| GDN-2 ( ) | 179.6 | 179.3 | 179.1 | 264.3 | 253.5 | 330 330 | 7.1 10.1 | 4,478 4,148 | |
| Muir (matched, ) | 183.4 | 183.2 | 182.6 | 276.8 | 261.8 | 285 285 | 6.2 8.9 | 4,413 4,058 | |
| Muir (ours; iso, ) | 179.5 | 179.4 | 175.6 | 268.5 | 256.1 | 324 324 | 7.1 10.2 | 4,445 4,089 | |
| Configuration | Gate Ranks & FFN Width | Param Breakdown (M) | ||||||||||||
| Model | Mixer | FFN | Total | |||||||||||
| + Gates | Params | Params | ||||||||||||
| 166M | Transformer | 8 | 1,024 | 8 | 128 | – | – | – | – | – | 4,096 | 33.55 | 67.11 | 166.20 |
| GDN-2 | 8 | 1,024 | 8 | 128 | 128 | 1,024 | 128 | 1,024 | – | 2,816 | 54.53 | 46.14 | 166.20 | |
| Muir (no ) | 8 | 1,024 | 8 | 128 | 64 | 64 | 128 | 256 | 0 | 3,584 | 41.94 | 58.72 | 166.20 | |
| Muir (static ) | 8 | 1,024 | 8 | 128 | 64 | 64 | 128 | 256 | 0 | 3,584 | 41.95 | 58.72 | 166.21 | |
| Perplexity | Zero-Shot Accuracy (%) | ||||
| Model | FW-Edu | WikiText | BoolQ | Avg. (9) | |
| Token PPL | ( ) PPL | acc | w/ BoolQ | ||
| 166M | Transformer | 11.67 | 30.15 | 59.11 | 42.04 |
| GDN-2 | 11.55 | 29.32 | 53.46 | 41.94 | |
| Muir (no ) | 11.38 | 28.87 | 58.99 | 43.49 | |
| Muir (static ) | 11.33 | 28.31 | 57.13 | 42.74 | |
| S-NIAH-1 | S-NIAH-2 | S-NIAH-3 | S-NIAH-1/2/3 Avg. | |||||||||||||||
| Model ( ) | 1K | 2K | 4K | 8K | 1K | 2K | 4K | 8K | 1K | 2K | 4K | 8K | 1K | 2K | 4K | 8K | 1–4K | 1–8K |
| Transformer | 100.0 | 100.0 | 99.6 | 0.0 | 99.8 | 100.0 | 100.0 | 0.0 | 98.0 | 96.4 | 80.8 | 0.0 | 99.3 | 98.8 | 93.5 | 0.0 | 97.2 | 72.9 |
| GDN-2 | 99.8 | 99.2 | 86.2 | 40.8 | 100.0 | 99.6 | 83.6 | 51.6 | 77.4 | 57.6 | 20.6 | 9.8 | 92.4 | 85.5 | 63.5 | 34.1 | 80.4 | 68.9 |
| Muir (no ) | 100.0 | 100.0 | 99.6 | 99.8 | 98.2 | 99.8 | 93.8 | 39.2 | 84.0 | 80.4 | 41.6 | 10.4 | 94.1 | 93.4 | 78.3 | 49.8 | 88.6 | 78.9 |
| Muir (static ) | 100.0 | 100.0 | 100.0 | 99.6 | 100.0 | 100.0 | 99.0 | 41.0 | 96.2 | 80.6 | 43.8 | 13.6 | 98.7 | 93.5 | 80.9 | 51.4 | 91.1 | 81.2 |
| Muir (ours) | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 99.8 | 96.2 | 32.0 | 88.2 | 67.4 | 37.8 | 7.0 | 96.1 | 89.1 | 78.0 | 46.3 | 87.7 | 77.4 |
| Extraction (%) | Passage Q/A ( Cut; %) | 6-Task Avg. (%) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Model | SWDE | FDA | SQuAD | TQA | NQ | DROP | Cut | Cut | Trunc. | |
| 166M | Transformer | 29.80 | 39.51 | 30.47 | 44.91 | 17.83 | 16.20 | 29.79 | 31.41 | 23.33 |
| GDN-2 | 12.37 | 9.90 | 25.56 | 44.25 | 12.13 | 17.01 | 20.20 | 21.60 | 19.41 | |
| Muir (no ) | 12.00 | 8.90 | 27.38 | 46.80 | 13.97 | 18.97 | 21.34 | 22.29 | 20.41 | |
| Muir (static ) | 10.50 | 7.63 | 25.26 | 45.85 | 12.48 | 17.87 | 19.93 | 22.01 | 18.96 | |
| Muir (ours) | 10.97 | 5.27 | 27.68 | 46.27 | 13.40 | 18.78 | 20.39 | 21.78 | 19.51 | |
| PPL | (nats) | |||||||
| Model | ||||||||
| Contiguous FineWeb-Edu Long Documents | ||||||||
| 166M | Transformer | 11.55 | 50.97 | 199.85 | 473.31 | 728.84 | 895.74 | 4.5349 0.0798 |
| GDN-2 | 11.69 | 11.44 | 11.32 | 11.29 | 11.28 | 11.28 | 0.0051 0.0018 | |
| Muir (no ) | 11.49 | 11.25 | 11.14 | 11.11 | 11.10 | 11.10 | 0.0051 0.0015 | |
| Muir (static ) | 11.39 | 11.14 | 11.03 | 11.00 | 10.99 | 10.99 | 0.0076 0.0020 | |
| RULER S-NIAH-1 Accuracy (%) | Avg. (%) | |||||||||||||
| Model ( ) | ||||||||||||||
| Zero-Shot | Transformer (YaRN) | 100.0 | 100.0 | 90.0 | 90.6 | 78.8 | 68.1 | 45.6 | OOM | OOM | OOM | OOM | 87.9 | – |
| GDN-2 | 100.0 | 98.8 | 80.0 | 40.0 | 13.8 | 11.9 | 34.4 | 23.8 | 15.0 | 10.0 | 10.0 | 57.4 | 39.8 | |
| Muir (no ) | 100.0 | 100.0 | 100.0 | 100.0 | 98.1 | 73.8 | 46.2 | 46.9 | 26.2 | 15.6 | 11.9 | 95.3 | 65.3 | |
| Muir (static ) | 100.0 | 100.0 | 100.0 | 99.4 | 100.0 | 98.8 | 98.1 | 98.8 | 95.6 | 91.9 | 90.0 | 99.7 | 97.5 | |
| Muir (ours) | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 85.6 | 26.2 | 22.5 | 17.5 | 13.1 | 12.5 | 97.6 | 61.6 | |
| Gate Ranks & FFN ( ) | FineWeb-Edu Val | WikiText | ||||||||||
| Model ( ) | Params | Token | Token | ( ) | ||||||||
| (M) | NLL | (mnat) | PPL | PPL | ||||||||
| Base | Transformer | 409.7 | – | – | – | – | – | 6,144 | 2.2424 | 7.0 | 9.42 | 21.94 |
| GDN-2 | 409.7 | 128 | 128 | – | 4,352 | 2.2354 | 0.0 | 9.35 | 21.76 | |||
| Ours | Muir (no ) | 409.7 | 64 | 64 | 128 | 256 | 0 | 5,632 | 2.2230 | 12.4 | 9.24 | 21.16 |
| Muir (static ) | 409.7 | 64 | 64 | 128 | 256 | 0 | 5,632 | 2.2191 | 16.3 | 9.20 | 21.24 | |
| Kept SVD Rank (Validation vs. in nats SE ) | ||||||
| Gate | (bias) | |||||
| Decay ( ) | 0.5801 0.2147 | 0.0259 0.0084 | 0.0043 0.0018 | 0.0020 0.0015 | 0.0007 0.0015 | 0.0001 0.0004 |
| Erase ( ) | 0.1193 0.0154 | 0.0039 0.0004 | 0.0016 0.0009 | 0.0006 0.0008 | 0.0006 0.0004 | 0.0000 0.0001 |
| Write ( ) | 0.4454 0.2248 | 0.0486 0.0048 | 0.0185 0.0022 | 0.0108 0.0015 | 0.0064 0.0010 | 0.0013 0.0007 |
| Query ( ) | 0.5639 0.2352 | 0.0296 0.0057 | 0.0118 0.0023 | 0.0077 0.0013 | 0.0045 0.0013 | 0.0015 0.0008 |
| Output ( ) | 2.7725 0.2189 | 0.7489 0.2328 | 0.4824 0.2483 | 0.3492 0.2225 | 0.2472 0.1783 | 0.0376 0.0209 |
| Diagnostic | Within-Head Statistic | Scale | GDN-2 | Muir | Effect | Theory |
| Full row-law log-Pearson | 166M | 0.951 | 0.951 | pooled | Prop. 3.4 | |
| Decay-only log-Pearson | 166M | 0.840 | 0.803 | ( pooled) | Rem. 3.5 | |
| Static gain alignment | 166M | – | 0.710 | heads | Cor. 3.8 | |
| Readout power-law slope | 1.34B | 0.00 | 0.44 | Cor. 3.8 | ||
| Readout row-RMS spread | of | 1.34B | 3.83 | 3.10 | 19.1% | Cor. 3.8 |
| Validation ( ) Across Token Positions | |||||||
|---|---|---|---|---|---|---|---|
| Intervention | Model | Mean Erase | Overall | Early | Mid | Late | |
| ( ) | |||||||
| Freeze | Freeze write gate | GDN-2 | 0.733 | 0.8325 0.0581 | 0.5799 0.1467 | 0.9517 0.1275 | 0.8261 0.0566 |
| Freeze erase gate | GDN-2 | 0.672 | 0.0574 0.0066 | 0.0153 0.0143 | 0.0523 0.0152 | 0.0578 0.0062 | |
| Isotropic erase | GDN-2 | 0.732 | 0.0844 0.0044 | 0.0189 0.0116 | 0.0658 0.0157 | 0.0859 0.0044 | |
| Freeze write gate | Muir | 0.610 | 0.3845 0.0368 | 0.2534 0.0767 | 0.4877 0.1309 | 0.3786 0.0328 | |
| MV-NIAH Recall (%) | 5-Hop VT Recall (%) | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model ( ) | Avg. | Avg. | ||||||||||
| 1K | Transformer | 84.8 | 87.2 | 85.6 | 66.0 | 80.9 | 25.8 | 5.8 | 6.0 | 6.6 | 5.2 | 9.9 |
| GDN-2 | 67.0 | 57.0 | 62.0 | 74.4 | 65.1 | 28.4 | 34.4 | 49.4 | 61.6 | 64.6 | 47.7 | |
| Muir (no ) | 85.6 | 46.0 | 49.0 | 57.4 | 59.5 | 29.2 | 36.0 | 49.0 | 57.2 | 50.8 | 44.4 | |
| Muir (static ) | 57.4 | 55.2 | 57.2 | 59.6 | 57.4 | 13.2 | 17.2 | 20.8 | 23.8 | 20.2 | 19.0 | |
| Muir (ours) | 82.4 | 84.4 | 86.6 | 91.6 | 86.2 | 48.0 | 46.0 | 61.2 | 69.2 | 75.4 | 60.0 | |
Delta-Rule Linear Attention
Delta-rule linear attention updates a compact recurrent memory to retrieve and revise sequence information with linear-time processing.
See all 39 papers