💬Top-p Sampling
Also known as Nucleus Sampling, Top-p
Picking only from the top tokens whose chances add up to a set share, like 0.9.
Think of it like
Think of it like you only pick from the best snacks. Stop once they fill most of the plate.
Example
For 'The sky is', the top token 'blue' has 0.85 and 'clear' has 0.07. With top-p at 0.9, only those two are kept, and every odd word is out.
Why it matters
It cuts off nonsense words while still allowing variety. That is why many tools turn it on by default.
Definition
Common mistake
Key takeaways
- 1Sort by chance. Most likely first.
- 2Keep until p. Like 90 percent in total.
- 3Size adapts. Few when sure, more when not.