TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dummy's Guide to Modern LLM Sampling

228 pointsby nkko11 days ago

12 comments

Der_Einzige11 days ago
Related to this, our min_p paper was ranked #18 out of 12000 submission at ICLR and got an oral:<p><a href="https:&#x2F;&#x2F;iclr.cc&#x2F;virtual&#x2F;2025&#x2F;oral&#x2F;31888" rel="nofollow">https:&#x2F;&#x2F;iclr.cc&#x2F;virtual&#x2F;2025&#x2F;oral&#x2F;31888</a><p>Our poster was popular:<p>poster: <a href="https:&#x2F;&#x2F;iclr.cc&#x2F;media&#x2F;PosterPDFs&#x2F;ICLR%202025&#x2F;30358.png?t=1745327604.27015" rel="nofollow">https:&#x2F;&#x2F;iclr.cc&#x2F;media&#x2F;PosterPDFs&#x2F;ICLR%202025&#x2F;30358.png?t=174...</a><p>oral presentation (watch me roast yoshua bengio on this topic and then have him be the first questioner, 2nd speaker starting around 19:30 min mark. My slides for the presentation are there too and really funny.): <a href="https:&#x2F;&#x2F;iclr.cc&#x2F;virtual&#x2F;2025&#x2F;session&#x2F;31936" rel="nofollow">https:&#x2F;&#x2F;iclr.cc&#x2F;virtual&#x2F;2025&#x2F;session&#x2F;31936</a><p>paper: <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2407.01082" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2407.01082</a><p>As one of the min_p authors, I can confirm that Top N sigma is currently the best general purpose sampler by far. Also, temperature can and should be scaled far higher than it is today. Temps of 100 are totally fine with techniques like min_p and top N sigma.<p>Also, the special case of top_k = 2 with ultra high temperature (one thing authors recommend against near the end) is very interesting in its own right. Doing it leads to spelling errors every ~10th word - but also seems to have a certain creativity to it that&#x27;s quite interesting.
评论 #43888420 未加载
orbital-decay11 days ago
One thing not said here is that samplers have no access to model&#x27;s internal state. It&#x27;s basic math applied to the output distribution, which technically carries some semantics but you can&#x27;t decode it without being as smart as the model itself.<p>Certain samplers described here like repetition penalty or DRY are just like this - the model could repeat itself in a myriad of ways, the only way to prevent all of them is better training, not n-gram search or other classic NLP methods. This is basically trying to plug every hole with a finger. How many fingers do you have?<p>Hacking the autoregressive process has some some low-hanging fruits like Min-P that can make some improvement and certain nifty tricks possible, but if you&#x27;re doing it to turn a bad model into a good one, you&#x27;re doing it wrong.
评论 #43888135 未加载
评论 #43889081 未加载
smcleod11 days ago
I had a go at writing a bit of a sampling guide for Ollama&#x2F;llama.cpp as well recently, open to any feedback &#x2F; corrections - <a href="https:&#x2F;&#x2F;smcleod.net&#x2F;2025&#x2F;04&#x2F;comprehensive-guide-to-llm-sampling-parameters&#x2F;" rel="nofollow">https:&#x2F;&#x2F;smcleod.net&#x2F;2025&#x2F;04&#x2F;comprehensive-guide-to-llm-sampl...</a>
neuroelectron11 days ago
Love this and the way everything is mapped out and explained simply really opens up the opportunity for trying new things, and where you can do that effectively.<p>For instance, <i>why not</i> use whole words as tokens? Make a &quot;robot&quot; with a limited &quot;robot dialect.&quot; Yes, no capacity for new words or rare words, but you could modify the training data and input data to translate those words into the existing vocabulary. Now you have a much smaller mapping that&#x27;s literally robot-like and kind of gives the user an expectation of what kind of answers the robot can answer well, like C-3PO.
评论 #43888647 未加载
mdp202111 days ago
When the attempt is though to have the LLM output an &quot;idea&quot;, not just a &quot;next token&quot;, the selection over the logits vector should break that original idea... If the idea is complete, there should be no need to use sampling over the logits.<p>The sampling, in this framework, should not happen near the output level (&quot;what will the next spoke word be&quot;).
评论 #43888329 未加载
michaelgiba7 days ago
This is much more thorough, but here is an interactive post covering the related topic constrained sampling I put together a few weeks back:<p><a href="http:&#x2F;&#x2F;michaelgiba.com&#x2F;grammar-based&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;michaelgiba.com&#x2F;grammar-based&#x2F;index.html</a>
amelius11 days ago
Would it be possible for the LLM model to do the tokenization implicitly? So instead of building a separate tokenizer, you just allow the use of any string of characters, then have a neural network that converts that into tokens, where the weights of that network are trained with the rest of the llm.
评论 #43891839 未加载
antonvs11 days ago
This is great! “Sampling” covers much more than I expected.
ltbarcly311 days ago
Calling things modern that are updates to techniques to use technologies only invented a few years ago is borderline illiterate. Modern vs what, classical LLM sampling?
评论 #43894523 未加载
评论 #43890215 未加载
评论 #43889704 未加载
simonw11 days ago
This is a really useful document - the explanations are very clear and it covers a lot of ground.<p>Anyone know who wrote it? It&#x27;s not credited and it&#x27;s pubished on a free Markdown pastebin.<p>The section on DRY - &quot;repetition penalties&quot; - was interesting to me. I often want LLMs to deliberately output exact copies of their input. When summarizing a long conversation for example I tend to ask for <i>exact quotes</i> that are most illustrative of the points being made. These are easy to fact check later by searching for them in the source material.<p>The DRY penalty seems to me that it would run counter to my goal there.
评论 #43889309 未加载
blt11 days ago
This is pretty interesting. I didn&#x27;t realize so much manipulation was happening after the initial softmax temperature choice.
评论 #43888133 未加载
gitroom11 days ago
Man, there&#x27;s always way more to this stuff than I first guess. Makes me wonder - you think better sampling really fixes model limits, or is it just kind of patching over deeper problems?