Shared Phase and Retention Control for Efficient Adaptive Spectral Recurrence
Organizations: Peking University · GigaAI
Abstract
As new evidence arrives, a sequence model must update what it remembers and how memory influences predictions. While Transformers incur computation and cache costs scaling with context length, fixed-state recurrent models offer constant-memory inference. However, linear and spectral recurrences traditionally rely on static transitions, failing to dynamically revise how stored representations decay or rotate. While recent selective architectures introduce input-dependent transitions, they assign independent controls to every memory mode, coupling control cost to state capacity. We show that high-dimensional spectral memory does not require high-dimensional control, and introduce Shared Phase and Retention Control for Efficient Adaptive Spectral Recurrence (SPARC). SPARC employs just two input-dependent scalar signals to coordinate memory retention and phase rotation across heterogeneous complex modes, while preserving mode-specific baseline timescales and frequencies. Its diagonal affine recurrence supports parallel associative scans for sequence-level BPTT as well as exact structured Real-Time Recurrent Learning (RTRL) for online credit assignment. Across partially observable continuous control, POPGym, and sequence classification, SPARC achieves a 9.09% relative return improvement on Walker-P and a 1.36% relative accuracy gain on FordA over second-best methods. On an NVIDIA Blackwell GPU, our implementation reduces recurrent-mixer training latency by 18.2%-34.2% in fixed-token workloads and accelerates scans by 3.1x-4.7x over an optimized RG-LRU baseline. These results show that two shared control signals can efficiently govern adaptive spectral memory across online and full-sequence settings. Code is available at https://github.com/Botwwt/sparc.
Figures & tables
| Method | Ant-P | Walker-P | Hopper-P | Cheetah-P |
|---|---|---|---|---|
| RTU | 3823.8 | 899.8 | 1266.7 | 2547.3 |
| LRU | 4476.5 | 655.5 | 1363.4 | 2688.9 |
| RG-LRU | 1953.7 | 865.5 | 1224.4 | 2539.5 |
| GateLoop | 4105.6 | 911.9 | 1325.1 | 2466.1 |
| Mamba-3 | 1355.7 | 680.2 | 863.6 | 2019.9 |
| GRU | 1921.1 | 760.1 | 631.3 | 2174.1 |
| Method | FordA | SLC | UWave | pMNIST | CIFAR-10 |
|---|---|---|---|---|---|
| RTU | 95.38 | 99.67 | 93.33 | 96.75 | 59.32 |
| LRU | 95.38 | 99.67 | 92.22 | 96.82 | 60.11 |
| RG-LRU | 92.89 | 99.67 | 98.52 | 85.48 | 51.01 |
| GateLoop | 91.97 | 99.00 | 91.85 | 62.31 | 52.46 |
| Mamba-3 | 90.58 | 99.33 | 98.15 | 88.51 | 48.65 |
| GRU | 93.54 | 99.00 | 94.81 | 90.92 | 62.69 |
Appendix figures & tables20 assets
Supplementary material from the paper’s appendix.
Appendix
| Variant | Intervention and scope |
|---|---|
| Fixed shared controls | Set in every pathway; retain the learned modal spectrum and the selected content activation. |
| No adaptive retention | Set only in the transition, including its phase clock; retain the original adaptive write normalization and gate. |
| No adaptive phase | Set ; retain in the write gate. |
| No phase clock | Replace by ; keep retention and all write terms. |
| Static phase clock | Use ; retain adaptive retention and writing. |
| Static transition | Set ; retain the original adaptive write pathway. |
| Setting | Continuous control | POPGym |
| Environment interaction steps | ||
| Physical rollout length | ||
| PPO epochs per rollout | ||
| Minibatches per epoch | ||
| Real-valued recurrent state coordinates | ||
| SPARC complex modes |
| Dataset | Length | Classes | Fit | Validation |
|---|---|---|---|---|
| FordA | ||||
| StarLightCurves | ||||
| UWaveGestureLibraryAll | ||||
| Permuted MNIST | ||||
| Seq. CIFAR-10 Gray |
| Method | Autoenc. | CountRec. | Repeat1st | RepeatPrev. | NoisyPend. | HigherLow. |
|---|---|---|---|---|---|---|
| RTU | -0.427 | -0.565 | 0.448 | 0.891 | 0.244 | 0.501 |
| LRU | -0.431 | -0.597 | 0.242 | 0.908 | 0.246 | 0.498 |
| RG-LRU | -0.476 | -0.644 | 0.550 | -0.004 | 0.246 | 0.503 |
| GateLoop | -0.438 | -0.647 | 0.727 | 0.268 | 0.245 | 0.498 |
| Mamba-3 | -0.499 | -0.811 | 0.471 | -0.428 | 0.269 | 0.487 |
| GRU | -0.469 | -0.835 | 0.811 | 0.744 | 0.311 | 0.495 |
| Variant | RepeatFirst | Walker-P | FordA | CIFAR-10 |
|---|---|---|---|---|
| SPARC | ||||
| Neutral write gate | ||||
| Linear content | ||||
| Fixed write normalization | ||||
| No phase clock | ||||
| Retention-only transition |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | SPARC | Variant | (variant SPARC) |
| Autoencode | , | , | , |
| CountRecall | , | , | , |
| RepeatFirst | , | , | , |
| RepeatPrevious | , | , | , |
| Noisy Pendulum | , | , | , |
| CartPole | , | , | , |
| Task | Gate SD | Saturation (%) | Gate ratio | Content (%) |
| Autoencode | 0.0913,\text{\pm,0.0299} | 32.67,\text{\pm,3.70} | 1.171 | 15.49 |
| CountRecall | 0.0426,\text{\pm,0.0274} | 23.50,\text{\pm,5.50} | 1.252 | 25.38 |
| RepeatFirst | 0.4508,\text{\pm,0.0382} | 95.73,\text{\pm,1.79} | 1.816 | 0.76 |
| RepeatPrevious | 0.0081,\text{\pm,0.0013} | 31.52,\text{\pm,4.34} | 1.244 | 16.43 |
| Noisy Pendulum | 0.0890,\text{\pm,0.0203} | 75.65,\text{\pm,1.48} | 1.079 | 4.23 |
| CartPole | 0.0072,\text{\pm,0.0015} | 28.33,\text{\pm,5.32} | 1.149 | 26.49 |
| Task | Decay scale | Surv. (%) | Rel. surv. | Phase (deg) | Clock (%) |
| Autoencode | 2.769 | 63.99 | 1.039 | 30.553 | 38.05 |
| CountRecall | 0.708 | 80.46 | 1.114 | 17.901 | 25.30 |
| RepeatFirst | 0.255 | 99.12 | 1.091 | 2.963 | 3.29 |
| RepeatPrevious | 0.223 | 84.66 | 1.584 | 6.026 | 9.74 |
| Noisy Pendulum | 4.416 | 54.92 | 0.967 | 30.287 | 41.12 |
| CartPole | 0.623 | 67.66 | 1.210 | 17.442 | 22.16 |
| Backward | Forward + backward | |||||||
|---|---|---|---|---|---|---|---|---|
| Naive | Accel. | Speedup | Naive | Accel. | Speedup | |||
| 4 | 2048 | 2048 | 238.730 | 1.225 | 358.822 | 2.617 | ||
| 2 | 4096 | 2048 | 479.999 | 1.289 | 721.780 | 2.510 | ||
| 1 | 8192 | 2048 | 967.711 | 0.911 | 1469.467 | 1.690 | ||
| 4 | 2048 | 2560 | 236.191 | 1.081 | 358.953 | 1.824 | ||
| 2 | 4096 | 2560 | 489.609 | 1.105 | 740.985 | 1.846 | ||
| Backward | Forward + backward | |||||
|---|---|---|---|---|---|---|
| Naive | Accel. | Speedup | Naive | Accel. | Speedup | |
| 1 | 228.853 | 0.853 | 344.970 | 1.900 | ||
| 2 | 240.696 | 0.942 | 361.919 | 2.026 | ||
| 4 | 236.798 | 0.890 | 355.549 | 1.541 | ||
| 8 | 239.711 | 1.710 | 365.954 | 2.548 | ||
| 16 | 244.437 | 3.044 | 366.240 | 4.570 | ||
| Quantity | Maximum absolute error | Normalized error |
|---|---|---|
| Forward output | ||
| Input gradient | ||
| Log-decay parameter gradient | ||
| Log-phase parameter gradient | ||
| Phase-controller gradient | ||
| Retention-controller gradient |