Understand this visualization
This visualization shows the probabilities for the top 9 most likely next tokens for the prompt
"Roses are red, violets are ", and how those probabilities are affected by changing the
temperature and top-k parameters.
- Parameters
-
- Temperature: The temperature parameter controls the randomness of the
predictions. A temperature of 1.0 is the default probability distribution generated by the
model. When increasing the temperature, the distribution becomes more even - tokens that
were less likely to be selected become more likely, and tokens that were more likely to be
selected become less likely, which makes the output of the model more creative. Conversely,
decreasing the temperature causes the tokens that were more likely to be selected to become
even more likely, and tokens that were less likely to be even less likely, making the model
output more predictable.
- Top-K: The top-k parameter controls the number of tokens to consider when
generating the probabilities for the next token to be selected. A top-k of 1 will always
return the most likely token, while a top-k of 9 will consider the top 9 most likely tokens.
While this visualization only shows the top 9 tokens for the prompt, in reality the large language model
will return the likelyhood for thousands of tokens - 262144 in the case of
Gemma 3 1B, the model used to generate
the list of tokens.
Note that, while the data in this visualization was extracted from a a real LLM Prompt, the values are
hard-coded, and there's no LLM running in the background. To learn more about how the data was generated
using Gemma 3 - 1B, take a look at this
Colab.