AI Model Wiki

    Skip to main content
    Back to Glossary

    Context Window

    The context window is the total number of tokens that a model can consider at one time, spanning both the input prompt and the generated output combined. Any text outside this limit is invisible to the model during a given call; it cannot refer to content that was truncated or that appeared in a prior conversation turn unless that content is explicitly included again. Window sizes have grown substantially over time, from a few hundred tokens in early transformer models to 128K in some GPT configurations and up to one million tokens in certain Gemini releases, enabling tasks like summarizing book-length documents or reasoning over large codebases.

    Think of it like a desk with a fixed surface area. Every document you want to work with must fit on the desk simultaneously; anything stored in a filing cabinet behind you is out of reach until you physically place it on the desk.

    If a context window holds 128K tokens and an average English word maps to roughly 1.3 tokens, that equates to around 98,000 words, approximately the length of a standard novel. A developer querying a large codebase might concatenate multiple source files into the prompt up to that ceiling before asking the model to find a bug or explain an architecture.

    Context window size intersects with Context Stuffing, packing the window with relevant material, RAG, retrieving only the most relevant chunks when content exceeds the limit, Tokenization, which determines how text maps to tokens, and Attention mechanisms, which scale in memory cost with sequence length, making very large windows expensive to serve.

    You will encounter context window limits in every LLM API reference page, in error messages when prompts are too long, and in architecture decisions about whether to use retrieval augmentation or long-context models for a given application.

    AI Terminology
    Glossary