A language model gives logits for four tokens. What are the sampling probabilities at temperature , and ? What happens as and as ?
Sequence models and transformers, Decoding
Level L2 Elementary. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can apply and describe how sharpens or flattens the distribution.
Key idea
. Small sharpens the distribution towards the arg-max; large flattens it towards uniform.
Steps
- Divide the logits by before the softmax.
- : .
- : logits become , so . The top token gets more mass.
- : logits become , so . The distribution is flatter.
- As , all mass goes to the largest logit, which is greedy decoding. As , and , which is uniform sampling.
Common mistakes
- Multiplying the logits by instead of dividing.
- Saying temperature changes the ranking of tokens; it never does, only the gaps in probability.
- Applying after the softmax instead of before it.
How long your answer should be
Short table of probabilities and two sentences on limits.
Last checked on 4 December 2026.
Read this
Previous in Sequence models and transformers: Three tokens have embeddings , and . Take (no projection matrices) and . What are the attention weights and output for token 1 using scaled dot-product attention?
Next in Sequence models and transformers: A weight matrix is adapted with LoRA of rank . How many trainable parameters does LoRA add for this matrix, and what fraction of the full matrix is that? If LoRA is applied to the query and value matrices of all layers, how many trainable parameters is that in total?