{
  "id": "context-window",
  "code": "PTL-0004",
  "term": "Context Window",
  "aliases": [
    "context length",
    "context size"
  ],
  "category": "foundations",
  "definition": "The context window is the maximum number of tokens a language model can attend to in a single call, covering both the prompt and the generated output.",
  "description": "Anything outside the context window is invisible to the model unless it is re-inserted. Larger windows allow whole documents or codebases to be included, but research shows models do not use all positions equally well, which motivates retrieval, summarization, and careful placement of key information.",
  "example": null,
  "broader": [],
  "narrower": [],
  "related": [
    "token",
    "lost-in-the-middle",
    "needle-in-a-haystack",
    "context-engineering"
  ],
  "introduced": null,
  "sources": [
    {
      "title": "Attention Is All You Need",
      "authors": "Vaswani et al.",
      "year": 2017,
      "url": "https://arxiv.org/abs/1706.03762"
    },
    {
      "title": "Lost in the Middle: How Language Models Use Long Contexts",
      "authors": "Liu et al.",
      "year": 2023,
      "url": "https://arxiv.org/abs/2307.03172"
    }
  ],
  "url": "https://protologue.com/t/context-window/",
  "citation": "Protologue. (2026). Context Window. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.0.0, PTL-0004). https://protologue.com/t/context-window/"
}