Topic Context windows
Foundations · How models work · 7 min read
If a model can hold a million tokens, why does it still miss things?
Updated November 28, 2026: Added a note for every reader card.
Context windows · Part 1 of 3 · 2 min
Everything the model can see at once
When you ask ChatGPT a question, the language underneath can only answer from two things. One is what it absorbed in , before it was released. The other is what you hand it along with the question. That second part, everything the model can see at once while it writes a reply, is its context window, which Anthropic describes as the model's working memory. Think of a brilliant consultant who can answer only from what they already know plus a stack of papers on the desk. Nothing outside the stack exists for them, and the stack has a maximum height.
That height is measured in , the small chunks of text models read, and Anthropic says everything in a request counts toward it. That means the hidden instructions an app gives the model, known as the , every message so far, any documents, images and tool results, and the descriptions of the tools the model can use. The reply counts too, along with any thinking the model does before answering. OpenAI defines the window the same way, as a cap on input, output and reasoning tokens together in one request.
Many current models accept 1 million tokens, which by OpenAI's rule of thumb that 100 tokens is about 75 words of English comes to roughly 750,000 words. That is a lot of room, yet it leaves two puzzles, why people still run out of it, and why a model sometimes misses something sitting right there in its window.
The first puzzle has a surprising answer. A model has no memory between your messages, so every time you send one, the app sends the entire conversation so far plus your new message, the model reads it all from the top, and its reply becomes part of the next request. That is why a long chat fills the window so fast. An , an AI that works through a task in steps and reads dozens of files and tool results along the way, fills it faster still, because every step makes every later request bigger.
When the window runs out, something has to give. When developers call Claude through its , a request whose input is already too big is rejected with a "prompt is too long" error, and if a reply hits the limit partway through, newer Claude models stop and report that the context window was exceeded. OpenAI warns that going over the window can leave you with a cut-off reply.
Chat apps usually avoid those errors by quietly trimming the conversation, and they do it in two ways. Anthropic says chat apps like claude.ai can drop the oldest messages first, and its API can automatically summarize earlier messages so a conversation keeps going, an early-release feature for newer models that Anthropic calls . Both save space by losing detail, so something you said early in a long chat may quietly no longer be there in full.
In short
The context window is everything a model can see at once while it replies. The whole conversation is sent again with every message, so the window fills fast, and when it's full something gets cut or summarized.
- Instructionsthe system prompt
- Every message so farresent each turn
- Documents and tool results
- The reply and any thinking
Quick check (optional)
Twenty messages into a chat, the assistant seems to forget something you said at the start. What most likely happened?
Go deeper
Loading context just in time
If a bigger window doesn't guarantee better use, the alternative is to put less in it and fetch the rest when needed. Anthropic's engineers describe agents built that way. Instead of loading every relevant document up front, they keep lightweight references, such as file paths, saved searches or web links, and use tools to pull the actual content in at the moment it is needed. They pair that with structured note-taking, where the agent regularly writes notes to a store outside the context window and reads them back later, so a long task keeps its important facts without carrying every earlier step. Both approaches treat the window as a desk to keep clear rather than a warehouse to fill.
A longer window isn't a better reader
The Lost in the Middle study ran one more comparison that is easy to miss. Some models came in two versions, a standard one and an extended version with a longer context window, and when an input fit inside both windows, the researchers found the two performed nearly identically. In their words, extended-context models are not necessarily better at using their input context. A longer window lets you send more, but it doesn't make the model any better at finding the relevant part of what you send, which is why the advertised window size says little about how well a model will handle your documents.
For your work · Generalist
Say you've been working with an AI assistant on a report for an hour, and it starts ignoring the style rules you gave it at the start. Chat apps can drop or summarize the oldest messages first once the window fills, and even when everything fits, models in the Lost in the Middle study found information most reliably at the start or end of the input. Paste your key rules again at the end of your next message, or start a fresh chat with a short summary of what you've agreed.
Your toolkit · Restate at the end. In a long chat, repeat your key instructions at the end of your latest message.
For your career · Knowing how context works makes you better with every AI tool. Next: Prompting and context engineering (how to choose what goes in), then What AI costs (why long inputs cost more).
Career paths are getting more detailed and more tailored to you soon.
Words in this lesson (14)
- agent
- An AI system that works toward a goal over several steps, calling a model, using tools and deciding what to do next, instead of giving one reply.
- API
- Short for application programming interface, the way a developer's software sends requests to a model and gets answers back, usually paid per token.
- attention
- The part of a language model that, for each token, weighs every earlier token to decide which ones are relevant to what comes next.
- compaction
- Summarizing the earlier part of a long conversation so it can keep going inside the context window, at the cost of some detail.
- context rot
- The drop in accuracy and recall as a model's context fills up with more and more tokens.
- context window
- Everything a model can see at once while it writes a reply, measured in tokens, including the reply itself.
- GPU
- Short for graphics processing unit, the kind of chip that runs AI models. It does huge numbers of small calculations at once and has its own fast memory.
- KV cache
- Notes a model keeps in chip memory about every earlier token so it does not redo that work for each new token.
- model
- A program that has learned from examples to turn an input, such as your question, into an output, such as an answer. Inside, it is a large set of learned numbers.
- needle in a haystack
- A simple test that plants one fact in a long text and asks the model to find it.
- system prompt
- Hidden instructions an app gives the model before your messages, which also take up room in the context window.
- tokens
- The small chunks of text a model reads and writes, such as a word, part of a word or a punctuation mark. Prices, limits and speed are all counted in them.
- tool
- Something a model can ask to use, such as web search, running code or a payment system. The software runs it and hands the result back to the model.
- training
- The stage where a model learns. It guesses on examples with known answers, and its numbers are nudged until the guesses improve. It happens before the model is put to use.
Sources
Original research and official documents used for this version.
platform.claude.com ↗developers.openai.com ↗help.openai.com ↗arxiv.org ↗arxiv.org ↗arxiv.org ↗arxiv.org ↗platform.claude.com ↗developers.openai.com ↗research.trychroma.com ↗anthropic.com ↗arxiv.org ↗