Learn LLM Context Windows
Context is a finite token budget. Instructions, history, evidence and output reservations all consume it.
Read each short explanation, work through the example, then answer a pop quiz. Every answer explains the reasoning. Incorrect answers unlock a fresh question on the same idea; the full lesson contains ten questions.
01Understand the basics
Ready to learnA language model has a finite context budget measured in tokens. Instructions, conversation history, retrieved evidence and reserved output all need room. A token is a piece of text, and the exact split depends on the model tokenizer.
02Budget before sending
Ready to learnReserve room for the answer before adding evidence. When allocations exceed the available context, shorten or select input deliberately rather than dropping important instructions at random.
Try a different value
03Handle overflow
Ready to learnAn oversized request may be rejected or truncated by the application. Use the actual tokenizer and service limits. Prefer relevant extracts and verified summaries to indiscriminately removing text.
You’ve practised all three sections.
First-attempt understanding and later practice are shown separately. Keep practising with the related tools or continue through the suggested path.
Put it to work
Apply what you’ve learned using the related tools.