Back to Developer Roadmap

Top-P

src/data/roadmaps/prompt-engineering/content/[email protected]

4.0350 B
Original Source

Top-P

Top-P (nucleus sampling) selects tokens from the smallest set whose cumulative probability exceeds threshold P. Unlike Top-K's fixed number, Top-P dynamically adjusts based on probability distribution. Low values (0.1-0.5) produce focused outputs, medium (0.6-0.9) balance creativity and coherence, high (0.9-0.99) enable creative diversity.