⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Token Sampling Lab: Temperature, Top-k & Nucleus (Top-p)

Every time a large language model writes a word, it first computes a probability for every token in its vocabulary, then samples one. This simulator renders that vocabulary as a ring of 3D bars whose heights are live token probabilities, and lets you drag the same three decoding knobs real LLM APIs expose — temperature, top-k and top-p (nucleus) — to watch the distribution sharpen, flatten, and get truncated in real time. Pressing "Sample next token" performs a real weighted random draw over whatever survives the filters and appends the chosen word to a growing sentence, while live readouts track the distribution's entropy, how many candidates remain after filtering, and the probability of whichever token just got picked.