<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Logits on Nalar</title>
    <link>https://nalar.dev/tags/logits/</link>
    <description>Recent content in Logits on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 24 Sep 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/logits/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tanh Logit Soft Capping Bounds Extreme Scores Before Softmax</title>
      <link>https://nalar.dev/tanh-logit-soft-capping-bounds-extreme-scores-before-softmax/</link>
      <pubDate>Thu, 24 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/tanh-logit-soft-capping-bounds-extreme-scores-before-softmax/</guid>
      <description>&lt;p&gt;A softmax can accept logits of any finite magnitude, but large score gaps make its output increasingly concentrated. Tanh logit soft capping inserts a bounded nonlinear transform before softmax so that no transformed logit exceeds a configured magnitude.&lt;/p&gt;&#xA;&lt;p&gt;For a positive cap &lt;code&gt;c&lt;/code&gt;, a common form 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;softcap(z; c) = c * tanh(z / c)&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;The operation does not clip at a hard threshold. It behaves almost linearly near zero and gradually compresses larger magnitudes as they approach &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;c&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Logit Bias Alters Token Odds Before Sampling</title>
      <link>https://nalar.dev/logit-bias-alters-token-odds-before-sampling/</link>
      <pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/logit-bias-alters-token-odds-before-sampling/</guid>
      <description>&lt;p&gt;A token-level bias is usually applied to model scores before probabilities are normalized. That placement matters. Adding a constant to one token&amp;rsquo;s logit changes its odds relative to every token that does not receive the same constant, even though the model parameters and hidden state remain unchanged.&lt;/p&gt;&#xA;&lt;p&gt;The mechanism is simple, but its operational effect depends on the rest of the decoding pipeline.&lt;/p&gt;&#xA;&lt;h2 id=&#34;additive-bias-acts-on-score-differences&#34;&gt;Additive bias acts on score differences&lt;/h2&gt;&#xA;&lt;p&gt;For a vocabulary with logits (z_1, \ldots, z_V), softmax assigns token (i) the probability&lt;/p&gt;</description>
    </item>
    <item>
      <title>Repetition Penalty Rewrites Logits for Seen Token IDs</title>
      <link>https://nalar.dev/repetition-penalty-rewrites-logits-for-seen-token-ids/</link>
      <pubDate>Wed, 23 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://nalar.dev/repetition-penalty-rewrites-logits-for-seen-token-ids/</guid>
      <description>&lt;p&gt;A repetition penalty can act before sampling by changing the logits of token IDs that already occur in a selected token history. The operation does not need to compare words, phrases, or rendered strings. Its unit can be the tokenizer&amp;rsquo;s integer ID, which gives the mechanism a narrower meaning than its name may suggest.&lt;/p&gt;&#xA;&lt;p&gt;That distinction matters when a decoder emits subword tokens. Two strings that appear similar to a person can map to different token sequences, while a token reused inside unrelated words can still be marked as previously seen.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
