atlas

Research map / Large language models / Language, safety and interpretability

InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memory

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: Pruning and circuits in LLMs · 11 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 InfLLM, a training-free block-level context memory with sliding-window attention that lets LLMs pretrained on a few thousand tokens process extremely long sequences (up to 1,024K).

Problem

LLMs pre-trained on short sequences cannot process much longer inputs due to out-of-domain positions and attention distraction from noisy distant context; existing fixes require costly continual training.

Approach

Stores evicted distant KV vectors in block-level memory units, represents each unit by its top-scoring representative tokens selected via attention-based scores, and at each step looks up only the most relevant units to attend alongside a local sliding window; uses CPU offloading with an LRU-style GPU cache. Entirely training-free.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add InfLLM context memory to Mistral-7B-Instruct-v0.2Mistral-7B-Instruct-v0.2 · ∞-BenchAvg.: 44.8 -> 57.7Helped
Add InfLLM context memory to Llama-3-8B-InstructLlama-3-8B-Instruct · ∞-BenchAvg.: 38.0 -> 45.0Helped
Use InfLLM instead of continual long-sequence fine-tuningLlama-3-8B-Instruct · ∞-BenchVRAM: 76.6G -> 26.3GHelped
Use InfLLM instead of continual long-sequence fine-tuningLlama-3-8B-Instruct · ∞-BenchTime: 40.4s -> 26.7sHelped
Apply InfLLM context memory to Llama-1MLlama-1M · ∞-BenchR.KV: 23.2 -> 55.8Helped
Replace InfLLM with RAG-E5 retrievalMistral-7B-Instruct-v0.2 · ∞-Bench retrievalR.KV: 13.2 -> 96.8Hurt
Add InfLLM context memory to Mistral-7B-Instruct-v0.2Mistral-7B-Instruct-v0.2 · LongBenchAvg.: 43.78 -> 44.02Helped
Add InfLLM context memory to Llama-3-8B-InstructLlama-3-8B-Instruct · LongBenchAvg.: 44.73 -> 46.95Helped
Use memory lookup during both encoding and decoding instead of decoding only (ablation)InfLLM · ∞-Bench Retrieve.KVR.KV: 85.2 -> 96.8Helped
Add memory lookup (ablation)InfLLM · ∞-Bench Retrieve.KVR.KV: 0.4 -> 96.8Helped
Use selected representative tokens instead of mean key-vector representations (ablation)InfLLM · ∞-Bench Retrieve.KVR.KV: 84.6 -> 96.8Helped
Use memory lookup during both encoding and decoding instead of decoding only (ablation)InfLLM · ∞-Bench Math.FindMath.F: 26.3 -> 25.7Hurt

Surprising findings

Limitations

Experimental setup

Datasets: ∞-Bench LongBench

Benchmarks: ∞-Bench LongBench Retrieve.PassKey (1024K scaling)

Metrics: accuracy score (average) VRAM usage time consumption cache miss rate

Baselines: Mistral-7B-Instruct-v0.2 Llama-3-8B-Instruct NTK SelfExtend LM-Infinite StreamingLLM H2O Llama-3-8B-Instruct-Gradient-1048k RAG-E5

Builds on: StreamingLLM LM-Infinite NTK-aware RoPE SelfExtend H2O

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