A language model has written The weather today is and scores the next word: sunny 2, cloudy 1, snowy −1. Write chances(scores, temperature): turn the scores into chances, where temperature sets how bold the model is. Cold: confident, it almost always picks its top word. Hot: cautious, it hedges and spreads its chances out. Temperature 1 is the model as it is.
A model finishes a sentence by drawing the next word by its chances. At temperature 1 the chances are the plain ones from “Scores into chances”. A temperature knob should make it play safe (cold) or take chances (hot): your function gives the chances at any temperature.
chances(scores, temperature)| scores | one number per word, higher = more likely | e.g. [2, 1, −1] |
| temperature | how bold to be (1 = the model as it is) | e.g. 1 |
| returns | one chance per word | |