Generation behavior · about 15 minutes of study

Context window

The context window limits how much tokenized information a model request can accommodate. Applications choose what to include and what to leave out.

Before you start: Review Temperature first. Python-like examples use variables, lists and functions.

Guided concept walkthrough

Follow the mechanism

Inventory

Count every request component.

1 / 4

A conceptual animation, not a live model trace. Play advances every five seconds and stops at the final stage.

Start with an everyday explanation

A desk has room for only so many pages. You can summarize or replace pages, but an overflowing desk does not automatically choose the right page to discard.

See a concrete example

With a teaching budget of 8,000 tokens, 1,000 instructions, 2,000 history and 1,000 reserved output leave 4,000 for evidence and remaining overhead.

A claim to question

A full window does not universally evict the oldest message automatically.

Try before revealing the answer

Decide what to retain when a policy clause and ten irrelevant chat turns compete for space.

Show the worked answer

Keep the authoritative clause, the current question and necessary state. Summarize old chat with provenance and verify that required facts survive the summary.

Now explain the idea to someone else using your own example. If you cannot explain a stage, revisit it before moving on.

Your explanation and revision notes

Loading local notes…

Read the primary reference

Attention Is All You Need

The explanation and exercises are original teaching material. The linked source provides background; examples and assumed numbers here are not claims about a particular company.