PromptForge
AI Glossary

Core concepts

Context window

Also known as: context length, context size

Definition

The context window is the maximum number of tokens a model can consider at once — your prompt, any attached documents, the conversation history, and the response it generates. Exceed it and the earliest content gets dropped.

The context window is a hard architectural limit, not a soft preference. It covers input and output together, which is the detail people most often miss: if you fill the entire window with your prompt, the model has no room left to answer.

Windows have grown quickly. Early models handled 2,000-4,000 tokens; current flagships range from 128,000 to over 1,000,000. But a large window is not the same as effective use of it. Models frequently show a "lost in the middle" effect, attending well to the start and end of a long context while glossing over material buried in the centre.

Practical guidance: reserve 2,000-4,000 tokens for the response, put your most important instructions at the very start or very end, and prefer retrieving the relevant 5% of a document over pasting all of it.

Example

A 200,000-token window sounds enormous, but a 150,000-token codebase plus a long conversation history can still overflow it — and quality often degrades well before the hard limit.

Related terms

Put this into practice

Understanding the term is step one. Our free courses and tools let you actually use it.