TokenPad
Reference

Temperature and Top-p Simulator

See what temperature, top-p and top-k do to the same distribution.

Settings
Temperature SimulatorExact
0Token change
Token change0no change
Input tokens0what you pasted
Output tokens0what you would send
Token cost of this result
Output tokens0
As input$0.00
× 100K requests$0.00

Everything on this page runs in your browser. Nothing you paste is transmitted, because there is no server here to transmit it to.

Result
 

What temperature does

It divides the logits before the softmax. Below one the distribution sharpens and the top token dominates; above one it flattens and unlikely tokens become reachable.

At zero it is effectively deterministic — right for classification, extraction and anything your code parses. Above about 1.5 output is frequently incoherent, because the distribution is close to uniform.

Top-p against top-k

Top-k keeps a fixed number of candidates regardless of how confident the model is. Top-p keeps as many as are needed to reach a probability mass, so it adapts: on a confident prediction it keeps one or two, on an uncertain one it keeps many.

That adaptivity is why top-p is generally preferred. Change one of temperature and top-p, never both — they control overlapping things and tuning them together makes the effect of either impossible to attribute.

Frequently asked questions

What temperature should I use?
Zero to 0.2 for anything parsed or classified. 0.7 for general assistant work. Above one only for creative generation where variety is the point.
Does temperature affect cost?
Not directly. Indirectly it can: higher temperature produces more varied output lengths and more retries when the result is unusable.

More reference tools