atlas

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

LongRoPE: Extending LLM Context Window Beyond 2 Million Tokens

ICML 2024 · Large language models › Instruction and fine-tuning · approach: Calibration and knowledge in LLM tuning · 15 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.

Extends pre-trained LLaMA2-7B and Mistral-7B context windows to 2048k tokens via evolutionary search for non-uniform RoPE rescale factors, progressive 256k fine-tuning, and short-context readjustment.

Problem

Pre-trained LLMs with RoPE positional embeddings have limited context windows (around 128k even after extension); extending further causes catastrophic out-of-distribution position values, scarce long training data, high fine-tuning cost, and degraded short-context performance.

Approach

Searches non-uniform RoPE rescale factors (per dimension, plus a token-position threshold for initial tokens) with an evolutionary algorithm using a monotonic constraint, then applies a progressive strategy (search and fine-tune to 256k, then a second search to 2048k without fine-tuning) and readjusts factors for short windows.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use LongRoPE instead of YaRN for extended-context interpolationLLaMA2-7B · Proof-pile 262144perplexity: 99.64 -> 1.88Helped
Use LongRoPE instead of YaRN for 2048k context extensionLLaMA2-7B · Books3 2048kperplexity: $>$10$^4$ -> 7.08Helped
Fine-tune LongRoPE at 256k rather than 128kLLaMA2-7B · Books3 2048kperplexity: 7.80 -> 7.08Helped
Fine-tune LongRoPE at 256k rather than 128kMistral-7B · Books3 2048kperplexity: 12.78 -> 13.71Hurt
Add short-context RoPE readjustment (ablation)LLaMA2-7B-2048k (ft=128k) · Proof-pile 4kperplexity: 4.16 -> 3.71Helped
Add short-context RoPE readjustment (ablation)LLaMA2-7B-2048k (ft=128k) · Open LLM benchmarkaverage accuracy: 49.3 -> 52.9Helped
Replace the second positional interpolation with LongRoPE rather than PI (ablation)LLaMA2-7B (ft=256k) · Books3 2048kperplexity: 20.17 -> 7.08Helped
Replace the second positional interpolation with LongRoPE rather than YaRN (ablation)LLaMA2-7B (ft=256k) · Books3 2048kperplexity: 8.27 -> 7.08Helped
Add start-token non-uniformity to RoPE-dimension search (ablation)LLaMA2-7B · PG19 16kperplexity: 7.28 -> 7.22Helped
Add start-token non-uniformity to RoPE-dimension search (ablation)LLaMA2-7B · PG19 32kperplexity: 13.00 -> 11.51Helped
Add start-token non-uniformity to RoPE-dimension search (ablation)LLaMA2-7B (ft=256k) · Books3 2048kperplexity: 7.08 -> 7.08No clear effect

Surprising findings

Limitations

Experimental setup

Datasets: RedPajama PG19 Proof-pile Pile-Books3 Together Long-Data Collections

Benchmarks: Proof-pile PG19 Books3 passkey retrieval Hugging Face Open LLM Leaderboard (ARC-Challenge, HellaSwag, MMLU, TruthfulQA)

Metrics: perplexity passkey retrieval accuracy accuracy

Baselines: Position Interpolation (Together-32k) Code LLaMA LongLoRA YaRN Dynamic-NTK MistralLite Mistral v0.1

Builds on: Position Interpolation NTK-aware interpolation YaRN Rotary Position Embedding

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