What is Top-P Sampling?
AI EngineeringA decoding strategy that limits token selection to the most probable options summing to probability P.
Also called nucleus sampling, top-p filtering dynamically adjusts the number of candidate tokens based on their cumulative probability. Combined with temperature, it controls output diversity.