LLM Sampling Explorer
See what temperature, top-k, top-p and min-p do to a model's next-token choices.
Questions
What does temperature do?
It divides every logit before the softmax. Below 1, the top token gets even more of the probability. Above 1, unlikely tokens get a real chance. At 0 the model always takes the most likely token (greedy decoding).
What is the difference between top-k, top-p and min-p?
All three remove unlikely tokens, in different ways. Top-k keeps a fixed number of tokens. Top-p keeps the smallest set whose probabilities add up to p. Min-p keeps tokens at least p times as likely as the top one.
In what order are they applied?
Temperature, then top-k, then top-p, then min-p, as in Hugging Face transformers. Some runtimes let you change the order, which can change the result.
Are these real model outputs?
No. The examples are made-up logits. Paste your own, one token and logit per line. The maths is exact for what you enter, and nothing here calls a model.
Related tools
- Softmax & Cross-Entropy CalculatorTurn scores into probabilities, and see the loss and perplexity for the right answer.
- Token CounterCount tokens and see how text is split, with the real GPT-4o and GPT-4 tokenizers.
- LLM Memory CalculatorHow much GPU memory a model needs: weights plus KV cache, with the maths shown.
- RTK Output VisualizerSee how rtk-style filtering shrinks command output before an AI agent reads it.