Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Skill

Tokens & Context

Explain how LLMs generate text one token at a time, and reason about tokenization, sampling, context window limits and token budgets when designing prompts and conversations.

Intermediate2 roadmaps

4 objectives 6 steps about 105 min

Learn it step by step

Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.

Start learning

This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.

Learning objectives

  • Count tokens for a prompt and response with a tokenizer and estimate the cost of a request.
  • Allocate a context budget across instructions, history, retrieved content and output, and enforce it in code.
  • Choose a strategy for long inputs (truncation, summarization or retrieval) and explain its quality trade-off, including position effects.
  • Explain how a pretrained, instruction-tuned LLM generates text by sampling one token at a time, how temperature, top-p and top-k change that sampling, and why this produces hallucinations, knowledge cutoffs and run-to-run variation.

Lesson plan

6 steps, about 105 min · 5 of 5 lessons available so far

Practise it

Write a function that assembles a chat request from a system prompt, past turns and retrieved passages under a fixed token budget, dropping or summarizing the oldest turns first; test it with a real tokenizer on short, medium and very long conversations. Then run one open-ended prompt 10 times at two temperature settings and report how many distinct answers each setting produced.

Build it from scratch

Practice builds that exercise this skill by re-creating a real technology.

Browse 2 tutorials that practise it

References

Hard prerequisites

None.

Unlocks

On these roadmaps

Progress and evidence for this skill are shared across all of them.