min-p sampling
**Min-p sampling** is the **probability-threshold decoding method that keeps tokens whose probability exceeds a dynamic minimum relative to the top token** - it adapts candidate set size to local confidence conditions.
**What Is Min-p sampling?**
- **Definition**: Adaptive filtering strategy based on a minimum probability floor tied to peak likelihood.
- **Mechanism**: Tokens below threshold are removed, then remaining probabilities are renormalized for sampling.
- **Adaptive Behavior**: High-confidence steps keep small candidate sets, uncertain steps keep broader sets.
- **Relation**: Acts as an alternative to fixed top-k or fixed cumulative-mass truncation.
**Why Min-p sampling Matters**
- **Context Sensitivity**: Candidate filtering automatically adjusts to entropy changes across steps.
- **Quality Control**: Suppresses extreme tail tokens that often degrade coherence.
- **Diversity Preservation**: Retains multiple options when model uncertainty is genuinely high.
- **Operational Simplicity**: Single threshold parameter can replace multiple manual limits.
- **Robustness**: Often stabilizes generation across heterogeneous prompt types.
**How It Is Used in Practice**
- **Threshold Calibration**: Tune min-p values on factuality, coherence, and diversity benchmarks.
- **Joint Policies**: Combine with temperature controls for finer stochastic behavior shaping.
- **Live Monitoring**: Track candidate-set size distribution to detect over- or under-filtering.
Min-p sampling is **an adaptive truncation strategy for stable stochastic decoding** - min-p improves control by aligning candidate breadth with model confidence.