atlas

Research map / Architectures and efficiency / Attention and transformers

Efficient Length-Generalizable Attention via Causal Retrieval for Long-Context Language Modeling

ICML 2025 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs · 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 Grouped Cross Attention (GCA) and Differentiable Retrieval-based Transformers (DRT), which learn chunk retrieval end-to-end through the next-chunk LM loss, enabling length generalization to 16M-token passkey retrieval with a fixed attention window.

Problem

Transformers generalize poorly to longer contexts and full attention is quadratic; existing retrieval-based LMs use separately trained retrievers not optimized for the causal LM objective, and Landmark Attention fails to extrapolate far beyond training length.

Approach

GCA runs cross-attention separately against each retrieved chunk and fuses outputs with softmaxed chunk-relevance scores, so the retriever gets gradients from the auto-regressive loss ("causal retrieval"); with Gumbel top-k sampling, sliding-window self-attention and a Triton kernel, attention cost is near-linear.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use DRT retrieval×2 instead of Landmark AttentionLong-range language modeling · PG19 test, eval length 16K, 128Mperplexity: 13.21 -> 13.18Helped
use DRT retrieval×2 instead of BaseLM +2 layersLong-range language modeling · ArXiv-math test, eval length 16K, 128Mperplexity: 2.94 -> 2.85Helped
use DRT retrieval×2 instead of Landmark AttentionLong-context retrieval · Single NIAH, 128Kaccuracy: 0.00 -> 100.00Helped
perform two retrievals instead of oneDRT · XSumROUGE-1: 30.30 -> 30.39Helped
perform two retrievals instead of oneDRT · CNN/DailyMailROUGE-1: 36.27 -> 36.39Helped
add Gumbel noise during top-k chunk selection (ablation)DRT · PG19 test, eval length 16K, 128Mperplexity: 13.46 -> 13.18Helped
use learned relevance scores instead of Contriever (ablation)DRT · ArXiv-math test, eval length 16K, 128Mperplexity: 3.06 -> 2.85Helped
use learned retrieval instead of random chunk selection (ablation)DRT · ArXiv-math test, eval length 16K, 128Mperplexity: 3.05 -> 2.85Helped
implement GCA without Triton (ablation)DRT · Long-range language modelingperplexityNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: PG19 ArXiv-math XSum CNN/DailyMail

Benchmarks: PG19 ArXiv-math XSum CNN/DailyMail Single NIAH 2-hop NIAH RULER-style NIAH

Metrics: perplexity ROUGE-1 ROUGE-2 ROUGE-L NIAH accuracy training throughput inference time per token memory footprint

Baselines: Base LM (sliding window + ALiBi) RPT (Contriever retriever, reimplemented) Landmark Attention Block-Recurrent Transformer CEPE Yarn-base (7B)

Builds on: RETRO Retrieval-Pretrained Transformer (RPT) Landmark Attention Memorizing Transformers FlashAttention-2

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