Understand LLMs · Lesson 05

What is the context window for?

How is limited context capacity shared between instructions, conversation, documents, and the answer?

Level
Beginner
Core time
12 min
Updated
27 July 2026
Prerequisites
None
Progress
Not started

Start with the mechanism

Three steps to keep in mind

  1. 1

    Reserve output space

    A system must leave enough capacity for the answer it wants to generate.

  2. 2

    Prioritize the input

    Instructions and relevant evidence compete with history and supporting material.

  3. 3

    Handle overflow

    Applications may truncate, summarize, retrieve selectively, or reject oversized input.

Try it yourself

The lab isolates this mechanism with a small, transparent simulation. Everything runs locally in your browser.

Open “Build a context window

Keep these three ideas

Go deeper when you need it

Technical detailWhat the short version leaves out

Attention lets positions exchange weighted information, but it does not mean every token influences the output equally.

A KV cache speeds up repeated decoding calculations; it is not durable user memory.

Your local progress

Status: Not started

Progress stays on this device.