atlas

Research map / Architectures and efficiency / Attention and transformers

Hardware-aligned Hierarchical Sparse Attention for Efficient Long-term Memory Access

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Linear attention approximations · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Hierarchical Sparse Attention (HSA), a chunk-based sparse attention with learnable token-to-chunk relevance and a hardware-aligned Triton kernel, and integrates it into Mamba-2 as RAMba for long-range random access and length generalization.

Problem

RNNs like Mamba cannot randomly access historical context, and existing chunk-based sparse attentions (NSA, MoBA) select chunks inaccurately, both in-distribution and when extrapolating to longer contexts, while remaining efficient.

Approach

Two-stage hierarchical attention: token-level attention within each selected chunk, then chunk-level weighted fusion using stick-breaking chunk weights, so chunk selection receives end-to-end gradients from next-token prediction; combined with CPU offloading of token-level KV cache and a Triton kernel.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
add HSA to Mamba-2Mamba-2 · Long-range language modeling, mostly 16K and 64K contextsperplexityHelped
add memory reset during training (ablation)RAMba · Long-range language modeling, 16K and 64K contextsperplexity: 17.11 -> 17.15; 17.11 -> 17.01Helped
add memory reset during training (ablation)RAMba · Long-range language modeling, 4K contextperplexity: 17.63 -> 17.82Hurt
replace stick-breaking weights with softmax without positional encoding (ablation)RAMba without memory reset · ArXiv-math, eval_len=16kperplexity: 3.81 -> 5.01Hurt
remove the chunk encoder (ablation)RAMba · RULER, retrieval tasks as context length growsaccuracy: 55.22 -> 23.88Hurt
enable memory offloading (ablation)RAMba · Generating 100 tokens, prompt length=16K, batch-size=16inference time: 3.05 -> 4.19Hurt
remove shared chunk selection across HSA layers (ablation)RAMba with offloading · Generating 100 tokens, prompt length=16K, batch-size=16inference time: 4.19 -> 5.87Hurt
add HSA instead of NSAMamba-2 · Attention computation, contexts of 16K tokens or moreforward-pass speed: 3× faster than NSAHelped
add memory reset during training (ablation)RAMba · RULER, longer-context retrievalaccuracyHelped
add memory reset during training (ablation)RAMba · RULER, in-domain context lengthaccuracy: 92.76 -> 91.74; 87.10 -> 80.61Hurt

Surprising findings

Limitations

Experimental setup

Datasets: The Pile PG19 ArXiv-math Code RULER synthetic data LongBench V2 XSUM CNN/DailyMail SQuAD HotpotQA QuALITY

Benchmarks: PG19 ArXiv-math Code passkey retrieval RULER LongBench V2 XSUM CNN SQuAD HotpotQA QuALITY

Metrics: perplexity accuracy ROUGE F1 exact match throughput (tokens/s) runtime (ms) memory footprint inference time per 100 tokens

Baselines: Transformer (full attention, YaRN) Mamba-2 Mamba-2 w/ sliding window attention (ALiBi, RoPE) Mamba-2 w/ NSA FlashAttention-2

Builds on: Mamba-2 Native Sparse Attention MoBA stick-breaking attention GCA CEPE

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy