Skip to content
Learn Motion
ExploreHow it worksMembership
Log in
Learn Motion

How ChatGPT Writes One Token at a Time

1From Your Words to Tokens2Predicting the Next Token3Choosing a Token and Looping4Why the Answer Reads as Coherent Text
Choosing a Token and Looping

Reshaping the Odds

2 / 4
That appended token changes the input, but before the next pick, the distribution itself can be reshaped. Temperature does this by rescaling the scores before they become probabilities.
0:00 / 0:00

Before selection, the distribution can be reshaped. Temperature rescales the logits before softmax: a low temperature sharpens the distribution so the top candidate dominates, while a high temperature flattens it so many tokens become nearly equally likely. Top-k filtering keeps only the k highest-probability tokens and discards the rest. Top-p filtering keeps the smallest set of tokens whose cumulative probability reaches p, cutting off the long tail. Both filters restrict which tokens are eligible before the actual selection step.

Previous2 / 4Next

Learn Motion

Generate a course. Learn it properly.

Operated by Wuhan Daoyin Technology Co., Ltd.

Contact: [email protected]
Privacy PolicyTerms of Service

© 2026 Learn Motion