Home Tools Glossary Context Window
Concept

Context Window

Model Context Window

/kahn-tekst win-doh/

The maximum total number of tokens an AI model can process and retain in a single prompt and response interaction.

In plain English
Think of the context window as an AI's short-term working memory desk. If you give it a document that exceeds its desk size, it forgets the beginning of the text. Modern models feature massive windows capable of holding entire books.
Real-world example
Analyzing a 300-page financial report alongside a user query in a single prompt execution.
Technical definition
The context window defines the maximum sequence length—measured in tokens—that an attention-based neural network can accept during inference. It is constrained by the positional encoding mechanism and memory complexity of the self-attention matrix, which scales quadratically with sequence length. Expanding context windows requires advanced positional embeddings and memory-efficient attention algorithms.