Context windows: how much an AI can “remember”

A context window is all the text a model can read at once. What counts toward it, why long chats get worse and cost more, and what happens when it fills up.

Popo
On this page

A language model keeps nothing between one answer and the next. When it seems to remember what you said ten messages ago, that's because the app sent those ten messages again. The context window is how much text can be sent and answered at once, counted in tokens.

Anthropic's documentation calls it the model's working memory, as distinct from the body of text it was trained on.

Context window, in tokens

GPT-320202,048
Llama 32024128,000
Claude2026, other models200,000
Claude 2026, largest1,000,000
From the GPT-3 and Llama 3 papers and Anthropic's documentation as of 30 November 2026. One million tokens is very roughly 750,000 English words.

What's in the window

More than the conversation on your screen:

You see

Your messages

The answers

Also in the window

System instructions

Tool descriptions and their results

Files and images

Memories about you

Room for the next answer

Everything in the request counts, and so does the answer being written. Apps connected to many tools can use a lot of the window before you type anything.

Why long chats cost more

Each message makes the model read everything before it. If each turn adds 400 tokens, the tenth turn reads 4,000 and the hundredth reads 40,000. The total grows with the square of the length:

Tokens the model has read in total, 400 tokens per turn

10 turns22,000
25 turns130,000
50 turns510,000
100 turns2,020,000
Calculated: 400 × n × (n + 1) ÷ 2 for n turns. Caching makes rereading the same text much cheaper, but it still counts toward the window.

Ten turns come to 22,000 tokens in all and a hundred to about 2 million. It's why a usage limit that lasted all morning runs out quickly in one very long chat.

Why long chats get worse

Text being in the window doesn't mean it gets used well.

The 2023 paper Lost in the Middle gave models many documents, only one of which held the answer, and moved it around. Performance was often highest when it was at the beginning or the end, and fell significantly when it was in the middle, even in models designed for long text.

In July 2025 Chroma tested 18 models, including GPT-4.1, Claude 4, Gemini 2.5 and Qwen3, on tasks kept equally simple while the input grew. Their results grew increasingly unreliable with length. The report's name for it, context rot, has caught on. It also notes that the popular "needle in a haystack" test, finding one planted sentence in a long text, makes models look better than they are in real use, because the sentence often shares its wording with the question.

In a long chat there's also more to be misled by: abandoned ideas, corrected mistakes and earlier versions all stay in the text with the same standing as your latest decision.

When it's full

  1. 1RefuseReport that the limit has been reached
  2. 2DropRemove the oldest messages
  3. 3SummarizeReplace earlier messages with a summary
Three approaches; an app may combine them. You may not be told which one was used.

Anthropic's documentation notes that chat interfaces such as claude.ai can manage the window on a rolling "first in, first out" basis. Dropping and summarizing both explain a familiar moment: the assistant forgets a rule you set at the start.

Working with the limit

  • Start a new chat for a new task. It's cheaper, faster and more accurate.
  • Restart a chat that's going wrong. Ask for a summary of what's been decided, check it, and paste it into a new one.
  • Put what matters at the beginning or end, not between two long documents.
  • Send the relevant part of a document where you can, not all of it.
  • Repeat rules that matter in a long chat.

Memory features that carry information between chats are something else. They store notes outside the model and add them to the window; see Does ChatGPT remember you?