The softmax with temperature calculator converts four logits into probabilities, and gives the entropy and the effective number of choices, to see how the temperature sharpens or flattens a distribution.
How the calculation works
- Enter the four logits.
- Enter the temperature.
- The calculator gives the four probabilities, the entropy in bits and the effective number of choices.
Example
The logits 2, 1, 0.1 and −1 at temperature 1 give exp values 7.39, 2.72, 1.11 and 0.37, which sum to 11.58. The probabilities are 63.81 %, 23.47 %, 9.54 % and 3.18 %. The entropy is 1.386 bits, equal to 2.61 equally likely choices. Lowering the temperature to 0.5 gives the first choice a much larger share.
Why it matters
The calculator helps students in machine learning, developers who tune the sampling of a language model and anyone who wants to understand how scores become probabilities.
Good to know
In language models, the temperature is applied to the logits before sampling. Values around 0.2 give focused, repeatable text, around 1 give varied text, and above 1.5 the output becomes erratic. Sampling methods such as top-k and top-p cut the tail of the distribution before the draw. The softmax is also the output layer of classifiers, where it pairs with the cross-entropy loss. It is not a calibrated probability by itself: a model can be overconfident, and a temperature fitted on validation data is a standard way to fix it. The effective number of choices, the exponential of the entropy, is the perplexity of the distribution. With equal logits it equals the number of choices, here 4.
Related tools
The Shannon entropy calculator explains the entropy measure, the logistic regression probability calculator covers the two-class case, the LLM memory calculator sizes models and the probability calculator handles basic chances.