Summary (Overview)
- MARCH (Memory-Anchor Routing across Context History) is a novel architecture that augments recurrent state-space models with content-routed state anchors, enabling selective retrieval from earlier versions of the evolving recurrent memory without modifying the underlying recurrence.
- The method periodically checkpoints cumulative recurrent states as "state anchors," each paired with a compact content-conditioned key, creating a memory bank that grows with context length.
- MARCH uses an attention-style routing mechanism over state anchors (rather than token-level key-value pairs), including a learned null option to bypass historical memory when the current state is sufficient.
- Extensive experiments show MARCH consistently outperforms Gated DeltaNet and its Log-Linear variant across commonsense reasoning (Avg. 41.5 vs 40.1/40.0), LongBench (Avg. 14.9 vs 11.9/12.5), in-context retrieval (Avg. 23.3 vs 19.2/20.5), and NIAH tasks, including robust extrapolation beyond training context length.
- The architecture achieves competitive training efficiency: at 128K tokens, Top-4 sparse MARCH more than doubles the throughput of dense MARCH and exceeds FlashAttention-2 throughput.
Introduction and Theoretical Foundation
Background and Motivation
Large language models require effective long-context modeling, which depends on a model's ability to manage memory—determining what to preserve, how to represent it, and when to retrieve it. The paper frames sequence models as memory systems with two operations:
- Writing: incorporating new input into memory
- Reading: retrieving information relevant to the current input
Standard self-attention maintains a growing token-level memory in its key-value cache, providing a direct path to every preceding token. However, this incurs:
- Quadratic computation during training:
- Key-value cache growing linearly during autoregressive inference: per attention head
Recurrent alternatives (linear attention, state-space models) compress history into a fixed-size state:
- Enable constant-memory recurrent decoding
- But underperform on recall-intensive tasks since earlier associations get overwritten by subsequent updates
Theoretical Foundation
Memory system formulation: Let denote the hidden representation at position . The query, key, and value vectors are obtained via:
The general memory system is:
Linear attention instantiates memory as a fixed-size matrix :
Gated DeltaNet (GDN) improves writes with input-dependent retention and delta-rule updates:
where is an input-dependent retention gate, and modulates the delta update strength.
Two approaches to scaling recurrent memory (Equation 7):
- Capacity expansion: — increases memory dimension
- Temporal expansion: — retains multiple versions of the state along its trajectory
MARCH follows the temporal expansion direction by retaining cumulative snapshots of a continuously evolving recurrent state.
Methodology
3.1 Continuous Recurrent-State Anchoring
Anchor placement: For a sequence of text tokens, an anchoring policy specifies boundaries where . An anchor position is inserted after each boundary:
where is the -th occurrence of a shared learned anchor embedding .
Cumulative recurrent-state checkpointing: At each boundary , the current state is snapshotted:
Since the recurrence is not reset between boundaries, encodes the cumulative prefix up to position .
Content-conditioned anchor metadata: The anchor position reads its aligned state checkpoint:
The same input is projected into a compact routing key:
This cross-layer construction makes routing keys explicitly dependent on the content of each state anchor, not just its temporal index.
3.2 Content-Routed Historical Reading
Content-based routing: For a text token at position , the visible anchors are . The routing query scores against anchor keys:
A null option with zero payload allows bypassing historical memory. The augmented logits become:
A Top-K sparse variant restricts aggregation to the highest-scoring visible anchors, reducing computation with minimal performance loss.
Historical retrieval and residual fusion:
The additive formulation preserves the original recurrent path while introducing historical retrieval as an auxiliary residual branch.
3.3 Implementation
MARCH uses a two-stage producer–reader computation:
- Producer: Processes recurrent updates in blocks (chunkwise Gated DeltaNet), computes current-state outputs, and checkpoints states at anchor boundaries
- Reader: Jointly tiles query tokens and state anchors, reuses anchor tiles across query blocks, and fuses routing-score computation, online softmax updates, and weighted state readout accumulation into a streaming reduction
This avoids materializing the dense token-to-anchor routing matrix or per-anchor candidate readouts.
Empirical Validation / Results
Experimental Setup
- Pretraining: 50B tokens from Long-Data-Collections, sequence length 16K
- Architecture: 21 layers, hidden size 1536 (GDN: 793M params; Transformer: 693M)
- MARCH settings: routing dimension , anchoring interval tokens
- Optimization: fused AdamW, , , , weight decay 0.1, peak LR
Commonsense Reasoning (Table 1)
| Model | LMB.acc↑ | PIQA.acc↑ | Hella.acc↑ | Wino.acc↑ | ARC-e acc_n↑ | ARC-c acc_n↑ | OBQA acc_n↑ | CSQA acc↑ | Avg. |
|---|---|---|---|---|---|---|---|---|---|
| Transformer | 49.4 | 66.5 | 33.9 | 52.1 | 47.8 | 26.4 | 32.0 | 22.1 | 41.3 |
| w/ 24 Layers | 50.3 | 67.6 | 34.4 | 50.6 | 46.3 | 25.8 | 31.2 | 24.7 | 41.4 |
| Gated DeltaNet | 48.5 | 66.1 | 33.1 | 50.8 | 45.9 | 25.3 | 30.0 | 21.1 | 40.1 |
| w/ Log-Linear | 47.7 | 65.7 | 33.2 | 51.9 | 44.3 | 24.9 | 30.4 | 21.7 | 40.0 |
| w/ MARCH | 49.5 | 66.9 | 34.8 | 52.6 | 47.1 | 25.6 | 32.8 | 22.5 | 41.5 |
MARCH improves average accuracy from 40.1/40.0 to 41.5, with the largest gain on OpenBookQA (+2.8 points), and surpasses both Transformer baselines on average.
LongBench Results (Table 2)
| Model | NQA | QQA | MFQ | HQA | 2WM | Mus | GvR | QMS | MNs | TRC | TQA | SSM | Avg.↑ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Transformer | 4.4 | 4.1 | 15.9 | 7.5 | 9.9 | 4.1 | 10.7 | 11.6 | 14.5 | 21.0 | 33.9 | 28.3 | 13.8 |
| w/ 24 Layers | 3.5 | 11.1 | 18.3 | 7.8 | 9.8 | 4.1 | 11.3 | 12.9 | 12.8 | 22.5 | 47.5 | 23.2 | 15.4 |
| Gated DeltaNet | 3.0 | 4.8 | 13.3 | 5.6 | 8.7 | 2.1 | 2.6 | 11.3 | 13.0 | 18.0 | 38.6 | 21.9 | 11.9 |
| w/ Log-Linear | 3.6 | 6.2 | 13.6 | 7.1 | 8.2 | 3.3 | 6.3 | 13.2 | 13.5 | 17.0 | 32.8 | 25.1 | 12.5 |
| w/ MARCH | 4.2 | 7.8 | 14.6 | 7.4 | 11.5 | 4.8 | 8.2 | 17.4 | 14.1 | 19.0 | 43.1 | 26.3 | 14.9 (↑25%) |
Notable gains: 2WikiMultihopQA +32%, MuSiQue +45%, QMSum +32% relative improvements.
In-Context Retrieval (Table 3)
| Model | SQuAD↑ | SWDE↑ | FDA↑ | TriviaQA↑ | DROP↑ | NQ↑ | Avg.↑ |
|---|---|---|---|---|---|---|---|
| Transformer | 41.3 | 59.3 | 80.4 | 2.2 | 2.9 | 1.7 | 31.3 |
| w/ 24 Layers | 40.4 | 64.9 | 83.7 | 4.0 | 3.4 | 2.5 | 33.2 |
| Gated DeltaNet | 34.8 | 45.0 | 31.4 | 1.1 | 2.2 | 0.8 | 19.2 |
| w/ Log-Linear | 33.7 | 46.1 | 38.2 | 1.3 | 2.6 | 1.0 | 20.5 |
| w/ MARCH | 37.7 (↑8%) | 51.9 (↑13%) | 44.6 (↑17%) | 1.6 (↑23%) | 2.9 (↑12%) | 1.2 (↑20%) | 23.3 (↑14%) |
NIAH Results
At 32K context (beyond 16K training length), MARCH achieves the best result on all six tasks, retaining perfect accuracy on S-NIAH-1, while both Transformer variants and Log-Linear GDN score zero throughout. MARCH wins in 19 of 24 task–length combinations and 11 of 12 multi-needle settings.
Ablation: Chunk Size (Table 4)
- Matched training/inference: provides the best balance (32 anchors)
- Inference-time variation: Denser anchors (smaller chunks) improve retrieval at higher cost; chunk size 256 at inference gives best retrieval (SQuAD 40.35, SWDE 53.38, FDA 47.46)
- Fenwick tree organization: Achieves performance close to Log-Linear Attention, demonstrating router generalizability
Ablation: Routing Design (Table 5)
| Configuration | CS | LongBench | Retrieval | NIAH Avg. |
|---|---|---|---|---|
| Dense, , Null (default) | 41.48 | 14.87 | 23.31 | 51.33 |
| Dense, , Null | 40.94 | 13.88 | 24.52 | 48.47 |
| Top-4, , Null | 41.38 | 13.79 | 23.17 | 44.85 |
| Dense, , No Null | 41.04 | 14.11 | 22.86 | 45.98 |
- Increasing to 192 improves retrieval but hurts general performance
- Top-4 nearly matches dense routing on commonsense/retrieval but trails on NIAH (efficiency-oriented)
- Removing the null option degrades all aggregates
Training Efficiency
At 128K tokens, Top-4 MARCH:
- More than doubles the training throughput of dense MARCH
- Reduces core runtime by roughly an order of magnitude
- Achieves higher throughput than FlashAttention-2
Theoretical and Practical Implications
Theoretical Significance
-
Scaling recurrent memory beyond fixed-state bottleneck: MARCH demonstrates that temporal expansion of recurrent states (rather than only capacity expansion) effectively alleviates the single-state memory bottleneck, providing a theoretical alternative to increasing state dimensionality.
-
Content-routed retrieval over state anchors: The paper establishes that attention-style content routing can be applied at the state level (over compressed historical states) rather than token level, decoupling memory capacity from dense per-token computation.
-
Cross-layer state-conditioned routing keys: The architecture shows that routing keys can be made content-dependent through the recurrent pathway itself, enabling state-aware retrieval without explicit supervision.
Practical Implications
-
Long-context efficiency: MARCH offers a practical trade-off between memory resolution and computational cost, controllable via checkpoint density and sparse routing (Top-K).
-
Extrapolation beyond training context: Unlike Transformers (RoPE extrapolation failure) and Log-Linear GDN (state-index-dependent coefficients), MARCH's content-based router generalizes to longer contexts without new parameters.
-
Compatibility: MARCH augments existing recurrent architectures without modifying the underlying recurrence, making it a drop-in enhancement for Gated DeltaNet and potentially other linear recurrent models.
Conclusion
Key Takeaways
MARCH introduces a novel mechanism for scaling recurrent memory by preserving cumulative state checkpoints as content-routed state anchors. The architecture:
- Leaves the underlying recurrent update unchanged
- Adds a growing bank of historical memory states
- Uses attention-style routing over compact anchor keys with a learned null option
- Fuses historical readouts with current-state outputs via residual addition
Results Summary
MARCH consistently outperforms strong recurrent baselines (Gated DeltaNet, Log-Linear Gated DeltaNet) across:
- Commonsense reasoning: +1.4 average points
- LongBench: +25% relative improvement
- In-context retrieval: +14% relative improvement
- NIAH: Best performance at all context lengths including 32K extrapolation
Future Directions
- Adaptive anchoring: Replace fixed-interval checkpointing with content-driven anchoring based on state novelty or update magnitude
- Memory consolidation: Combine state anchoring with larger-capacity memory and multiple specialized partitions (short-term, episodic, consolidated knowledge)
- External memory modules: Support downstream task optimization, knowledge consolidation from experience to parametric information
- Scaling directions: Test-time training and continual learning applications
MARCH establishes historical-state retrieval as a practical approach to scaling recurrent memory beyond a single evolving state, opening new directions for efficient long-context modeling.
Related papers
- SPADE: Self-Play in Adaptive Synthetic Executable Environments
SPADE lets a single LLM both write executable training environments and solve them, achieving +8.1 average improvement over base on eight held-out benchmarks via hint-based regret self-play.
- Harness Continual Learning: Continual Adaptation Beyond Model Parameters
Harness Continual Learning enables frozen foundation models to accumulate capabilities by evolving prompts, memories, and tools around them, with guarded updates preventing harness-level forgetting.
- HarnessOpt-Bench: Evaluating LLMs at Harness Optimization
HARNESSOPT-BENCH shows optimizer model choice matters 1.8x more than coding harness choice for agent improvement, with broader search driving gains and trace reading providing no benefit.