ARM: Attention with Routed-Memory for Learnable Sparse Control

Qiuhao Zeng, Jerry Huang, Peng Lu, Ruiyi Fang, Gezheng Xu, Zihao Jing, Yufei Cui, Charles Ling, Gang Niu, Boyu WangarXiv 2026

TL;DR

Attention with Routed-Memory (ARM) is a novel key-value (KV) caching architecture that addresses the linear memory growth of long-context LLM inference. By organizing the cache into a fixed-size hierarchical tree, ARM uses differentiable routing and soft, sigmoid-gated updates to compress historical information rather than discarding it. Combined with a dynamic retrieval policy, ARM maintains constant cache sizes and flat decoding latencies while outperforming traditional eviction baselines on long-context reasoning tasks.

What Problem Does This Paper Address?

As Large Language Models (LLMs) scale to handle longer contexts, they are fundamentally bottlenecked by the Key-Value (KV) cache. Storing the attention states for past tokens requires memory that grows linearly with sequence length, quickly eclipsing the memory footprint of the model itself. This shifts LLM decoding from being compute-bound to memory-bound, degrading latency and driving up hardware deployment costs.

Existing solutions fall short in various ways:

  1. Quantization reduces numerical precision but the cache still grows linearly.
  2. Token Eviction (Pruning) drops older or "less important" tokens entirely, risking the permanent loss of critical historical information.
  3. Offloading moves the cache to CPU memory, which introduces severe latency bottlenecks due to limited PCIe transfer bandwidth.

ARM aims to bridge this gap by creating a fixed-size, bounded memory cache that preserves historical context through soft, learnable compression rather than hard deletion.

Methods

ARM unifies efficient sparse attention control with dynamic memory networks through three core mechanisms:

  1. Hierarchical Routed Memory: The KV cache is structured as a fixed, multi-level tree where the leaf nodes act as memory "buckets." Incoming tokens are routed deterministically from the root to a specific leaf bucket based on semantic similarity, optimized via a self-supervised balancing loss.
  2. Learnable Soft Eviction: Instead of appending new KV pairs or evicting old ones when a bucket is full, ARM uses a Gumbel-Softmax routing policy to select a specific slot within the bucket. It then applies a sigmoid-gated update (reminiscent of a GRU cell) to softly blend the incoming token's information with the existing memory state.
  3. Adaptive Top-$M$ Retrieval: Not all queries require the same amount of context. ARM formulates cache retrieval as a Markov Decision Process (MDP). An LSTM-based policy dynamically determines how many memory buckets to retrieve on a per-input and per-layer basis, adapting attention sparsity to the complexity of the task.
Figure 1. Outline of our ARM caching structure and the space it falls within the different caching paradigms. For any incoming token, memory slots are selected from the hierarchical cache using a memory controller. The selected slots are used for attention computation. At the same time, the memory slot is updated through a gated memory update.

To ensure efficient prefilling, the authors decouple the gate computations from the recurrent state, allowing the sequential memory updates to be parallelized across tokens using standard parallel prefix-scan algorithms.

Datasets

The authors evaluated ARM by training a Llama-3-8B backbone from scratch on a 10B token subset of the FineWeb-Edu dataset.

Evaluation was performed across three major benchmark suites:

  • lm-eval: Standard short-context and commonsense reasoning tasks (e.g., WikiText, LAMBADA, PIQA, Hellaswag, BoolQ).
  • LongBench: A suite of 14 real-world long-context tasks covering single/multi-doc QA, summarization, few-shot learning, and code analysis.
  • RULER: A benchmark designed to evaluate effective context behaviors at varying lengths up to 128K tokens.

Key Insights and Ideas

  • Soft Compression Beats Hard Deletion: The authors provide an information-theoretic proof showing that under future query uncertainty, representing colliding cache values as a gated linear combination is Bayes-optimal. Softly blending tokens preserves significantly more mutual information than hard eviction policies (like FIFO or LRU).
  • Realistic Temporal Dynamics: The learned sigmoid gate naturally mimics human-like memory decay, smoothly attenuating older information over time as new context arrives, rather than dropping it abruptly.
  • Input-Dependent Sparsity: Rather than enforcing a rigid attention window, the MDP retrieval mechanism allows the model to dynamically allocate its computational budget—allocating more memory access for deep reasoning and sparse access for simple queries.

Key Results

  • Robustness at Extreme Contexts: On the RULER benchmark at a 128K context length, ARM was the only tested method to maintain performance (achieving an average score of 15.12). Baselines like Full Attention, Quantization (KIVI), and CPU Offloading suffered from Out-Of-Memory (OOM) errors, while Sliding Window Attention (SWA) dropped to near-zero accuracy.
  • Long-Context Superiority: On LongBench, ARM achieved an average score of 18.02, outperforming Full Attention (17.09), Quantization (16.98), and StreamingLLM (10.76).
  • Inference Efficiency: Benchmarking reveals that ARM delivers flat decoding latency relative to prompt length, matching the speed of sliding window methods while avoiding the massive 10× latency penalty associated with CPU offloading.
Decoding latency of ARM compared to alternative KV cache management methods across different prompt lengths.

Limitations and Future Work

  • Training Overhead: Unlike post-hoc compression methods (e.g., StreamingLLM or KIVI) which can be applied directly to off-the-shelf models, ARM requires pre-training or fine-tuning to learn its routing and gating parameters.
  • Scale Constraints: Due to compute limitations, the method was only validated on an 8B parameter model trained on 10B tokens. Testing ARM's behavior on frontier-scale models remains open.
  • Future Directions: The authors propose exploring infinite-context configurations and investigating architectures capable of sub-linear memory growth.

Summary updated

BibTeX
@misc{zeng2026arm,
  author = {Qiuhao Zeng and Jerry Huang and Peng Lu and Ruiyi Fang and Gezheng Xu and Zihao Jing and Yufei Cui and Charles Ling and Gang Niu and Boyu Wang},
  title = {{ARM: Attention with Routed-Memory for Learnable Sparse Control}},
  year = {2026},
  eprint = {2609.24417},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.24417},
}
Figure