atlas

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

Base of RoPE Bounds Context Length

NeurIPS 2024 · Large language models › Language, safety and interpretability · approach: LLM unlearning and benchmarks · 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.

Shows that RoPE's base sets an absolute lower bound on the context length a model can truly use, derived from a long-term decay property of similarity-vs-random attention, and validates it via fine-tuning and pre-training experiments.

Problem

Long-context extension via RoPE base adjustment is usually explained by avoiding out-of-distribution rotation angles, but this can yield superficial long-context ability that keeps perplexity low while failing retrieval. The paper asks what determines the usable context length as a function of RoPE

Approach

Derives a long-term decay property: the advantage of attending to similar keys over random keys, B_{m,θ}=Σcos(mθ_i), must stay non-negative for context length L, which gives an absolute lower bound on RoPE's base for each target context length (e.g., 4.3e3 for 1k, 6.4e5 for 32k).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use a small RoPE base (500) instead of lower bound-satisfying baseLlama2-7B fine-tuned to 32k · Perplexity (PG19) and Long-eval / NIH retrievalretrieval accuracyHurt
Increase RoPE base above lower bound (e.g., 2e5 vs 1e4) when fine-tuning on 32kLlama2-7B-Base fine-tuned on 32k · Long-eval 32kLong-eval accuracyHelped
Pre-train from scratch with RoPE base 100 instead of larger base2B model pre-trained at 4k · Effective context length (NIH)effective context lengthHurt
Increase RoPE base from 1e4 to 1e6 when fine-tuning 2B model on 32k2B pre-trained model · Effective context length (NIH)effective context lengthHelped
Ensure B_m,theta >= 0 across relative distances (large enough base) versus violating it (Method 2) with OOD avoided in both (ablation)Llama2-7B extended 4k to 32k · Long-eval 30kLong-eval accuracy: 0.27 vs 0.00Helped

Surprising findings

Limitations

Experimental setup

Datasets: RedPajama subset PG19

Benchmarks: PG19 perplexity Long-eval Needle in Haystack

Metrics: perplexity retrieval accuracy effective context length

Baselines: Position Interpolation NTK-aware scaling YaRN Dynamic NTK Llama2-7B with base 500 (prior small-base work)

Builds on: RoPE Position Interpolation NTK-aware scaling YaRN

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