atlas

Research map / Architectures and efficiency / Attention and transformers

ReAttention: Training-Free Infinite Context with Finite Attention Scope

ICLR 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 ReAttention, a training-free method that performs position-agnostic top-k KV cache selection before ordinary RoPE self-attention, enabling LLMs to handle multi-million-token contexts within a finite attention window.

Problem

Length extrapolation: LLMs cannot process contexts beyond their pre-trained maximum because positional information goes out of distribution and attention entropy grows with length, limiting practical long-context use.

Approach

Select the most relevant middle KV-cache segments by dot product between the query and un-positioned keys, concatenate them with global and local caches, and only then apply positional embeddings, so the attention window and position indices stay within the pre-trained range while the total context is unbounded. A fused Triton kernel implements the top-k selection efficiently.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use ReAttention instead of StreamingLLMLLaMA3-8B-8K · LongBenchAvg.: 32.49 -> 35.03Helped
Use ReAttention instead of InfLLMLLaMA3.1-8B-128K · LongBenchAvg.: 37.14 -> 38.63Helped
Use ReAttention instead of InfLLMLLaMA3.2-3B-128K · LongBenchAvg.: 28.21 -> 39.43Helped
Use ReAttention instead of InfLLMLLaMA3-8B-Instruct-8K · InfiniteBenchAvg.: 20.28 -> 24.38Helped
Use ReAttention instead of InfLLMLLaMA3.1-8B-Instruct-128K · InfiniteBenchAvg.: 20.91 -> 22.98Helped
Use ReAttention instead of InfLLMLLaMA3.2-3B-Instruct-128K · InfiniteBenchAvg.: 14.64 -> 15.36Helped
Set chunk size to 1024 instead of the default 512 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 34.75Hurt
Set chunk size to 2048 instead of the default 512 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 34.72Hurt
Set span size to 8 instead of 32 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 22.96Hurt
Set span size to 16 instead of 32 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 24.29Hurt
Set span size to 64 instead of 32 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 34.69Hurt
Set span size to 128 instead of 32 (ablation)ReAttention on LLaMA3-8B-8K · LongBenchAvg.: 35.03 -> 34.57Hurt

Surprising findings

Limitations

Experimental setup

Datasets: LongBench L-Eval InfiniteBench Needle-In-A-Haystack RULER

Benchmarks: LongBench L-Eval InfiniteBench Needle-In-A-Haystack Multi-NIAH RULER

Metrics: accuracy F1 rouge time to first token throughput GPU memory

Baselines: StreamingLLM InfLLM Dynamic NTK full attention (FlashAttention2)

Builds on: StreamingLLM InfLLM FlashAttention Dynamic NTK

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