This site only uses technical cookies required for it to work: no tracking, no profiling. Cookie Policy

Skip to content
All terms

What is an AI model's context window?

The model's working memory, measured in tokens: what fits inside is everything the model can see when answering.

The context window is a model's working memory, measured in tokens: the maximum amount of text, across prompt, attached documents and conversation history, that the model can "see" in a single request. What does not fit inside the window simply does not exist for the model at that moment: it is not ignored by choice, it is not there. This window's size has grown a lot in recent years, from a few thousand to hundreds of thousands of tokens, but a bigger window does not automatically mean better answers: filling it has a cost, in money and in latency, and models still tend to lose precision on information sitting in the middle of a very long context. For this reason the window should be treated as a resource to manage carefully, not a space to fill as much as possible.

Bigger is not automatically better

Context windows have grown enormously in recent years, from a few thousand to hundreds of thousands of tokens. But filling them is not free: more context means more cost per request (tokens are billed) and more response latency. There is also a documented phenomenon known as "lost in the middle": models tend to recall information at the start and end of a long context better, losing precision on what sits in the middle. A huge window full of irrelevant documents often produces worse answers than a small, well-curated one.

Why it matters in practice

It is why RAG stays relevant even with very large context windows: selecting the right chunks to place in context almost always beats "throwing everything in" and hoping the model finds what it needs. Designing what goes into the window, in what order and at what level of summarization, is the core of context engineering, and it should be managed as a scarce resource, not an infinite space to fill. An emerging approach like Recursive Language Models attacks the same constraint from another direction: instead of choosing what goes into the window, it treats context as an external environment to query with code, without having to ingest it whole.

  • LLM · An AI model trained on huge amounts of text that understands and generates language: the engine behind ChatGPT, Claude and Gemini.
  • RAG · A technique that grounds an LLM in your company data: it retrieves relevant documents and feeds them to the model before it answers.
  • AI tokenomics · The economics of AI tokens: what inference really costs, how it is measured (cost per million tokens) and how it is kept under control.
  • Context engineering · The discipline of deciding what information an AI model gets and how: the successor to prompt engineering for serious systems.
  • Context Rot · The decline in an LLM's relevance and accuracy as its context fills up, well before it hits the stated limit.

A term that hits close to home? Let's talk.

CONTACT ME