the.ai

Context / Foundations

verified

Length Extrapolation

A model trained on sequences of four thousand tokens is shown forty thousand. Nothing in the architecture forbids it — attention has no fixed length — and yet quality collapses, often into repetition or nonsense. The reason is that the model has never seen positions that far apart and has no idea what they mean.

Viz primitive · budget-splitunseen-pairs = 20

unseen-pairs holds 25% of the budget; rest holds the remaining 75%.

Position pairs at distances the model never saw in training, against the pairs it did, in equal units. Drag the inference length up to watch unseen distances take the sequence — at ten times the training length almost every pair is one the model has no experience of.

20

Reviewed by opendroid · 2026-08-18

  • arXiv:2108.12409 — Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
  • arXiv:2310.05209 — Scaling Laws of RoPE-based Extrapolation