<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Softmax on Nalar</title>
    <link>https://nalar.dev/tags/softmax/</link>
    <description>Recent content in Softmax on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 23 Sep 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/softmax/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Additive Logit Bias Changes Token Odds Before Sampling</title>
      <link>https://nalar.dev/additive-logit-bias-changes-token-odds-before-sampling/</link>
      <pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/additive-logit-bias-changes-token-odds-before-sampling/</guid>
      <description>&lt;p&gt;A decoder can favor or suppress a token without changing model weights. Add a constant to that token&amp;rsquo;s logit before softmax, and its probability changes relative to the rest of the vocabulary. The operation is simple, but its effect depends on where the bias enters the decoding pipeline and on every transformation that follows it.&lt;/p&gt;&#xA;&lt;p&gt;This makes additive logit bias useful as an inference control, but not as a general semantic constraint. It changes a score used by the decoder. It does not rewrite the model&amp;rsquo;s internal representation or guarantee that a concept disappears from generated text.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Attention Logit Scaling Keeps Dot Products in a Stable Softmax Range</title>
      <link>https://nalar.dev/attention-logit-scaling-keeps-dot-products-in-a-stable-softmax-range/</link>
      <pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/attention-logit-scaling-keeps-dot-products-in-a-stable-softmax-range/</guid>
      <description>&lt;p&gt;A dot product between a query and a key tends to grow in magnitude as their dimension grows. In scaled dot-product attention, the score is divided by the square root of the key dimension before softmax. That factor is not a cosmetic normalization. It controls the scale presented to softmax under a specific statistical assumption about the query and key components.&lt;/p&gt;&#xA;&lt;p&gt;The familiar expression is&lt;/p&gt;&#xA;&lt;div&#xA;  x-data=&#34;{ code: $el.querySelector(&#39;code&#39;).innerText, copied: false }&#34;&#xA;  class=&#34;code-block group relative my-6 overflow-hidden rounded-xl border border-line bg-surface-muted dark:border-night-line dark:bg-night-surface&#34;&gt;&#xA;  &lt;button&#xA;    type=&#34;button&#34;&#xA;    @click=&#34;navigator.clipboard.writeText(code); copied = true; setTimeout(() =&gt; copied = false, 1600)&#34;&#xA;    class=&#34;absolute right-3 top-3 z-10 rounded-lg border border-line-strong bg-surface px-2 py-1 font-mono text-[0.8rem] text-muted opacity-0 transition group-hover:opacity-100 hover:bg-ink hover:text-white dark:border-night-line dark:bg-night dark:text-night-muted dark:hover:bg-white dark:hover:text-ink&#34;&gt;&#xA;    &lt;span x-text=&#34;copied ? &#39;Copied&#39; : &#39;Copy&#39;&#34;&gt;&lt;/span&gt;&#xA;  &lt;/button&gt;&#xA;  &#xA;  &lt;div class=&#34;overflow-x-auto p-4 text-sm leading-6 [&amp;_pre]:!m-0 [&amp;_pre]:!bg-transparent [&amp;_pre]:!p-0 [&amp;_code]:font-mono&#34;&gt;&#xA;    &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Attention(Q, K, V) = softmax(QK^T / sqrt(d_k)) V&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;p&gt;where &lt;code&gt;d_k&lt;/code&gt; is the query-key dimension for one attention head. The scaling term affects the distribution of attention probabilities even though it does not change the ordering of logits by itself.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Temperature Scaling Changes Softmax Sharpness Without Changing Logit Order</title>
      <link>https://nalar.dev/temperature-scaling-changes-softmax-sharpness-without-changing-logit-order/</link>
      <pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/temperature-scaling-changes-softmax-sharpness-without-changing-logit-order/</guid>
      <description>&lt;p&gt;A decoder can assign the same ranking to every token before and after temperature scaling while producing substantially different probabilities. The mechanism is simple: for positive temperature &lt;code&gt;T&lt;/code&gt;, logits are divided by &lt;code&gt;T&lt;/code&gt; before softmax. Division by the same positive scalar preserves order, but softmax converts the changed gaps between logits into a different probability distribution.&lt;/p&gt;&#xA;&lt;p&gt;That distinction matters in inference systems because temperature does not select tokens by itself. Its visible effect depends on what happens after the scaled softmax: direct sampling, top-k filtering, top-p filtering, greedy selection, or another decoding rule.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
