DART: Decoded Attention over Recurrent States for Efficient Long-Context Sequence Modeling
Summary (Overview)
- Core contribution: DART (Decoded Attention over Recurrent sTates) is a novel architecture that augments Mamba-2 with state-memory attention (SMA) over compact recurrent states, enabling both recurrent compression and attention-style retrieval from the same memory representation.
- Key insight: Mamba-2's recurrent state can be interpreted as a compressed KV cache, but it only reads values (via ); DART additionally decodes token-conditioned keys from chunk state memories, enabling explicit attention-style search over compressed history.
- Efficiency gains: DART achieves 75% cache memory savings compared to token-level attention with chunk size and state size , while maintaining competitive training efficiency through FlashAttention-style computation.
- Empirical results: DART substantially improves associative recall (MQAR), real-world retrieval tasks (SWDE, FDA), and synthetic NIAH benchmarks over Mamba-2, while preserving general language-modeling quality on Pile pretraining and zero-shot downstream evaluations.
- Design principle: The SMA branch reuses the native Mamba-2 read vector for value extraction (sharing is critical for optimization), and integrates its output via a gated residual connection initialized to zero.
Introduction and Theoretical Foundation
Background: Recurrent Models vs. Attention
- Transformers provide token-level attention with quadratic training compute and linear KV-cache memory during inference.
- Recurrent models (SSMs like Mamba, Mamba-2) use compact states with linear compute but suffer from memory bottlenecks for precise long-range recall—the model cannot know which future query will need a past token when processing it.
State Space Duality (SSD)
Mamba-2 establishes an equivalence between selective SSMs and structured causal attention. The recurrent dynamics are:
The SSD view writes Mamba-2 as structured causal attention with:
- (read vector), (write vector), (input)
- serves as a compressed KV cache
- The readout extracts values from this cache
Key Observation
Mamba-2 reads values from the compressed state but does not extract keys from it. DART realizes that a chunk state contribution supports both:
- Value-side readout:
- Key-side readout: (token-conditioned key decoding)
Methodology
Chunk State Memories
For sequence length and chunk size , DART divides the sequence into chunks. Each chunk's state contribution is:
where is the decay factor, and is the last index in chunk .
State-Memory Attention (SMA)
For each token , DART forms three vectors:
- Query: (for chunk routing)
- SSM read vector: (shared with SSM branch)
- Value-side verifier:
For each historical chunk , DART computes:
- Value:
- Key:
- Chunk logit:
Gated Residual Integration
SMA logits are normalized over historical chunks via softmax, producing readout . The final output is:
is initialized to zero, so SMA starts as a zero residual and is learned during training.
Efficient Training and Complexity
FlashAttention-Style Kernel
DART implements SMA with a custom kernel (Algorithm 1) that:
- Fixes a query tile and streams over historical chunks
- Constructs and from on-chip
- Uses online softmax for numerical stability
- Recomputes intermediates in the backward pass (no HBM storage of keys/values/logits)
Complexity Analysis
- Training compute: for SMA branch (vs. for token-level attention)
- Compute ratio vs. attention: (smaller when )
- Inference cache: per head (vs. for token-level KV cache)
- Cache ratio vs. attention: — with , this gives 25% of token-level cache (75% savings)
Experiments
Synthetic MQAR (Associative Recall)
- Setup: Sweep sequence length , model width , SSD state size
- Results: DART consistently outperforms Mamba-2; with , DART reaches near-perfect accuracy across all settings. Even with , DART exceeds Mamba-2 with in matched-width configurations.
Language Modeling (Pile, 100B tokens)
- Models: 130M, 370M, 780M parameter backbones; DART adds <3% parameters via SMA branch
- Pile validation: DART preserves or slightly improves perplexity and accuracy vs. Mamba-2
- Zero-shot downstream: DART achieves higher average accuracy (e.g., 40.06 vs. 39.07 for 130M scale), with gains especially clear at smaller scales
Retrieval Capacity
- Real-world tasks: DART substantially improves SWDE (e.g., 56.5 vs. 39.9 for 780M) and FDA (28.9 vs. 17.2) over Mamba-2
- NIAH benchmarks: DART recovers large fractions of targets where Mamba-2 has near-zero recall (e.g., NIAH-Single-2 at 1024 tokens: 60.6 vs. 40.6 for 780M)
- Chunk-size ablations: Smaller evaluation chunk sizes () further improve extraction-heavy metrics
Ablations
- SMA removal: Removing SMA readout at evaluation time collapses retrieval performance (e.g., SWDE drops from 34.9 to 4.2 for 133M), confirming SMA is responsible for gains
- sharing: Sharing the native Mamba-2 read vector is critical—an independent SMA read vector fails completely (0% accuracy on MQAR)
Efficiency
- SMA kernel has lower forward time than FlashAttention-2 in tested settings
- Inference cache is substantially smaller than token-level attention (consistent with theoretical 75% savings)
Related papers
- Praxist: From Experimental Artifacts to Solution Lineages
PRAXIST, a lineage-centered generational system for autonomous R&D, achieves 80% medal rates on MLE-bench at roughly one-twelfth the cost of a Claude Opus 4.8 baseline by inheriting typed evidence rather than raw transcripts.
- KVpop — Key-Value Cache Compression with Predictive Online Pruning
KVpop trains lightweight scorers with future-attention supervision and delayed scoring, keeping 97–100% of model quality at 88% KV-cache compression on math reasoning.
- CompactionRL: Reinforcement Learning with Context Compaction for Long-Horizon Agents
CompactionRL trains long-horizon agentic LLMs by jointly optimizing context summarization and task execution under a shared reward, achieving 66.8% Pass@1 on SWE-bench Verified.