Skip to main content
Deployment & Operations

Context Window

A context window is the maximum amount of text — measured in tokens — a language model can read and reason over in one inference call, equivalent to the model's working memory for that turn.

AIDOLS Research Team · Editorial standards

Full definition

Context windows have grown from 1,024 tokens (GPT-2) and 2,048 (GPT-3) to 4K–16K (GPT-3.5 Turbo), 200K (Claude Sonnet 4.5), 1M (Gemini 1.5 Pro), and beyond. Larger windows enable RAG over more documents, longer conversations, and full-codebase reasoning — but quality degrades non-uniformly across the window ("lost in the middle" effect), and inference cost grows quadratically with attention. The right context size is task-specific.

Why it matters

Context-window selection is now a real engineering decision: a 1M-token window costs 100× more per query than a 10K window for many tasks, and may not deliver better quality if the relevant signal is overwhelmed by noise. Strong RAG often beats brute-force long-context, especially under cost pressure.

Example

A legal-research team compares two patterns for a 200-page deposition: (a) load the whole document into Claude's 200K context, (b) RAG-retrieve the 8 most relevant passages. RAG produces equivalent answer quality at 12% of the inference cost.

Next steps

More deployment & operations terms

Source & further reading

Primary source: Liu et al. — "Lost in the Middle: How Language Models Use Long Contexts" (2023).

Citation policy: this entry is part of the AIDOLS AI Implementation Glossary and may be quoted for research, journalism, and education with attribution to aidolsgroup.com/en/glossary/context-window/.