EasyDeepLearn

What is min-p sampling?

hard

Answer

  • min-p (Nguyen et al., 2024): filter tokens with probability  <  minp    P(toptoken)\mathrm{probability}\; < \;\operatorname{min}_{p}\; \cdot \;P(\mathrm{top}_{\mathrm{token}}).
  • E.g., minp=0.05\operatorname{min}_{p} = 0.05 keeps tokens with at least 5% of the top token's probability.
  • Adaptive to confidence: when the model is very confident, only the top few tokens survive; when it's uncertain, many pass through.
  • Empirically produces higher-quality creative writing than top-p at similar diversity.
  • Adopted in llama.cpp, vLLM, HuggingFace.
Check yourself — multiple choice
  • Fixed threshold on probability
  • Keep tokens with prob    minp\mathrm{prob}\; \ge \;\operatorname{min}_{p} × prob(top token) — adaptive relative filter, better creative writing than top-p
  • Same as top-p
  • Removes sampling

min-p: relative-to-top-token threshold → adaptive, high-quality alternative to top-p.

#generation#decoding#sampling

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions