Glossary · Data Science & AI
Context Window
Also called: context length · token limit
The maximum amount of text, measured in tokens, that a language model can consider at once, covering the prompt, any documents supplied and its own reply.
Definition
A large language model reads and writes text as tokens, which are words or word fragments, and its context window is the most tokens it can process in a single request. Everything the model uses to answer, including instructions, conversation history, pasted documents and the response itself, must fit inside that window. Material outside the window is simply not seen, so long documents must be trimmed, summarized or retrieved selectively. Window sizes differ widely across models and change often, so check the provider's current documentation rather than relying on a remembered figure.
Worked example
Related terms
- Large Language Model: A neural network trained on very large amounts of text to predict the next token, which lets it generate, summarize, translate and reason over language.
- Prompt: The instructions, context and examples given to a generative AI model to steer what it produces.
- Retrieval-Augmented Generation: A technique that retrieves relevant documents from a trusted source and adds them to a language model's prompt so its answer is grounded in that material.
- Hallucination: When an AI model produces a fluent, confident answer that is false or unsupported, such as an invented fact, number or citation.