Top-p keeps a fixed amount of probability mass, which lets junk tokens in when the model is confident and cuts good ones when it's unsure. Min-p adapts: keep only tokens whose probability is at least min_p times the top token's probability.
Implement min_p_filter(logits, min_p=0.1, temperature=1.0) returning a renormalised probability array:
min_p * max(probs).min_p=0 keeps everything. The top token is always kept.