Skip to content

p-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding#41798

Open
ryttry wants to merge 8 commits into
huggingface:mainfrom
ryttry:p-less-decoding
Open

p-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding#41798
ryttry wants to merge 8 commits into
huggingface:mainfrom
ryttry:p-less-decoding

Conversation

@ryttry

@ryttry ryttry commented Oct 22, 2025

Copy link
Copy Markdown

What does this PR do?

This PR contributes the p-less and p-lessnorm sampling methods for LLM decoding to the model.generate endpoint, the standard endpoint used for all other sampling methods such as top-k, top-p, etc. Like the other sampling methods, logits warpers are also created for p-less (PLessLogitsWarper) and p-lessnorm (PLessNormLogitsWarper).

Reference:
For details, refer to the paper "p-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding", available at https://arxiv.org/abs/2509.23234 (NeurIPS 2025)

TLDR; The p-less sampling method (and p-lessnorm) is hyperparameter-free, considers the full token distribution in determining the probability threshold for admitting tokens into the sampling set, is robust to high temperatures, and behaves befittingly with the entropy of the distribution, i.e. admitting more tokens into the sampling set when the entropy is high and vice versa.

This PR does not introduce any new dependency.
Documentation and code comments are written for the PLessLogitsWarper and PLessNormLogitsWarper classes.

Tests

  • Tests for directly using the p-less and p-less-norm logits warpers are in tests/generation/test_logits_process.py
  • Tests on the model.generate endpoint using p-less and p-less-norm logits warpers are written in tests/generation/test_utils.py
  • Tests on the generation configuration for the p_less and p_less_norm arguments are written in tests/generation/test_configuration_utils.py

Tests all passed locally.

@zucchini-nlp @gante , looking forward to the review

@ryttry ryttry marked this pull request as ready for review October 22, 2025 22:13
@github-actions github-actions Bot requested review from gante and stevhliu October 22, 2025 22:13
@ryttry

ryttry commented Oct 28, 2025

Copy link
Copy Markdown
Author

Hi folks @zucchini-nlp @gante , checking in regarding the review status of this PR.
If anything else is needed, I can work on it.
Thanks!

@ryttry

ryttry commented Nov 3, 2025

Copy link
Copy Markdown
Author

Hi @zucchini-nlp @gante , gentle reminder on this PR.

Alternatively, please let me know who from HuggingFace I should work with for a review.

@ryttry

ryttry commented Nov 3, 2025

Copy link
Copy Markdown
Author

Thanks!

@zucchini-nlp

Copy link
Copy Markdown
Member

Hey @p-kris10 , sorry for late reply, I was on a vacation and just came back. We're currently adding new decoding strategies via Hub to make the maintenance easier and bypass long/strict review process.

It will allow you to quickly add any generation method and share it with the community. There is a doc page on how to add it here, and lmk if you need any help or guidance 🤗

@ryttry

ryttry commented Nov 6, 2025

Copy link
Copy Markdown
Author

@gante, we've (@Hellisotherpeople; and I'm the lead author for p-less) interacted with you previously on a PR for the p-less Decoding method, and so far you've kept quiet here. I'd like to respectfully bring your attention here and refer us to an earlier admittance you made where you're willing to accept p-less using the framework in this PR, so as not to be unfair, double-standard where you at the same time accepted the Top-H Decoding that used the same framework. Refer to the following PR comment histories documenting these:

Background

Furthermore, this PR was opened 3 weeks ago with full passes, with no response till today, while Top-H was merged just shortly before that and used the same framework as this PR.

Peer-reviewed and Peer-accepted Paper

Our paper p-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding is accepted at NeurIPS 2025 and additionally invited for an oral presentation, which is a strong validation and another mark of distinction for our contribution on the p-less method (see NeurIPS 2025).

I provide more resources for p-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding below:

Still looking forward to Hugging Face as a relevant go-to library

To recap, we've already discussed with you previously and made many points (see PR comment history URLs above) on, hopefully, continuing to experience Hugging Face as a default go-to, responsive, fair and frontier library. We're still positive and hopeful.

I'd like to take this opportunity to emphasize that: we are experiencing huge interest in our stakeholders and communities - AI researchers, developers, ML engineers, data scientists, and even product users - in applying our peer-reviewed and peer-accepted innovation, and we would love to be able to tell all that they can directly rely on the frontier Hugging Face library which has responsively incorporated our method.

Ask for your consistent standard

This PR was opened 3 weeks ago with full passes, with more tests than the Min-p or Top-H methods, with no response till today. We really hope to look forward to continued trust, your honoring of words and taking action to apply a consistent standard on us as Top-H Decoding, can we?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants