The same LLM produces wildly different outputs depending on how you sample from the token distribution. Temperature scales logits (lower = more deterministic), top-K restricts to the K most likely tokens, and nucleus (top-P) keeps the smallest set of tokens whose cumulative probability exceeds P. This demo shows each strategy reshaping the distribution in real time.
Temperature slider - watch how values below 1.0 sharpen the distribution and above 1.0 flatten it
Top-K sampling - set K and see which tokens survive the cutoff on a live probability bar chart
Top-P (nucleus) sampling - see the cumulative probability curve and where the nucleus boundary falls
Compare greedy decoding (always pick the top token) vs sampled decoding on the same prompt
Understand why temperature=0 gives reproducible outputs and temperature=1.5 produces hallucinations
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.