Context window

The context window is the most text, measured in tokens, that a language model can take in and consider at once, including its own reply.

A language model holds nothing in mind between requests. Everything it can consider when it answers has to fit inside its context window: the instructions, any documents you paste in, the conversation so far and the reply it is writing. Anthropic's documentation describes the window as the model's working memory, separate from the large body of data it was trained on. In a chat, the whole earlier conversation is sent again with each new message, so a long chat fills the window turn by turn.

The window is measured in tokens and is fixed when the model is designed and trained. Early models had small ones: GPT-2, released in 2019, had a context window of 1,024 tokens. Mixtral 8x7B, published in 2024, was trained with a context of about 32,000 tokens, and later models went much further. Once the window is full, something has to give. Through an API, an oversized request is rejected with an error. Chat products drop or summarise older material to make room.

Bigger is not automatically better. A 2023 study, Lost in the Middle, found that language models used information best when it sat at the start or end of a long input, and noticeably worse when the key fact was buried in the middle, even in models built for long inputs. Anthropic's documentation names the wider problem context rot: as the token count grows, accuracy and recall decline.

Think of the context window as a desk. A bigger desk lets you spread out more papers, but you still read the page in front of you more carefully than the one in the far corner. The practical lessons follow. Put the material that matters most first or last, cut what the model does not need, and remember that providers charge for every input token you send. That last point is why retrieval-augmented generation exists: rather than pasting a whole archive into the window, a system fetches only the passages relevant to the question.

Common questions

What happens when you exceed the context window?

The model cannot see anything beyond its limit. Through an API, a request that is too long is rejected or has to be cut down before it is sent. Chat products usually handle it quietly, for example by dropping the oldest messages first or summarising them, which is why a long conversation can lose track of details from its start.

Is a bigger context window always better?

No. A larger window lets you include more material, but research has found that models handle information in the middle of long inputs less reliably than information at the start or end. Every token you send is also billed. A shorter, well-chosen input often gets a better and cheaper answer than a full window.

How many words fit in a context window?

Divide the token limit by roughly 1.33 for English. OpenAI's estimate is that 100 tokens come to about 75 words, so a 100,000-token window holds around 75,000 words of English, minus whatever space is reserved for the reply. Code, tables and other languages can use tokens faster, so the real figure varies with the material.

Does a chatbot remember earlier conversations?

Only what is placed in its context window. Within a single chat, the app resends the conversation so far with each new message. Anything outside the window, such as a chat from last week, is invisible to the model unless the product saves notes and inserts them into the window for you.

Finding more

Search for "context window" with a model's name to find its documented limit, and for "lost in the middle language models" or "long-context evaluation" to see how well models use long inputs in practice. Model providers' documentation is the reliable source for limits and billing rules, and peer-reviewed or arXiv research is the place for evidence on quality. Treat headline window sizes in launch announcements with care, since a model that accepts a long input does not always use all of it well.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.