AI engineering · 25 of 42
The same distribution, read two ways
Scroll
The same distribution, read two ways
At each step the model produces a probability for every possible next token. Temperature and top-p decide how that distribution gets turned into an actual choice.
Temperature reshapes it: low values sharpen the peak so the likeliest token nearly always wins, high values flatten it so unlikely tokens get a real chance. Top-p works differently — it keeps only the most likely tokens until their probabilities sum to p and samples from those, so the long tail is removed entirely.
Neither makes the model more accurate. They change how often it takes a risk. Temperature 0 is not a truth setting; it just makes the same confident mistake every time, which is at least reproducible.
Generation