The Daniel'sCourses
Get the app
AI glossary/Context window

Context window

The context window is how much text a model can keep in view at once: your questions, whatever you pasted and the model's own answers, all together. It is measured in tokens, and when it fills up the start of the conversation drops out.

In the appTrack 01 · AI foundations

What the context window actually is

It is a desk, not a memory. What is on the desk, the model can see. What slid off it does not exist for the model, even if you wrote it twenty minutes ago.

Its size is quoted in tokens. A large context window can hold hundreds of pages, but size is not a promise that the model attends to the middle of that pile as carefully as to the ends.

Why the model forgets

When a conversation outgrows the context window, the oldest part falls away. That is the familiar experience of a model suddenly ignoring a rule you set at the beginning.

The fix is repetition rather than persuasion: restate the constraint in the prompt where it matters.

How to work with a big document

Break the work up. One chapter, one question, one outcome, then a fresh conversation for the next piece.

If you must carry a long document through several steps, ask for a short summary as you go and carry that forward instead of the full text.

Common questions

How big is a context window?

It varies by model, from a few thousand tokens to several million. The model's own documentation has the current number, and it gets raised fairly often.

Why does the model forget the beginning of a chat?

Because that part left the context window. It was not deleted, the model simply cannot see it any more, which is why important constraints need restating.

Terms

PromptPrompt engineeringTokenLLMGPTChatbotMachine learning
Back to the AI glossary
Learn AI in 5 min a day
Free download · Pro available · iOS & Android
Get the app