Optimal Decay Spectra for Linear Recurrences
Abstract
Linear recurrent models offer linear-time sequence processing but often suffer from suboptimal long-range memory. We trace this to the decay spectrum: for channels, random initialization collapses the minimum spectral gap to , yielding sub-exponential error ; linear spacing avoids collapse but degrades to , practically algebraic over long contexts. We introduce Position-Adaptive Spectral Tapering (PoST), an architecture-agnostic framework combining two mechanisms: (1) Spectral Reparameterization, which structurally enforces geometrically spaced log-decay rates, proven minimax optimal at rate ; and (2) Position-Adaptive Scaling, the provably unique mechanism that eliminates the scale mismatch of static spectra (where only of channels are effective at position ) by stretching the spectrum to the actual dependency range, sharpening the rate to . This scaling natively induces fractional invariance: the impulse response becomes scale-free, with channels interpolating between relative and absolute temporal coordinates. PoST integrates into any diagonal linear recurrence without overhead. We instantiate it across Mamba-2, RWKV-7, Gated DeltaNet, Gated Linear Attention, and RetNet. Pre-training at 180M-440M scales shows consistent zero-shot language modeling improvements, significant long-context retrieval gains for Mamba-2 (MQAR and NIAH), and competitive or improved performance across other architectures. Code: https://github.com/SiLifen/PoST.
Figures & tables
| Paradigm | Min. Spectral Gap | Minimax Error (Power-Law Kernel) |
|---|---|---|
| Random | ||
| Linear | ||
| Geometric (static) | ||
| PoST (Ours) |
| state | state | state | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Model | 512 | 1K | 2K | 4K | Avg | 512 | 1K | 2K | 4K | Avg | 512 | 1K | 2K | 4K | Avg |
| Mamba-2 | 100.0 | 96.8 | 62.2 | 18.9 | 69.5 | 99.2 | 85.2 | 41.3 | 11.6 | 59.4 | 99.3 | 80.6 | 31.2 | 5.7 | 54.2 |
| +PoST | 100.0 | 97.4 | 68.3 | 25.1 | 72.7 | 99.8 | 92.1 | 51.6 | 13.2 | 64.2 | 99.6 | 87.8 | 44.1 | 12.7 | 61.0 |
| RWKV-7 | 100.0 | 100.0 | 96.1 | 39.2 | 83.8 | 100.0 | 100.0 | 80.1 | 9.5 | 72.4 | 100.0 | 95.2 | 46.0 | 10.8 | 63.0 |
| +PoST | 100.0 | 100.0 | 98.5 | 52.9 | 87.8 | 100.0 | 100.0 | 98.0 | 28.5 | 81.6 | 100.0 | 99.3 | 70.9 | 18.8 | 72.2 |
| Gated DeltaNet | 100.0 | 100.0 | 92.0 | 42.4 | 83.6 | 100.0 | 96.4 | 56.7 | 15.9 | 67.2 | 99.8 | 82.7 | 31.7 | 7.4 | 55.4 |
| Model | LAMBADA | HellaSwag | PIQA | ARC-Easy | ARC-Challenge | WinoGrande | OpenBookQA | Avg | |
|---|---|---|---|---|---|---|---|---|---|
| acc | ppl | acc | acc | acc | acc | acc | acc | ||
| Mamba-2 180M | 21.6 | 145.4 | 31.1 | 62.9 | 50.4 | 24.7 | 49.6 | 30.6 | 38.7 |
| +PoST | 21.5 | 148.2 | 31.3 | 63.2 | 50.1 | 24.9 | 50.6 | 30.0 | 38.8 |
| RWKV-7 180M | 27.9 | 69.6 | 32.1 | 63.1 | 49.7 | 25.7 | 51.3 | 29.0 | 39.8 |
| +PoST | 28.3 | 71.9 | 32.1 | 62.9 | 52.1 | 25.3 | 51.8 | 32.0 | 40.6 |
| Gated DeltaNet 180M | 23.8 | 94.5 | 31.9 | 62.7 | 49.6 | 24.2 | 51.1 | 30.6 | 39.1 |
| Single-Needle | Multi-Needle | ||||||||||||||||||
| Single-1 | Single-2 | Single-3 | MultiKey | MultiQuery | MultiValue | ||||||||||||||
| Model | 1K | 2K | 4K | 1K | 2K | 4K | 1K | 2K | 4K | 1K | 2K | 4K | 1K | 2K | 4K | 1K | 2K | 4K | Avg |
| Mamba-2 180M | 44.0 | 5.6 | 0.2 | 15.4 | 3.6 | 0.8 | 0.0 | 0.0 | 0.0 | 9.0 | 6.0 | 1.6 | 8.5 | 5.5 | 1.4 | 4.9 | 4.5 | 1.7 | 6.3 |
| +PoST | 95.6 | 47.4 | 2.0 | 71.0 | 13.2 | 8.4 | 4.8 | 0.6 | 1.8 | 17.0 | 16.0 | 6.4 | 12.6 | 12.6 | 3.1 | 11.1 | 12.0 | 3.5 | 18.8 |
| RWKV-7 180M | 99.6 | 97.4 | 62.6 | 66.8 | 11.8 | 12.4 | 0.0 | 0.0 | 0.0 | 17.8 | 16.8 | 8.8 | 14.1 | 13.1 | 3.3 | 16.2 | 11.5 | 7.0 | 25.5 |
| +PoST | 99.8 | 93.6 | 57.8 | 90.2 | 11.6 | 5.4 | 3.0 | 0.2 | 0.0 | 17.8 | 14.0 | 5.8 | 16.1 | 7.5 | 0.8 | 15.3 | 10.8 | 3.0 | 25.1 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | 180M | 440M |
| 768 | 1,024 | |
| ( ) | 1,536 | 2,048 |
| Number of layers | 24 | 48 |
| 128 | 128 | |
| Head dimension | 64 | 64 |
| Number of heads | 24 | 32 |
| Parameter | Value |
|---|---|
| Training data | FineWeb-Edu [ 24 ] |
| Training context length | 2,048 |
| Tokenizer | Llama-3.1 [ 9 ] |
| Hardware | H200-SXM |
| Optimizer | AdamW [ 23 ] |
| Warmup | 1% of total steps |
| Mamba-2 (Baseline) | Mamba-2 PoST | |
|---|---|---|
| A initialization | S4D-Real: | Geometric (Def. 4.4 ) |
| Timescale range at | uncontrolled | (dynamic: at position ) |
| initialization | Random (default) | Fixed: |
| Position adaptive | No | Yes |
| RWKV-7 (Baseline) | RWKV-7 PoST | |
|---|---|---|
| Decay bias init | Power-law + zigzag (official) | Geometric (Def. 4.4 ) |
| range | (zigzag) | Eq. 12 (increasing) |
| Timescale range at | uncontrolled (layer-dep.) | (dynamic: at position ) |
| Taper exponents | — | Cor. 5.1 ; (slow), (fast) |
| Position adaptive | No | Yes |
Linear RNNs
Linear recurrent neural networks (RNNs) model sequences with linear state updates, aiming for efficient, parallelizable memory over long contexts.
See all 22 papers