Skip to content
Go back

Top-p in LLM

Published:  at  03:22 AM

Top-p is a hyperparameter that controls the diversity of word choice in generated text.

1. Top-p

Top-p value is usually set between 0 and 1.

Top-p is not a specific number that how much words can appear in the prediction step (like top-k), it is a probability.

When set Top-p to some value, such as 0.9, then:

By setting the top value to 0.9, we will only consider the 90% most probable words as candidates.

So if we set a big Top-p value, the model will generate the sentence with more diverse words. If we set a small Top-p value, it will tend to generate the most statistically probable words, which will leads to a more simple and uniform sentence.



Next Post
MD5 Algorithm