Abstract
Modern sequence models like Mamba often suffer from "over-allocation of attention," where irrelevant context creates noise in internal representations. Differential Mamba (Diff-Mamba) addresses this by introducing a noise-canceling mechanism that subtracts the outputs of two parallel Mamba blocks. This approach significantly improves language modeling performance, long-range retrieval, and robustness while maintaining sub-quadratic efficiency.
Introduction: The Noise Problem in SSMs
State-Space Models (SSMs) like Mamba have emerged as efficient alternatives to Transformers for long-sequence modeling. However, they are prone to an "over-allocation of attention" phenomenon. Unlike Transformers, which use softmax to exponentially suppress irrelevant tokens, Mamba's softmax-free, sequential processing can lead to important information being dispersed or drowned out by a "sea" of irrelevant intermediate tokens. This noise contributes to hallucinations and poor performance in "needle-in-a-haystack" retrieval tasks.
Methods: The Differential Mechanism
Inspired by the Differential Transformer, the authors propose Diff-Mamba. The core innovation is a differential subtraction mechanism designed to act as "noise-canceling headphones" for the model's internal states.
Instead of a single Mamba block, Diff-Mamba utilizes two parallel paths. The final output is calculated by subtracting a weighted version of the second block's output from the first:
$$Output = Mamba_1(X) - \lambda Mamba_2(X)$$
The researchers found that applying this subtraction only to the core "S6" layer was insufficient. Maximum gains were achieved by applying the differential mechanism across the entire Mamba block, including its convolutional and gating components. To stabilize training with these unnormalized outputs, an explicit RMS-Norm step was added following the subtraction.
Key Results and Insights
Diff-Mamba was evaluated across standard language modeling benchmarks (WikiText-103, The Pile), long-context tasks (PG19, BABILong), and synthetic unit tests (MAD pipeline).
Performance and Efficiency
Diff-Mamba consistently outperformed vanilla Mamba. On WikiText-103, a 12-layer Diff-Mamba improved perplexity by 0.4 points. In long-context retrieval (BABILong), Diff-Mamba achieved up to a 3.95x performance improvement over the baseline as context length increased.
While the extra computation makes Diff-Mamba approximately 12% slower than vanilla Mamba at a batch size of 64, it remains significantly more efficient than standard Transformers for long sequences.
Signal-to-Noise Ratio (SNR)
Using "Tuned-lens" analysis, the authors confirmed that Diff-Mamba exhibits a significantly higher SNR than vanilla Mamba. The model is empirically better at isolating relevant "needle" tokens from background noise. Furthermore, the benefits of this denoising effect become more pronounced as model depth increases, where dependencies become more complex.
Conclusion
Differential Mamba provides a robust empirical solution to the noise sensitivity of SSMs. By adopting a differential architecture, the model filters out irrelevant context, leading to superior performance in both standard language modeling and challenging long-range retrieval tasks. Future work will focus on scaling these findings to multi-billion parameter models and exploring applications beyond natural language processing.
Summary updated