Abstract
Modern sequence modeling is characterized by a rapidly expanding "zoo" of architectures, from the standard Transformer to efficient State Space Models (SSMs) and gated RNNs. This paper introduces Coefficient Dynamics, a unified mathematical framework that describes these diverse models under a single theoretical roof. By viewing sequence models as systems that compute linear combinations of past values, the authors derive six fundamental design principles. These principles explain the success of existing architectures and provide a roadmap for building new models that optimally balance expressive power with computational efficiency.
Introduction: The Expressivity-Efficiency Tension
The field of deep sequence modeling currently faces a fundamental trade-off between expressivity—the ability to selectively remember or forget specific tokens—and efficiency—the ability to process long sequences with minimal computational overhead. While Transformers (using softmax attention) excel at expressivity, they suffer from quadratic scaling. Conversely, SSMs like Mamba offer linear scaling but can be more fragile in their selective capabilities. This research moves beyond benchmark-driven design by providing a mathematical language to compare these architectures and identify the fundamental trade-offs between them.
The Coefficient Dynamics Framework
The authors propose the Coefficient Dynamics framework, which observes that almost all modern sequence models compute an output $y_i$ as a weighted sum (linear combination) of past "value" vectors $v_j$. The core of any model lies in how it calculates these weights, or coefficients $(\alpha_{i,j})$.
As shown in Figure 1, the framework casts these coefficients as the output of a latent linear dynamical system triggered by "impulse inputs" (the keys $k_j$). The system is defined by four primary components:
- Evolution Matrices ($A_t$): Control how information about a key decays or rotates over time.
- Input Scaling ($b_j$): Determines the initial impact of a key impulse.
- Readout Map ($\phi$): Transforms the interaction between queries and keys into the final coefficient.
- Normalization ($\eta_i$): Ensures signals remain stable throughout the network.
By adjusting these components, the authors demonstrate that they can recreate the exact mathematical behavior of a wide range of state-of-the-art models.
Key Design Principles and Insights
Through this unified lens, several critical design principles emerge:
- The Selectivity Trade-off: Softmax attention is powerful because the exponential function creates a massive "near-zero" region, allowing the model to easily ignore irrelevant tokens. Linear models (like standard SSMs) have a "thin" zero-set, making them more susceptible to noise unless they employ complex gating or evolution dynamics.
- Positional Information via the Evolution Matrix: If the evolution matrix $A_t$ is the Identity matrix (as in standard Transformers), the model is permutation invariant and requires explicit positional embeddings. If $A_t \neq I$ (as in SSMs), the model tracks position inherently through decay or rotation.
- The Efficiency Rule: A model can only be computed efficiently (via parallel scans or RNN-style recurrence) if the readout map $\phi$ is linear. This explains why standard Transformers are $O(L^2)$ while Mamba is $O(L)$.
- Stability via Scaling: The authors provide formal proof that scaling keys by $1/\sqrt{n}$ is a mathematical necessity to keep the variance of internal signals under control as model width increases.
Experimental Validation
To validate these principles, the authors utilized the MAD (Mechanistic Architecture Design) Benchmark for synthetic tasks and Wikitext-103 for natural language modeling.
- Selectivity Matters: On selective copying tasks, models with readout maps featuring larger "near-zero" sets (like ReLU) significantly outperformed identity maps, confirming that the geometry of the readout function dictates filtering ability.
- Implicit Position: By setting $A_t = 0.95I$ (constant decay), a model solved noisy in-context recall tasks without any positional embeddings, matching the performance of a standard Transformer.
- Hardware Efficiency: Models adhering to the "Linear Readout" principle achieved massive speedups on modern GPUs as sequence lengths grew, validating the theoretical efficiency claims.
Conclusion and Future Work
While the Coefficient Dynamics framework provides a powerful tool for understanding single-layer behavior, the authors note that further research is needed to capture the complex reasoning that emerges from multi-layer interactions (e.g., induction heads). Future work will also explore the role of convolutions and complex gating mechanisms within this framework, as well as its application to multi-billion parameter Large Language Models (LLMs).
Summary updated