# Context window

> The maximum amount of text a language model can take in at once, measured in tokens.

Source: https://www.superintelligence.com.au/glossary/context-window/


The context window is how much a language model can hold in mind at one time: the conversation so far, any documents you paste in, the instructions it was given, and the reply it is writing. It is measured in tokens. Anything outside the window is simply not there, as far as the model is concerned.

Early chat models had windows of a few thousand tokens, a few pages of text. Current frontier models take hundreds of thousands or more, which is enough for whole books or large codebases. A bigger window lets a model answer questions about a long contract, follow a long conversation or work across many files without losing the thread.

The window is not memory in the human sense. When a conversation runs past the limit, the oldest parts fall out or are summarised, and the model has no record of them. Between conversations the model remembers nothing at all unless the product around it stores notes and feeds them back in.

A long window also has costs. Reading more tokens takes more computation, and models tend to make more use of material near the start and end of a long input than material in the middle. So a model that accepts a million tokens does not necessarily use all of them well, and testing how well a model handles long inputs is a benchmark question of its own.

Related: https://www.superintelligence.com.au/glossary/token.md, https://www.superintelligence.com.au/glossary/llm.md, https://www.superintelligence.com.au/glossary/inference.md, https://www.superintelligence.com.au/glossary/test-time-compute.md
