<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Sampling on Nalar</title>
    <link>https://nalar.dev/tags/sampling/</link>
    <description>Recent content in Sampling on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 09 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/sampling/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Control LLM Randomness with Temperature, Top-K, and Top-P</title>
      <link>https://nalar.dev/control-llm-randomness-with-temperature-top-k-and-top-p/</link>
      <pubDate>Wed, 09 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/control-llm-randomness-with-temperature-top-k-and-top-p/</guid>
      <description>&lt;p&gt;A language model does not normally produce a single inevitable next token. Given a prefix, it assigns scores to many possible tokens. A decoding algorithm then decides how to turn those scores into the next output.&lt;/p&gt;&#xA;&lt;p&gt;That last step matters. If you sample too freely, a model can drift into unlikely continuations. If you restrict sampling too aggressively, outputs can become repetitive or lose useful variation. Parameters such as &lt;strong&gt;temperature&lt;/strong&gt;, &lt;strong&gt;top-k&lt;/strong&gt;, and &lt;strong&gt;top-p&lt;/strong&gt; control different parts of this trade-off, so treating them as interchangeable &amp;ldquo;creativity settings&amp;rdquo; leads to confusing results.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
