p-less Sampling:  A Robust Hyperparameter-Free Approach for LLM Decoding
Author: ryttry
Pull request: yes

# What does this PR do?
This PR contributes the _p_-less and _p_-less<sub>norm</sub> 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_-less<sub>norm</sub> (`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_-less<sub>norm</sub>) 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

Comments:
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!

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

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



Thanks!

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](https://huggingface.co/docs/transformers/en/generation_strategies#custom-generation-methods), and lmk if you need any help or guidance 🤗 

@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:
- https://github.com/huggingface/transformers/pull/40837#issuecomment-3370705504
- https://github.com/huggingface/transformers/pull/39236#issuecomment-3370703807

### 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](https://neurips.cc/virtual/2025/workshop/109572#wse-detail-127494)). 

I provide more resources for **_p_-less Sampling: A Robust Hyperparameter-Free Approach for LLM Decoding** below:
- arXiv: https://arxiv.org/abs/2509.23234
- NeurIPS 2025: https://neurips.cc/virtual/2025/workshop/109572#wse-detail-127494
- GitHub: https://github.com/ryttry/p-less/tree/main
- We are also giving talks and presentations to showcase our proven method, one example [here](https://www.thoughtworks.com/en-sg/about-us/events/xconf/2025/singapore#:~:text=Smarter%20word%20generation%20in%20LLMs%3A%20Guiding%20sampling%20through%20output%20probability%20distributions) 

### 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?