Explainer
Claimed and effective context length
The claimed context length is how much text a model accepts; the effective length is how much of it the model uses well on a task.
A model's context window is the most text it can take in at once, measured in tokens. Accepting text is not the same as using it well. In a 2023 study, models did best when the relevant passage sat at the beginning or end of a long input, and performance “significantly degrades” when it sat in the middle, a pattern now called lost in the middle (Liu et al.).
Published tests measure this in two common ways:
- Needle in a haystack. Hide one sentence in long filler text and ask for it. The RULER authors found models nearly perfect on this simple version yet showing “large performance drops as the context length increases” on harder tasks. Of 17 models claiming 32,000 tokens or more, only half held up satisfactorily at 32,000 (RULER).
- Low word overlap. NoLiMa words each question so it shares few words with the hidden fact. At 32,000 tokens, 11 of 13 models fell below half their short-input scores (NoLiMa).
These results describe the models tested, at the time they were tested; newer models may do better or worse. The effective length also depends on the task, where the evidence sits and how it is worded. Treat an advertised window as an upper limit, and test your own task with your own model at the length you need.
Going deeper
Anthropic's documentation calls the general decline “context rot” (Anthropic context windows). Why it happens is still argued. NoLiMa's authors suggest the decline comes from the difficulty “the attention mechanism faces in longer contexts when literal matches are absent”.
In the chatbot long read: The context window is its working view. Then try Move the evidence.
Read next: Move the evidence