- Concepts
- Keeping up with ML innovation
- Natural language processing
- Autoregressive language model
- Large language model
Context window
SpecificationThe maximum number of tokens, counting prompt and generated output together, that a language model can attend to in one sequence. Text beyond it must be truncated, summarized or retrieved on demand, and attention compute and KV-cache memory grow with the length actually used.
In plain terms: The most text a language model can take in at once, prompt and answer together, so anything longer has to be cut, summarized or fetched in pieces.
For example: GPT-3 handled 2,048 tokens. Llama 3.1 handles 128K tokens, roughly 300 pages, but attention cost and KV-cache memory grow with every token actually used.
Read
Papers
- Liu et al.: Lost in the Middle: How Language Models Use Long Contexts (opens in a new tab)arXiv / paper authors · 2023
About this resource
Shows that models use information at the start and end of a long context better than information in the middle, so a large window does not mean all of it is used well.
Where to read: Abstract
Checked 2026-10-31
Authority for this purpose: arXiv / paper authors publishes this original research record.
Destination inspection: Bounded public-address-pinned GET followed by destination text and concept-scope inspection
Useful destination; no explanatory claim is asserted from this link.
- arXiv record is a preprint. Verified the abstract and version record; no claim of full-paper review or venue status from the arXiv URL.
Reviewed authoritative resource
Where to read: Abstract
A first-party destination supports its documented scope; it does not establish independent performance validation or historical priority.
- Chen et al.: Extending Context Window of Large Language Models via Positional Interpolation (opens in a new tab)arXiv / paper authors · 2023
About this resource
Position interpolation extends a RoPE model's context window from 2K to as much as 32K tokens with about 1,000 fine-tuning steps by rescaling position indices instead of extrapolating.
Where to read: Abstract
Checked 2026-10-31
Authority for this purpose: arXiv / paper authors publishes this original research record.
Destination inspection: Bounded public-address-pinned GET followed by destination text and concept-scope inspection
Useful destination; no explanatory claim is asserted from this link.
- arXiv record is a preprint. Verified the abstract and version record; no claim of full-paper review or venue status from the arXiv URL.
Reviewed authoritative resource
Where to read: Abstract
A first-party destination supports its documented scope; it does not establish independent performance validation or historical priority.
- Peng et al.: YaRN: Efficient Context Window Extension of Large Language Models (opens in a new tab)arXiv / paper authors · 2023
About this resource
YaRN extends RoPE context windows more efficiently than earlier interpolation, needing far fewer tokens and training steps to reach 128K-token contexts.
Where to read: Abstract
Checked 2026-10-31
Authority for this purpose: arXiv / paper authors publishes this original research record.
Destination inspection: Bounded public-address-pinned GET followed by destination text and concept-scope inspection
Useful destination; no explanatory claim is asserted from this link.
- arXiv record is a preprint. Verified the abstract and version record; no claim of full-paper review or venue status from the arXiv URL.
Reviewed authoritative resource
Where to read: Abstract
A first-party destination supports its documented scope; it does not establish independent performance validation or historical priority.
Docs
- Context windows (opens in a new tab)Anthropic Claude documentation
About this resource
Defines the context window as the model's working memory, counting input and output tokens, and explains how extended thinking and tool results consume it.
Where to read: Full page
Checked 2026-10-31
Authority for this purpose: Anthropic Claude documentation publishes this official documentation.
Destination inspection: Bounded public-address-pinned GET followed by destination text and concept-scope inspection
Useful destination; no explanatory claim is asserted from this link.
- Vendor documentation; window sizes depend on model and change over time.
Reviewed authoritative resource
Where to read: Full page
A first-party destination supports its documented scope; it does not establish independent performance validation or historical priority.
Related concepts
Prerequisites
- TokenizationMethod
Broader
- Large language modelModel family
Related
- Document chunkingMethod
- Agent memoryMethod
- Context managementMethod
- Key-value cachingMethod
- Rotary position embeddingMethod
- Sequence parallelismMethod
- FlashAttentionMethod
- KV cache quantizationMethod
- RoPE scaling (position interpolation and YaRN)Method
- Sliding-window attentionMethod
- Needle-in-a-haystack testDataset
- RULER benchmarkDataset
Loading discussion…
