<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Notes</title><link>https://notes.leo-draw.xyz/posts/</link><description>Recent content in Posts on Notes</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 24 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://notes.leo-draw.xyz/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>Token Sampling</title><link>https://notes.leo-draw.xyz/posts/token-sampling/</link><pubDate>Mon, 24 Aug 2026 00:00:00 +0000</pubDate><guid>https://notes.leo-draw.xyz/posts/token-sampling/</guid><description>&lt;p&gt;How a language model turns last-step &lt;strong&gt;logits&lt;/strong&gt; into the next token. The model itself only produces a score per vocabulary id. Sampling decides which id is actually emitted.&lt;/p&gt;
&lt;p&gt;Input: &lt;code&gt;logits&lt;/code&gt; with shape &lt;code&gt;[batch, vocab_size]&lt;/code&gt;.&lt;br&gt;
Output: next token ids with shape &lt;code&gt;[batch, 1]&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Typical knobs: &lt;code&gt;temperature&lt;/code&gt;, &lt;code&gt;top_k&lt;/code&gt;, &lt;code&gt;top_p&lt;/code&gt;. Common defaults for greedy decoding: &lt;code&gt;temperature = 0&lt;/code&gt;, &lt;code&gt;top_k = 0&lt;/code&gt; (off), &lt;code&gt;top_p = 1.0&lt;/code&gt; (off).&lt;/p&gt;
&lt;h2 id="pipeline"&gt;Pipeline&lt;/h2&gt;
&lt;p&gt;Each step below is optional except the first branch and the final sample. Greedy (&lt;code&gt;temperature == 0&lt;/code&gt;) skips the rest.&lt;/p&gt;</description></item></channel></rss>