atlas

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

Training-Free Long-Context Scaling of Large Language Models

ICML 2024 · Large language models › Language, safety and interpretability · approach: LLM pruning and scaling data · 2 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 Dual Chunk Attention (DCA), a training-free method that remaps RoPE position indices via intra-chunk, inter-chunk and successive-chunk attention to extend Llama2/Llama3 and other RoPE models' context windows to 100k+ tokens, compatible with Flash Attention.

Problem

LLMs degrade sharply when input length exceeds pretraining context, and existing fixes (PI, NTK scaling) either need costly finetuning or increase perplexity at lengths beyond twice the training length in training-free settings.

Approach

Segment long sequences into chunks smaller than the pretraining window and reassign RoPE position indices so that intra-chunk, adjacent-chunk (successive) and distant-chunk (inter) query-key relative positions all stay within the pretrained range, with no weight updates and Flash Attention compatibility.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply Dual Chunk AttentionLlama2 7B · PG19 validation, 32768 tokensperplexity: >10^2 -> 7.89Helped
Apply Dual Chunk AttentionLlama2 70B · PG19 validation, 32768 tokensperplexity: >10^2 -> 5.30Helped
Apply Dual Chunk AttentionCodeLlama 7B · PG19 validation, 192k tokensperplexity: 24.78 -> 9.83Helped
Apply Dual Chunk AttentionTogether 7B · PG19 validation, 192k tokensperplexity: >10^2 -> 7.83Helped
Apply Dual Chunk AttentionLlama2 70B · Four research benchmarks, averageaverage score: 29.5 -> 37.8Helped
Use intra-chunk attention only, omitting information from previous chunks (ablation)Dual Chunk Attention · Passkey retrievalretrieval accuracyHurt
Add inter-chunk attention to intra-chunk attention (ablation)Dual Chunk Attention · Passkey retrieval, 12k inputretrieval performanceHelped
Add inter-chunk attention without successive-chunk attention (ablation)Dual Chunk Attention · Language modelingperplexityHurt
Add successive-chunk attention to intra-chunk and inter-chunk attention (ablation)Dual Chunk Attention · Language modeling and passkey retrievalperplexity and retrieval accuracyHelped
Select the closest in-context examples instead of random examples (ablation)ChunkLlama2 7B/13B · Qasper and QuALITYF1 and exact match: 28.2 -> 27.3; 35.6 -> 33.9; 29.3 -> 28.5; 47.9 -> 46.2Hurt

Surprising findings

Limitations

Experimental setup

Datasets: PG19 ShareGPT AlpacaGPT4 NarrativeQA Qasper QuALITY QMSum L-Eval

Benchmarks: PG19 passkey retrieval NarrativeQA Qasper QuALITY QMSum L-Eval

Metrics: perplexity retrieval accuracy F1 exact match ROUGE-geometric mean

Baselines: Llama2 Long LongLoRA Together-32k CodeLlama YaRN CLEX ReRoPE GPT-3.5-16k

Builds on: RoPE Position Interpolation NTK-Aware RoPE Flash Attention 2 LongChat

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