By Team Edtoolkits · AI learning
Compare candidate filtering and renormalized probabilities on ten fixed next-word options.
Use the guide alongside the working tool.
Open Top-k and Top-p: Trim the Word Tail →Explore the lesson
Watch a cut-off line trim the tail of word odds.
Set k and p and draw words many times.
Flip the memory card and answer the quick check.
A comparison to try
Start with the weather candidates and apply top-k alone, then top-p alone. Combine the two and inspect which words remain before running the seeded draws.
Read the result
Top-k limits candidate count; top-p keeps the smallest leading group reaching the probability threshold. Combined filtering uses the stricter surviving set, then renormalizes its probabilities. Removed words should never be sampled.
A mistake to avoid
The ten odds are invented and stay fixed, while a real model changes a much larger distribution at every token. Removing strange candidates can constrain variety, but does not independently verify factual accuracy or guarantee appropriate text.
Teaching model and privacy
Ten made-up candidate words with fixed odds. A real model has tens of thousands of candidates, and the odds change at every step. Nothing leaves your browser.
Ready to apply this workflow?
Try Top-k and Top-p: Trim the Word Tail →Explore a related workflow
- Choose a course entry point and verify saved progress
Use prior knowledge to select a starting chapter while distinguishing local progress from an account or a qualification.
- AI Tokens: Inspect Pieces, Spaces and Stable Teaching IDs
Compare common words, rare words and numbers without using the playground as an exact provider counter.
- Inspect candidates before continuing text
Compare normalized next-word probabilities with the choices sampled from them.
- Choose complexity using held-out error
Compare training and test curves before calling a detailed fit an improvement.
Found unclear instructions or an unexpected result? Contact Team Edtoolkits.