← AI glossary

AI glossary · Beginner · Language models

Context window

A context window is the maximum amount of text an AI model can read, keep in mind and work with at one time. It is usually expressed as a number of tokens.

About this term
Level
Beginner · Core ideas for first-time readers
Category
Basics
Added
2026-10-07
In plain words It is similar to how many papers you can spread out on a desk at once. With a large desk, you can work while looking at many papers together, but papers that don't fit get pushed off the desk and out of sight.

How it works

The user's question, previous conversation, attached documents, and even the answer the model writes must all fit inside the context window. If this limit is exceeded, older content may be cut off or the request may be rejected altogether. The model refers directly only to what is inside this window when producing an answer.

What shares a single window

Context window (token limit)

InstructionsPrevious conversationAttached documentsCurrent questionAnswer written by the modelOverflow: cut off or rejected

Proportions are illustrative. Not just the question but also the instructions, previous conversation, attached documents and the answer share the same window.

Why it matters

With a large context window, you can put in a long report, a contract or an entire codebase at once and ask questions about it. In long conversations, the model can keep going without forgetting earlier parts. That is why context window size is often presented as a key feature when a new model is released.

Good to know

A large window does not mean the model uses everything in it equally well. It sometimes misses information in the middle of a long text. Also, the more you put in, the higher the processing cost and time. This is why methods such as RAG, which put in only the needed parts, are used alongside it.

Example

When you upload a long PDF to a document summarization service, you may see a message saying 'The document is too long' or get a summary of only part of it. This is often because the document exceeds the model's context window.

Related terms