ArticleaiDeep read
What a context window actually is
Signal DeskMay 11, 20269 minUpdated Nov 6, 2026
Drafted with AI tools by the Signal Desk. Report an error

A context window is not memory. It is the fixed amount of text a model can look at in a single pass, and everything outside it simply does not exist to the model.
A deep read: the full picture, with the receipts.
The phrase "context window" gets thrown around as if it were the model's memory, and that framing causes real mistakes. People assume a model with a large context window remembers your whole history, or that pasting a long document means the model has read and retained it. Neither is true. A context window is the maximum amount of text, measured in tokens, that a model can take in for a single forward pass. It is closer to working memory held in your hand than to long-term memory in your head, and everything outside it is invisible. Understanding the mechanics explains a lot of otherwise baffling behavior.
Tokens, not words or characters#
The window is measured in tokens, and a token is not a word. Tokenizers split text into common chunks: frequent words become a single token, rare words get broken into pieces, and whitespace and punctuation count too.
The window covers both directions at once. Your prompt, any system instructions, the document you pasted, and the model's own reply all draw from the same budget. If a model has an 8,000-token window and your input is 7,500 tokens, the reply has only 500 tokens of room.
People who get mysteriously truncated answers are often just running out of window.
Why there is a limit at all#
The limit is not arbitrary. It comes from attention, the mechanism transformers use to relate every token to every other token. In the standard form, the cost of attention grows with the square of the sequence length. Double the context and you roughly quadruple the work and the memory needed to hold the intermediate scores.
Think of it as a meeting where every participant must shake hands with every other participant.
The handshakes are the pairwise comparisons attention performs, and they are why a longer context is not a free upgrade. It costs more compute and more memory for every token you add, which is why large windows arrived slowly and why they are more expensive to use.
The second cost: the KV cache#
Attention is the compute cost. Memory is the other one. So that it does not recompute everything for each new token it writes, the model keeps the attention keys and values of every token it has already seen. That store is the KV cache (key-value cache), and it grows in a straight line with the length of the context: every token adds the same amount. The authors of vLLM, a serving system, describe the cache for each request as "huge", and wasted cache memory as what limits how many requests a GPU can batch together.
To put a number on it: on Llama 3.1 8B in 16-bit, the cache takes 128 KiB per token, so a 32K-token context needs about 4.29 GB of memory on top of the model itself. Our quantization guide works the same sum for larger models.
Engineering has raised the ceiling without removing it. FlashAttention, for example, computes exact attention with fewer reads and writes to the GPU's main memory, and its authors report that this makes longer contexts practical. The quadratic compute is still there; it is just paid more efficiently.
Inside the window, not all positions are equal#
Here is the part that surprises people. Having a token inside the window does not guarantee the model uses it well. Models tend to attend most reliably to the beginning and the end of the context, and information buried in the middle of a long input can get effectively overlooked. This is sometimes called the lost-in-the-middle effect.
A 200,000-token window does not mean the model weighs all 200,000 tokens evenly. It means they all fit.
Where you place the important material still matters.
The window is stateless between calls#
This is the most consequential point for anyone building with these models. The window does not persist on its own. Each request is independent. The only reason a chat app seems to remember earlier turns is that the application re-sends the prior conversation as part of the input every single time.
That last point is why long chats start to forget their own beginning. The app is silently trimming the oldest turns to make room. The model is not forgetting. It is being shown less.
How big windows are now, and what they cost#
Windows have grown a long way. On Anthropic's newest Claude models, from Claude Opus 4.6 and Sonnet 4.6 onward, the context window is 1M tokens, and a single request can generate up to 128K tokens of output. Other Claude models, such as Claude Sonnet 4.5, stop at 200K. By the rule of thumb above, a million tokens is roughly 670,000 to 770,000 words of English.
The price of a long prompt depends on the provider. Anthropic bills a 900K-token request at the same per-token rate as a 9K-token one on Claude 4.6 and later models, with one exception: Claude Haiku 5.5 charges more once a prompt passes 100,000 tokens. Either way you pay per token, so a prompt ten times longer costs about ten times as much to send.
Anthropic's own documentation adds the warning that matters most: "more context isn't automatically better." As the token count grows, accuracy and recall degrade. It calls this context rot, a close cousin of the lost-in-the-middle effect above.
What this means in practice#
The practical advice falls out of the mechanics. Put the most important instructions and material near the start or end of your input, not buried in the middle. Do not assume a long paste was absorbed evenly. And if you need the model to recall something across many turns or many documents, the context window is the wrong tool. You want retrieval, where relevant chunks are fetched and placed into the window on demand, which keeps the window small, focused, and within budget.
Before you reach for a bigger window, run three checks:
To check whether a document fits a given model's window, and what sending it costs, the Context Window Calculator does the arithmetic.
Frequently asked questions
What is a context window in an AI model?
A context window is the maximum amount of text, measured in tokens, that a model can take in for a single forward pass. It is like working memory held in your hand rather than long-term memory, and anything outside it is invisible to the model.
Is a context window the same as memory?
No. The window is stateless between calls and the model stores nothing between requests. A chat app only seems to remember earlier turns because the application re-sends the prior conversation as part of the input every time.
How many tokens is a word?
A token is not a word. A rough rule for English is that one token is about four characters, so a 1,000-word document might be 1,300 to 1,500 tokens. Code, non-English text, and unusual formatting use the window faster.
Why do context windows have a size limit?
The limit comes from attention, which relates every token to every other token. Its cost grows with the square of the sequence length, so doubling the context roughly quadruples the compute and memory needed, making large windows slower to arrive and more expensive to use.
Does a large context window mean the model uses all the text equally?
No. Models attend most reliably to the beginning and end of the context, while information buried in the middle can be overlooked, an effect called lost-in-the-middle. A large window means the text fits, not that it is weighed evenly, so placement still matters.
What should you use instead of a large context window for recalling information across many turns or documents?
You want retrieval, where relevant chunks are fetched and placed into the window on demand. This keeps the window small, focused, and within budget.
What is the KV cache?
It is the memory a model uses to store the attention keys and values of every token already in the context, so it does not recompute them for each new token. It grows in step with the context length: on Llama 3.1 8B in 16-bit it takes 128 KiB per token, about 4.29 GB for a 32K-token context, on top of the model's own weights.
Does a bigger context window cost more to use?
Yes, because you pay for every token you send, so a long prompt costs more than a short one. Some providers also charge a higher rate past a length threshold. Anthropic bills its 1M-token Claude models at one rate per token whatever the length, except Claude Haiku 5.5, which costs more once a prompt passes 100,000 tokens.
Sources
- Vaswani et al., Attention Is All You Need (arXiv)arxiv.org
- Liu et al., Lost in the Middle: How Language Models Use Long Contexts (arXiv)arxiv.org
- Anthropic, Context windowsplatform.claude.com
- OpenAI, Conversation state (API guide)developers.openai.com
- Hugging Face, Subword tokenization (LLM Course, Ch. 2)huggingface.co
- Kwon et al., Efficient Memory Management for LLM Serving with PagedAttention / vLLM (arXiv)arxiv.org
- Dao et al., FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness (arXiv)arxiv.org
- Anthropic, Pricing (Claude Platform docs)platform.claude.com
- Hugging Face, bartowski/Meta-Llama-3.1-8B-Instruct-GGUF file listing (GGUF header: 32 layers, 8 KV heads)huggingface.co



Discussion