← LLM Core & Architecture
Context Length
Also known as: context window
Context length is the maximum number of tokens a language model can attend to in a single forward pass, covering both the input prompt and the generated output. Models process only what fits within this limit; content beyond the boundary is truncated or must be handled by chunking and retrieval strategies. Longer context windows allow richer in-context examples, full documents, and multi-turn conversations without external memory, but they increase memory requirements and attention compute quadratically unless efficient attention variants are used.