Mamba-3's Oscillatory Rotations Beat Pure Decay Beyond 2K Tokens
A new analysis frames Mamba-3's rotating state updates as damped oscillators, showing phase, not just decay, drives long-context gains.
Takeaways
- New analysis interprets Mamba-3's rotations as underdamped second-order dynamics with decay plus phase.
- Underdamped regimes beat non-oscillatory damping on state-tracking tasks like parity and modular arithmetic.
- Oscillatory variants show lower perplexity at long contexts on PG-19, CodeParrot, MATH-Hard, TriviaQA, SlimPajama.
- Zeroing learned phase in pretrained models degrades accuracy, confirming phase values themselves matter.
- State geometry shows ~180 degree rotations for parity, ~120 degrees for mod-3, matching task group structure.
- Builds on the original Mamba-3 architecture using data-dependent RoPE for complex-valued state transitions.
Mamba-3 added input-dependent rotations to recurrent state updates, expanding the sequence computations that diagonal state space models can represent. Earlier Mamba-2-style transitions mainly scaled stored state down at each step. Their real, positive transition values support fading memory but exclude periodic state changes required for tasks such as parity and modular counting.
A new analysis, Understanding Mamba-3 Through Oscillatory Dynamics, examines how trained models use this capability. The paper finds that Mamba-3 combines rotation with decay to create underdamped oscillations. Controlled tasks produce phase structures aligned with their underlying arithmetic, while language-model experiments connect oscillation to stronger extrapolation beyond the training context.
Rotation gives memory a phase
In simplified terms, a Mamba-2-style transition multiplies the recurrent state by a scalar between zero and one. Each token therefore weakens previous state before adding new information. Mamba-3 introduces a complex-valued transition whose angle can depend on the current input.
The implementation avoids explicitly storing complex states. It expresses the transition through data-dependent rotary positional embedding, or RoPE, operations applied to the model’s B and C projections. The B projection controls how input enters the recurrent state, while C controls how that state contributes to the output.
A complex transition can be written as reiθ. The magnitude r determines how quickly information fades, and the angle θ determines how far the state rotates at each step. Repeated updates trace a shrinking spiral, the discrete-time analogue of a damped oscillator. This framing separates memory duration from phase evolution and gives each quantity a clear mechanical role.
The gain appears beyond 2K tokens
The authors compare constrained damping regimes on controlled state-tracking tasks, then pretrain language models with 187 million and 444 million parameters. Underdamped dynamics perform best on the structured tasks and improve language modeling as evaluation sequences extend beyond the 2,000-token training length.
| Evaluation | Observed result | Interpretation |
|---|---|---|
| Parity and modular state tracking | Underdamped models outperform variants restricted to pure decay. | Rotation represents cyclic state updates directly. |
| PG-19 | The variants are close at 2K tokens, and the oscillatory model’s advantage grows through 64K. | The benefit concentrates beyond the training context. |
| CodeParrot, MATH-Hard, TriviaQA, and SlimPajama | The same directional pattern appears across both model sizes. | The effect extends across prose, code, mathematics, and retrieval-oriented text. |
The long-context results indicate that phase helps recurrent state remain useful over more update steps. Improvements near the training length are modest, so the experiments support a targeted benefit for length extrapolation rather than a broad increase in short-context quality.
Phase traces the task
By zeroing learned rotation angles within contiguous layer windows, the authors isolate phase from decay in pretrained Mamba-3 checkpoints. The intervention preserves transition magnitudes while removing rotation. Performance falls, showing that the learned angles contribute information beyond the state’s retention timescale.
Two-dimensional slices of the recurrent state reveal phase patterns matched to the controlled computations:
- Parity: An input of 0 leaves the state near its previous phase, while an input of 1 rotates it by roughly 180 degrees. Two such rotations return the state to its starting phase.
- Modulo 3: An input of 1 produces a rotation of about 120 degrees, matching the three states of the cyclic computation.
- Language modeling: Phase channels oscillate across a range of timescales, suggesting that the model assigns different frequencies to different recurrent features.
The state geometry explains how phase can regulate information flow. Aligned vectors reinforce one another, opposed vectors cancel, and intermediate angles produce partial combinations. Decay controls how long information persists; phase controls how retained information interacts with each new update.
Design clues and open questions
The oscillator view exposes several concrete options for developers building linear recurrent models and state space architectures:
- Initialization: Set retention magnitudes and phase frequencies separately instead of treating the transition as one undifferentiated parameter.
- Regularization: Constrain phase distributions or damping regimes when a task requires long-range or cyclic state tracking.
- Diagnostics: Plot phase trajectories and ablate layer windows to identify where models store structured recurrent state.
- Evaluation: Test beyond the training context, where the reported advantage is most visible.
The work analyzes an existing architecture and releases no separate checkpoint or repository. Implementation details remain in the original Mamba-3 paper. Related research on low-rank recurrent updates explores another route for increasing the expressiveness of recurrent transitions.
The evidence leaves several questions unresolved. Short-context perplexity gains remain small, the language-model experiments cover two parameter scales, and the intervention studies do not fully identify which layers or channels carry specific linguistic features. The observed frequency range also lacks a direct mapping to syntax, topic, retrieval, or other semantic functions. Those limits make phase a measurable architectural variable and a promising research target, rather than a complete account of how Mamba-3 uses long-range context.