Context Window
The context window is the maximum number of tokens a language model can consider at once, spanning both the input prompt and the generated output. Everything the model can "see" for a given request — instructions, retrieved documents, conversation history, and its own response — must fit within this fixed token budget.
Definition
Context WindowThe context window is a hard architectural limit set when a model is trained. Once the combined input and output exceed it, earlier tokens must be dropped or summarized, which is why long conversations and large documents require truncation, chunking, or retrieval strategies.
Context windows have grown from a few thousand tokens in early models to hundreds of thousands or more in recent ones. A larger window reduces the need for external retrieval for some tasks, but attention cost and the tendency for models to under-use information in the middle of very long inputs mean that more context is not always better.
Frequently asked questions
What is Context Window?
The context window is the maximum number of tokens a language model can consider at once, spanning both the input prompt and the generated output. Everything the model can "see" for a given request — instructions, retrieved documents, conversation history, and its own response — must fit within this fixed token budget.
Sources
Related terms
← Full AI & prompt engineering glossary
Put Context Window to work with Prompeteer, the Agentic Contextual AI Platform →