When using a language model with a temperature parameter, what happens to the model's output as the temperature increases from 0.1 to 1.0?
Think about how temperature controls randomness in choosing words.
Higher temperature values increase randomness in the model's word choices, making outputs more diverse and creative. Lower temperatures make the model pick the most likely words, producing more predictable text.
Given a language model sampling with top-k=3, which option best describes the effect on word selection?
Top-k limits the candidate words to a fixed number.
Top-k sampling restricts the model to choose the next word only from the top k most likely words, increasing output diversity while avoiding very unlikely words.
You want your language model to generate responses that are creative but still coherent. Which temperature value is most suitable?
Very low temperatures make output boring; very high make it chaotic.
A temperature around 0.5 balances randomness and coherence, producing creative yet sensible outputs. Very low values produce repetitive text; very high values produce nonsensical text.
How does increasing temperature during sampling affect the perplexity metric measured on generated text?
Higher randomness means less predictable text.
Higher temperature increases randomness, making generated text less predictable and thus increasing perplexity, which measures uncertainty in predictions.
Consider this code snippet using a language model with temperature=0.8 and top-p=0.9. The output is unexpectedly repetitive and lacks diversity. Which is the most likely cause?
model.generate(prompt, temperature=0.8, top_p=0.9, top_k=0)
Top-p controls cumulative probability cutoff for candidate words.
Top-p=0.9 means sampling only from the smallest set of words whose probabilities sum to 90%. If this set is very small, it limits diversity despite temperature. Top-k=0 disables top-k filtering, so it does not reduce diversity.