# Oral 31888

- Kind: Oral
- Talk page and recording: https://iclr.cc/virtual/2025/oral/31888

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

All right. Well, it's my pleasure as Alan to present to you turning up the heat min P sampling for creative and coherent LLM outputs. I believe my other co-authors are sitting in the registration line right now, so they could not be here. So I'm going to take you back to NeurIPS 2024 to a meeting which lives rent free in my mind with one of my absolute.
include idols. And I started pitching to him this idea about min p because even at NeurIPS, a lot of the ICLR scores were out and, you know, was really excited to talk to this extremely famous figure. So I started explaining that min p is a dynamic truncation as opposed to static truncations that are commonly used such as top p and top k. And then he starts talking to me saying, wait, what?
What? Isn't temperature all that you're going to need? What is this sampling stuff? And then I started trying to explain that sampling is everywhere. And then finally he comes back and says this to me, which was very brutal. Left me quite sad. So let's refute this idea. Today I'm going to talk about a topic that our field doesn't take seriously enough, LLM sampling. We spend billions scaling models in size and compute.
Get the final step how we actually get text out of these machines is treated as an afterthought many believe sampling is solved or perhaps even unnecessary We believe we are living in the stone age of sampling techniques and we observe that improving sampling offers the single best price -to-performance ratio for enhancing LLM capabilities right now
But since academia has been mostly ignoring this and not leading, we have to look at who is leading in the innovation and integration of samplers in major frameworks. And so we observe projects such as Uba Buga, text generation web UI, silly tavern.
And HuggingFace and VLLM are, which by the way, many of these like silly tavern are focused on like creative fiction or role playing, but they've been years ahead in implementing and experimenting with novel samplers such as Meerstadt, Typicality Sampling, Tail-Free Sampling, Top-End Sigma, and yes, our technique, Min-P Sampling.
These communities discovered crucial details academics missed, like the fact that the order of applying temperature and truncation massively matters. Indeed, HuggingFace and VLLM have opposite default orders here with massive impacts on any kinds of evaluations. As academics, we have largely ignored this vibrant ecosystem, and we have largely missed out on crucial insights.
The actual process of generating text, the sampling, is the elephant in the room. We tweak hyperparameters like temperature top here, top K, but fundamentally we've hit a wall. If you want diverse creative output, you crank up the temperature but push it too high, even with these samplers, the model starts spitting out repetitive loops, nonsensical phrases, or loses the plot entirely. We get creativity or coherence, rarely both.
Let's quickly recap why this happens. Increasing temperature acts like smoothing of the probability distribution. Everything becomes more equally likely. Now think about top p sampling, also known as nucleus sampling. It keeps tokens until their cumulative probability hits a threshold, say 0.9. When the distribution is sharp, this nicely captures the nucleus of likely tokens, but when it's flat, that threshold will include a huge number of tokens which are
you're actively nonsensical. Top K isn't any better. A fixed K doesn't know if the model is confident or uncertain. It just blindly chops off the tail, potentially removing good options or keeping bad ones depending on your choice of K.
So this brings us to our work, Min-P sampling. The core idea is refreshingly simple. Stop using fixed cutoffs. Let's make the truncation dynamic and depend on how confident the model is at that very moment. How do we measure confidence? We use the probability of the single most likely token, pmax. If pmax is high, the model is confident, and so we should be more conservative. And if pmax is low, the model is uncertain.
and we can afford to explore more options, but relative to that uncertainty.
More formally, first at each step, find the probability of the top token p-max. Second, introduce one new hyperparameter p-base. Think of this as a minimum relative probability you're willing to consider. For 0.1, this would be 10%. We calculate our actual threshold p-scaled by multiplying p-base with p-max. Third, we build our sampling pool by keeping only those tokens whose individual probability is greater than or equal to this dynamic p -scaled.
scale threshold. Finally, we renormalize the probabilities of the kept tokens and sample as usual. That's it!
So why does this simple change work when things get hot? The key is that min-p filters based on relative likelihood. A token needs to be, say, 10% as likely as the best option to even be considered. Even if the top token's probability drops significantly, our threshold drops with it, which means that we can still prune away the garbage tokens that are highly unlikely even relative to the now less certain top.
top choice. This significantly mitigates the incoherent plague we see with top P and top K at high temperatures. It naturally balances exploration and exploitation based on context, and it's cheap to compute barely more than sampling with no truncation.
We ran extensive experiments to validate this. We used strong open models like MISTRAL 7B, various LAMA 3 sizes, including 70B, and even MISTRAL large. We tested on GPQA and GSM8K with chain of thought and open -ended creative writing with Alpaca eval, and we compared min P versus top P, top K, and temperature scaling. And in some experiments, we even compared against more complex entropy-based methods like Epsilon sampling.
For the reasoning benchmarks, the table shows accuracy on GPQA and GSM8K across temperatures. While performance is comparable at low temperatures, we get dramatically better performance at temperatures of two and three. And we even will show that you can get by with temperatures as high as 100 or realistically near infinity with prudent choices of min p. And again, these advantages work across pretty much all models.
though we observe larger gains with smaller models than with bigger models. And we see similar compelling results on Mr. Large both with GPQA and on Alpaca eval creative writing and the improvements grow relatively as temperature goes up.
We ran human evaluations where participants rated stories generated by LAMA 370 billion for quality and diversity, and the results were compelling because really as you increase temperature to like two or three, you get pretty much gibberish, right, with standard sampling or top P. And so you get, you know, an average of like in the 1.3 range in many of these, but then min P is able to preserve its capabilities.
uh uh for uh at least as an in-piece setting as 0.1 which is uh an appropriate threshold
So the reason frameworks like HuggingFace, VLLM, OLAMA, and many others adopted MinP so quickly wasn't because of a paper, because this all happened back in 2023 or earlier, right, and preceded widespread publication. It was because practitioners and developers in the open source community found it worked, it solved a real pain point, especially for creative generation and role -playing communities who wanted high temperatures. In fact, Unsloth explicitly recommends MinP for state-of-the-art reasoning models like MinP.
like DeepSeek R1, because they observe that it reduces repetitive loops. And so we know that this technique has broad practical utility beyond just creative writing, and our evidence is the hundreds of thousands of GitHub stars that projects which have integrated this have gathered.
My final message to you is a call to action. First, let's stop treating sampling as a trivial final step. It fundamentally shapes the output and deserves more attention. Second, I encourage you all to experiment. Try MinP on your own, particularly if you're hitting limits with creativity and diversity. Explore high temperatures. With a p-base of 0.05 or 0.1, you can get temperature up to 3 easily if you choose a much higher MinP like...
like 0 .9 you can get temperatures as high as 100 but if you choose a min p that approaches 1 say 0.9999 your temperature can approach infinity or in this case system dot max int
And yeah, this whole area is really ripe for more research. In particular, we observe that since the time in between the technique coming out and a paper coming out is often more than a year, there's another technique which we really want everybody in this room to look at and read the paper on. It's called top n sigma, not all logits are you need. They have a typo in the title. I promise that's the current title as it stands. But that paper goes even further than we do and it's in our opinion the...
The state -of-the-art sampler today that all providers, including OpenAI, Anthropik, and Gemini, need to make available to everybody. So thank you. When you increase the temperature, you want to increase p-base, but there's a natural relationship by putting things in the right domain. Have you tried to just have this fixed relationship?
uh Do do you you mean integrate like a fixed it by hand? like the ratio between uh yeah so um the top end sigma paper that we talk about i believe it naturally effectively does this for you and why we think it's better we agree that that like i observed that exact kind of relationship but i don't know especially as temperature starts going way higher and uh what that exact It ratio would cut the same place, but then it would be uniform across the ones you choose. That's what would happen.
I think, yeah, something like that. But you're right. This is absolutely a further research direction for us to observe.
Hi, thank you for the talk. I'm just wondering, in addition to the PMAPs that you used in the paper to like account for the confidence of this token generation, have you ever considered like other quantification methods for confidence like Um, per entropy or stuff like this? um yeah, in fact, this is where my, I wish my first author were here, that they have their own proposals called MINZ related to trying to use entropy for like non-LLM sampling, but with a similar idea.
Um and we also observe that you don't have to use, you know, the most likely token, you could use a second most or third most likely. And indeed uh top A_ which is very similar to min P_ but it's not as well known amongst academics uh I believe is doing like an N squared type relation. So yes, we we really need to explore that. But no, we have not like actively explored uh at least I haven't personally. Okay. Yeah, alright, thanks.
Hello, I have a question about the hallucination. Yeah. We know that to increase the creativity of LRM, they always...
tends to increase the hallucination. So will this main P sampling strategy increase the hallucination? For a given temperature, it should reduce it. It's a truncation. Now, we admit that temperature, like it's a destructive operation and it's effectively adding noise, right? So I can tell you that you're guaranteed a certain increased risk with, I think, all methods as you increase temperature. But our point is we mitigate the hallucination risk.
risk better than top P and top K for a given temperature. So in the same temperature, the hallucination decreased. In principle, yes. Okay, thank you.
Uh thanks for the nice talk. Uh yeah, first of all I just wanted to say I I think your uh elevator pitch is very well honed now and very Thank convincing. you. I had a question about um so people have observed that if you sample at a non-zero temperature and you sample repeatedly and do something like majority voting on something like G_S_M_ eight K_ you get, you know, improved accuracy or something like that. So it's a simple way of doing test-time scaling. I was wondering if you
who tried this with this new approach to sampling and whether it had benefits in those kinds of applications. If a chain of thought, like eight-way chain of thought counts, which I think it does here, then yes, that's in fact what we do for our reasoning experiments. And our argument here is that by having more creativity across the different...
beams or whatever you know that that you should have in principle more likelihood of finding the right answer somewhere right so so that's our the source of that claim Got it. Yeah, I missed that. Thanks.
Yeah, thanks for the great talk. So I have a question on like, can you learn a, so like the first question is, can you distill whatever sampling strategy you have, say min p back into the model by say just minimizing KL? And the second question is on just learning sampling methods in general. So like one view of sampling is, is just a monotonic map from logits to probabilities, right? So like, is there a way to just learn this from from scratch instead of designing the best methods?
Methods to do this? I'll observe that certainly open source communities will chafe against this because they really like the idea of being able to switch them on the fly at inference time. So I would say that at least from our perspective as researchers, I don't really care about these. But in particular, yes, I do think that you can do exactly what you're saying and that trained sampling might be the way forward. And furthermore, just as we talk about, I do think that.
that OpenAI, Anthropic, and Gemini didn't integrate this on purpose because it will probably help break alignment. And so integrating these kind of innovations in a way that doesn't make it easy for the wrong users to do things with it will be very useful to them.
