apply_min_p: mask tokens whose probability is below minP · p(top token).
Faithful to the reference (mlx-lm 0.31.3 sample_utils.apply_min_p): the
threshold is computed in log space directly against the max logprob —
scaled_min_p = max(lp) + log(minP) — no full sort; min_tokens_to_keep
survivors are recovered with an argpartition on the top tail.
apply_min_p: mask tokens whose probability is below minP · p(top token). Faithful to the reference (mlx-lm 0.31.3 sample_utils.apply_min_p): the threshold is computed in log space directly against the max logprob —
scaled_min_p = max(lp) + log(minP)— no full sort; min_tokens_to_keep survivors are recovered with an argpartition on the top tail.