Context window

The maximum amount of text, measured in tokens, that a model can consider at once, including the instructions, documents, conversation and its own answer.

Definition

Every model has a context window, today ranging from tens of thousands to over a million tokens. Everything the model uses to answer must fit inside it: system instructions, retrieved documents, chat history, tool results and the response.

Bigger windows make some tasks simpler, such as reading a whole contract at once, but they raise cost per call and do not guarantee the model uses everything well. Information buried in the middle of a long context can be missed, which is why retrieval and context engineering still matter.

Sources

  1. Liu et al., Lost in the Middle: How Language Models Use Long Contexts (2023)