atlas

Research map / Large language models / Instruction and fine-tuning

LLM Maybe LongLM: SelfExtend LLM Context Window Without Tuning

ICML 2024 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems · 13 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 SelfExtend, an inference-only method that extends LLM context windows by mapping distant relative positions via floor-division grouped attention while keeping standard neighbor attention, requiring no fine-tuning.

Problem

LLMs with RoPE fail on inputs longer than their pretraining context window because unseen (out-of-distribution) relative positions appear at inference; existing extension methods require fine-tuning on long data.

Approach

Build two-level attention at inference: grouped attention that floor-divides positions for distant tokens (mapping unseen relative positions into the pretrained range) and standard neighbor attention for tokens within a local window; merge both before softmax. Only the attention computation changes, so no weights are updated.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply SelfExtend to extend Llama-2-7B-chat contextLlama-2-7B-chat · PG19, 16384perplexity: > 10^3 -> 9.274Helped
Apply SelfExtend to extend Mistral-7B-Instruct-v0.1 contextMistral-7B-Instruct-v0.1 · PG19, 16384perplexity: > 10^3 -> 9.128Helped
Extend Llama-2-7B-chat context with SelfExtend to 25kLlama-2-7B-chat · LongBench HotpotQAscore: 25.4 -> 35.47Helped
Apply SelfExtend at 16k contextLlama2-13B-chat · L-Eval averagescore: 39.01 -> 42.10Helped
Apply SelfExtend at 16k contextMistral-7B-Instruct-v0.1 · L-Eval averagescore: 43.94 -> 45.27Helped
Apply SelfExtend at 8k contextPhi-2 · L-Eval averagescore: 42.64 -> 44.69Helped
Apply SelfExtend to SOLAR-10.7BSOLAR-10.7B-Instruct-v1.0 · L-Eval averagescore: 55.34 -> 58.30Helped
Extend Phi-2 to 4k with SelfExtend (group size 4, neighbor window 512) (ablation)Phi-2 · LongBench NarrativeQAscore: 4.46 -> 6.49 (+45.52\%)Helped
Extend Phi-2 to 6k with SelfExtend (group size 8, neighbor window 512) (ablation)Phi-2 · LongBench NarrativeQAscore: 4.46 -> 8.98 (+101.35\%)Helped
Extend Phi-2 to 8k with SelfExtend (group size 12, neighbor window 512) (ablation)Phi-2 · LongBench NarrativeQAscore: 4.46 -> 12.04 (+169.96\%)Helped
Increase Phi-2 SelfExtend context from 6k to 8k (ablation)Phi-2 · LongBench Qasperscore: 12.84 -> 12.10Hurt
Increase Phi-2 SelfExtend context from 6k to 8k (ablation)Phi-2 · LongBench TRECscore: 62.5 -> 60.0Hurt

Surprising findings

Limitations

Experimental setup

Datasets: PG-19 LongBench L-Eval Hugging Face Open LLM Leaderboard tasks (ARC-c, HellaSwag, MMLU, TruthfulQA, GSM8K)

Benchmarks: PG-19 Passkey retrieval LongBench L-Eval Hugging Face Open LLM Leaderboard Varying-length passkey retrieval

Metrics: perplexity accuracy F1 / task score

Baselines: Llama-2-7b-chat LongChat1.5-7B-32k Vicuna1.5-7B-16k CLEX-7B-16k CodeLlama-7B-16k MistralLite-16k Yarn-Llama-2-7b-64k LongLora-7b-16k Llama2-13b-NTK GPT-3.5-Turbo-16k

Builds on: RoPE position interpolation ReRoPE LongBench L-Eval

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