Instead of forcing rotary attention to extrapolate into unseen position angles where attention scores explode, Position Interpolation (PI) linearly divides every token index by L' / L, extending pretrained LLaMA models from 2,048 to 32,768 tokens in just 1,000 fine-tuning steps.

  • Extrapolation fails catastrophically: Evaluating a 2,048-token LLaMA-7B model directly on 4K to 32K sequences drives PG19 perplexity above 1,000, and even 10,000 steps of direct long-context fine-tuning only stretches its effective passkey window from 2,048 to 2,560 tokens.
  • 600x tighter theoretical bound: Chen and colleagues prove that interpolating between pretrained integer grid points bounds attention-score error roughly 600x tighter than RoPE’s extrapolation bound, keeping scores smooth without changing weights or attention code.
  • 200 steps to full passkey reach: Fine-tuning LLaMA 7B through 65B on the Pile reaches full k_max = 32,768 passkey retrieval within 200 to 1,000 steps and reduces PG19 perplexity from 7.23 (at 2K) down to 6.77 (at 32K) on LLaMA-7B.
  • Local resolution tradeoff: Compressing positions 16x crowds neighboring tokens, cutting short-context BoolQ accuracy on LLaMA-7B from 76.1% to 64.7% at 32K (under 2% drop at 8K).

Why extrapolation blows up and interpolation stays bounded

In Rotary Position Embeddings (RoPE), query-key attention scores depend on relative distance s = m - n through a weighted sum of d/2 complex sinusoids with frequencies theta_j = 10000^(-2j/d). Because d = 128 trigonometric basis functions act as a universal approximator, learned query-key coefficients can keep attention scores small inside [0, 2048] yet spike past 8,000 as soon as s > 2048. That is why a model trained at L = 2048 fails to answer a question at position 3,000 even when the evidence sits just 100 tokens earlier at position 2,900.

Position Interpolation avoids out-of-range angles by replacing f(x, m) with f(x, m * L / L'), linearly mapping [0, L') back into [0, L). Under Theorem 2.1, for any interpolated fractional position between pretrained integers s_1 and s_2, deviation from linear interpolation is bounded by (d * max_j |h_j|) / (32 * ln(10000)), roughly d * max_j |h_j| / 294.73, at least ~600x smaller than RoPE’s extrapolation upper bound.

Extrapolation vs. Position Interpolation when doubling context from 2,048 to 4,096
Direct extrapolation f(x, m)
Positions 2,048 to 4,095 hit unseen rotary angles. Trigonometric basis interference pushes fitted scores past 8,000.
PG19 PPL: above 1,000; 10K-step FT hits 2,560 passkey reach.
Position Interpolation f(x, m/2)
Scales positions into pretrained [0, 2048). Interpolation bound is ~600x smaller than extrapolation.
PG19 PPL: 16.10 at step 0, 7.12 at step 200, 6.95 at step 1,000.

Source: Chen et al. (2023), Figure 1, Theorem 2.1, and Tables 1 through 4.

How extended LLaMA models behave at 8K to 32K

Chen et al. fine-tuned LLaMA 7B, 13B, 33B, and 65B on the Pile (with FlashAttention, FSDP, zero weight decay, and lr = 2e-5 for 7B/13B or 1e-5 for 33B/65B) for 1,000 steps, comparing against 10,000-step direct fine-tuning without scaling.

On PG19 books and ArXiv Proof-pile, perplexity dropped steadily as evaluation context widened. For LLaMA-7B extended to 32,768, PG19 perplexity fell from 7.23 (2K window) to 6.91 (8K) and 6.77 (32K), while LLaMA-13B fell from 6.54 to 6.09. Even at step 0 before any fine-tuning, PI-8K on LLaMA-7B scored 16.10 perplexity on PG19 rather than blowing up above 1,000, and beat the original 7.20 baseline after just 200 steps. Fine-tuned for 10 epochs on 16K GovReport long-document summarization, extended LLaMA-7B reached 60.0 ROUGE-1 (competitive with CoLT5 Base at 58.7 and CoLT5 XL at 61.3).

LLaMA-7B tradeoffs across context extension scales (Tables 1, 2, 4, 5)
Method and targetStepsPasskey reachPG19 PPL (at L’)Short BoolQ (2K)
Baseline LLaMA-7B (2K)02,0487.2076.1%
Direct fine-tuning (8K)10,0002,5607.69n/a
PI (8K, Pile)1,0008,1926.9573.2%
PI (16K, Pile)1,00016,3846.8369.8%
PI (32K, Pile)1,00032,7686.7764.7%

Lower perplexity and higher passkey reach / BoolQ are better. Passkey reach is maximum distance with at least 20% retrieval accuracy. Source: Chen et al. (2023), Tables 1, 4, and 5.

Caveats and builder takeaway

Three constraints limit uniform Position Interpolation in practice. First, scaling every rotary frequency identically by L / L' blurs fine-grained short-range positions: short-context BoolQ fell from 76.1% to 64.7% at 32K, and ArXiv Proof-pile perplexity on the 32K-extended 7B model worsened from 2.24 at 16K to 2.48 at 32K (2.15 to 2.35 on 13B). Follow-up methods like YaRN fix this by interpolating low frequencies while leaving high-frequency local dimensions untouched. Second, the passkey benchmark only required a 20% retrieval threshold inside repetitive filler text, which proves attention reach rather than multi-hop reasoning across 32K tokens. Third, unlike ALiBi or sparse attention, PI leaves quadratic attention and linear KV-cache memory untouched, so 32K inference still pays 16x the KV-cache footprint of 2K.

Use pure Position Interpolation when you need a zero-architecture-change 4x extension (2K to 8K) on an existing RoPE checkpoint with minimal fine-tuning; for 16x+ windows or strict short-context retention, combine it with frequency-band scaling such as YaRN.