<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[AI by Hand ✍️]]></title><description><![CDATA[Math, Algorithms, Architectures, by hand]]></description><link>https://www.byhand.ai</link><image><url>https://substackcdn.com/image/fetch/$s_!fOmN!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F618d59fa-9b8f-4814-8d16-f29c2f23ae53_371x371.png</url><title>AI by Hand ✍️</title><link>https://www.byhand.ai</link></image><generator>Substack</generator><lastBuildDate>Wed, 28 Oct 2026 20:27:54 GMT</lastBuildDate><atom:link href="https://www.byhand.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Tom Yeh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[aibyhand@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[aibyhand@substack.com]]></itunes:email><itunes:name><![CDATA[Prof. Tom Yeh]]></itunes:name></itunes:owner><itunes:author><![CDATA[Prof. Tom Yeh]]></itunes:author><googleplay:owner><![CDATA[aibyhand@substack.com]]></googleplay:owner><googleplay:email><![CDATA[aibyhand@substack.com]]></googleplay:email><googleplay:author><![CDATA[Prof. Tom Yeh]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Jev to Kernels by Hand ~ Dr. Dandekar, PhD. MIT]]></title><description><![CDATA[Special Guest Speaker]]></description><link>https://www.byhand.ai/p/jev-to-kernels-by-hand-dr-dandekar</link><guid isPermaLink="false">https://www.byhand.ai/p/jev-to-kernels-by-hand-dr-dandekar</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Mon, 05 Oct 2026 18:43:29 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xoLn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I invited <a href="https://www.linkedin.com/in/rajat-dandekar-901324b1/">Dr. Dandekar</a>, the Founder of <a href="https://vizuara.ai/">Vizura AI Labs</a>, to teach me and my students Jev and Kernels. </p><p>Like me, Dandekar's most preferred teaching method is sketching and writing by hand. &#9997;&#65039; His AI teaching channel on YouTube has more than 200K+ subscribers <a href="https://luma.link/tRYkhbhDHW">https://www.youtube.com/@vizuara</a> </p><p>We will start from a small decision we solve on paper, get deeper, and connect all the way to writing kernels to run on a GPU.</p><h2>Frontier AI Seminar Series ~ Fall 2026</h2><p><strong>Title:</strong> From Jev to Kernels</p><p><strong>Speaker: </strong><a href="https://www.linkedin.com/in/rajat-dandekar-901324b1/?isSelfProfile=false">Rajat Dandekar</a>, Co-Founder, <a href="https://vizuara.ai/">Vizuara</a>, PhD. MIT.</p><p><strong>Host:</strong> Prof. Tom Yeh, Department of Computer Science, CU Boulder, AI by Hand &#9997;&#65039;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xoLn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xoLn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 424w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 848w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 1272w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xoLn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png" width="1456" height="648" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:648,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:653810,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.byhand.ai/i/218981913?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xoLn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 424w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 848w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 1272w, https://substackcdn.com/image/fetch/$s_!xoLn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd39333-518a-4964-ae9f-7a59c0c7e78d_1918x854.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Date:</strong> Friday, October 9</p><p><strong>Time:</strong> 9am Pacific Time / 10am Mountain</p><p><strong>Luma Event:</strong> <a href="https://luma.com/byhand-v8nj">https://luma.com/byhand-v8nj</a></p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://luma.com/byhand-v8nj&quot;,&quot;text&quot;:&quot;Register&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://luma.com/byhand-v8nj"><span>Register</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[RNNs by Hand, in Excel]]></title><description><![CDATA[From a small neuron to a small language model]]></description><link>https://www.byhand.ai/p/library-series-sheets-rnn</link><guid isPermaLink="false">https://www.byhand.ai/p/library-series-sheets-rnn</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:38:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!yr-V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe57c087f-8c87-4a74-ab1a-dc593576af50_2000x2639.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Recurrent attention for infinite context, recursive transformers, state space models. To stay at the frontier, you need to go back to understand RNNs. I used to teach RNNs to give students the founda&#8230;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-series-sheets-rnn">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Small Language Model]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-everything</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-everything</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:35:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kHPS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><strong>Small Language Model</strong></p></li></ol></div><p>This is the last article of the series. It has one example: the small language model from the start of the series, with every piece now in place.</p><h2>words, d=6, h=6, layers=4, vocab=30, seq=30, softmax, sample, tied</h2><p>It reads a word, looks up its embedding, and passes it through four stacked layers. Then it scores every word in the vocabulary, samples one, and reads that word next. Thirty steps later, it has written five sentences.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kHPS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kHPS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!kHPS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kHPS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe755be7e-a79e-41fd-8b85-2c61ab276374_8300x10988.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div><p>Now you are rewarded with an understanding of everything important to a language model, including:</p><ul><li><p>recurrence: the hidden state, and the same weights reused at every step</p></li><li><p>hidden size, input size, and batches</p></li><li><p>several outputs per step, softmax, and many-to-one</p></li><li><p>stacked layers and bidirectional RNNs</p></li><li><p>the encoder, the decoder, and the bottleneck of the context between them</p></li><li><p>tokens, one-hot vectors, embeddings, and tied embeddings</p></li><li><p>argmax and sampling</p></li><li><p>autoregressive generation and prompts</p></li><li><p>loss and its gradients</p></li></ul><p>I stop short of backpropagation through time. I am still in the middle of doing research on how to represent it in Excel.</p><p>The download below has the whole language model in Excel, with live calculations.</p>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-everything">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Loss]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-loss</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-loss</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:34:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fTVM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><strong>Loss</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>So far, every weight was chosen by hand. How do we choose them from data instead? We need a measure of how wrong a network is. That measure is the <strong>loss</strong>. We give each output a <strong>target</strong>, the answer we want, and the loss compares the two. Then we ask which way each output should move to make the loss smaller. That direction is its <strong>gradient</strong>.</p><h2>d=1, h=1, seq=5, L2 loss</h2><p>Let's start with the d=1, h=1, seq=5 network of the Recurrence article. Its weights and inputs are the same, so every <em>y&#8348;</em> is too. Under each output, we write its target, <em><strong>y\*&#8348;</strong></em>, in cream, because it is given, like an input. The loss at step <em>t</em> is <em><strong>l&#8348;</strong></em> = &#189;(<em>y&#8348;</em> &#8722; <em>y\*&#8348;</em>)&#178;. It is half the squared difference, called the <strong>L2</strong> loss. It is zero when the output hits its target, and it grows the further away it is. The loss of the whole sequence, <em><strong>L</strong></em>, is the mean of the five, in purple, under <em>l&#8321;</em>. In practice, a sequence runs hundreds or thousands of steps. The mean keeps <em>L</em> on the same scale however long it gets. The largest <em>l&#8348;</em> is at step 2, where the output is furthest from its target. In the download, type another target, or change a weight, and watch <em>L</em> move.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fTVM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fTVM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fTVM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fTVM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cf75a1e-b944-449e-b973-bce59412e61f_1092x956.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-loss">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Autoregressive]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-autoregressive</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-autoregressive</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:33:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!DiFE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><strong>Autoregressive</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last article, the network read tokens and wrote them. But which token it picked had no influence on what came next. How does a network read what it writes? Each output becomes the next step's input. A network that feeds on its own outputs is called <strong>autoregressive</strong>.</p><h2>d=1, h=2, y=1, seq=5, one-to-many</h2><p>We start with a one-to-many network, like the decoder of the Seq2Seq article, reading a single number at its first step. The first input, <em>x&#8321;</em> = 1, starts it. After that, every input is 0, dimmed, so each step runs on its state alone. The five outputs are 0.76, &#8722;0.43, &#8722;0.24, 0.58, and &#8722;0.28. In the download, change <em>x&#8321;</em>, and all five outputs follow.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DiFE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 424w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 848w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DiFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DiFE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 424w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 848w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!DiFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29c79ce3-2114-45f5-af5d-4344704bc8dc_1160x812.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Tokens]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-tokens</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-tokens</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:33:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!IZkY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><strong>Tokens</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last article, every sequence was made of numbers. How does a network read a word, and write one? It reads and writes <strong>tokens</strong>. A token is a unit of text: a letter, a word, or part of a word. I use letters, so every example fits on a screen.</p><h2>cab, d=2, h=2, seq=3, many-to-one, sigmoid</h2><p>Let's start with a vocabulary of three letters, a b c, and read the word cab. Each letter becomes a vector of two numbers. We keep the vectors in a table, <em><strong>E</strong></em>, with one column per letter. Each column is an <strong>embedding</strong>. In these examples, <em>E</em> is fixed, so it has no fill. In practice, <em>E</em> is usually trained along with the weights. To read a letter, we <strong>look it up</strong>, finding the column headed by that letter. So cab becomes three vectors, <em>x&#8321;</em> to <em>x&#8323;</em>, in cream. From there, the RNN reads them many-to-one, as in the Outputs article. A sigmoid gives one probability for the whole word. In the download, type another word made from a b c, and every step recomputes.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IZkY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IZkY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IZkY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IZkY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2443ab53-0422-445d-8792-2bee1d1edf97_956x1100.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Seq2Seq]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-seq2seq</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-seq2seq</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:32:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Sw5t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><strong>Seq2Seq</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last article, our network read a sequence and gave its answers along the way. In this article, the answer is a sequence too. How does a network turn one sequence into another? We build it from two halves. An <strong>encoder</strong> reads the input sequence into one vector. A <strong>decoder</strong> turns that vector into an output sequence. Together, they form a sequence-to-sequence network, or <strong>seq2seq</strong>.</p><h2>d=1, h=2, y=3, seq=5, many-to-one</h2><p>We start with the encoder. It is a many-to-one RNN, as in the Outputs article. We label it Encoder, at the top left. Its one output, <em>y</em>, is what the encoder knows about the whole sequence. Compare <em>y</em> with the Outputs article, and you find the last output of its <em>y</em>=3 example.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sw5t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sw5t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Sw5t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Sw5t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff190f518-1a70-4dfb-a422-ce1567b80578_1160x908.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Depth]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-depth</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-depth</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:31:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OIFJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><strong>Depth</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last three articles, our network had one hidden layer. How do we make it deeper? We can stack layers, each reading the hidden state of the layer below. Or we can read the sequence in both directions at once. Each example builds on one we have already seen, so we keep an eye on what stays the same.</p><h2>d=1, h=1, h&#8242;=1, seq=5</h2><p>We stack a second layer on top of the first. We mark it with a prime. Its hidden state is <em><strong>h&#8242;</strong></em>, and its weights are <em><strong>W&#8242;x</strong></em>, <em><strong>W&#8242;h</strong></em> and <em><strong>b&#8242;</strong></em>. At each step, layer 2 reads the hidden state <em>h&#8348;</em> from layer 1. It also reads its own state from the step before, <em>h&#8242;&#8348;&#8331;&#8321;</em>. The output now comes from layer 2. Why does the <em>h</em> row match the last example of the first article? Because layer 1 is exactly that network.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OIFJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OIFJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OIFJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OIFJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93b33e27-627e-4f6f-8c83-c8b81b6cc9a6_1092x1004.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-depth">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Outputs]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-outputs</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-outputs</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:31:08 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8tMS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><strong>Outputs</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last two articles, every step gave one output. In this article, we change what comes out. What if each step gave several outputs, or the whole sequence gave just one? Most examples start from the <em>h</em>=2 network of the last article. They change only what comes after the hidden state.</p><h2>d=1, h=2, y=2, seq=5</h2><p>We ask each step for two outputs. The hidden states do not change. Each output reads the same <em>h&#8348;</em>, with its own row of weights. Compare the first output with the <em>h</em>=2 example, and you will see they match.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8tMS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8tMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8tMS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8tMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F216dc7ee-add2-4382-b42c-287f57b8bd59_1160x860.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Size]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-size</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-size</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:30:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!IfAz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">Recurrence</a></p></li><li><p><strong>Size</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>In the last article, every input and every memory had size one. In this article, we grow them. The <strong>hidden size</strong>, <em>h</em>, is how many numbers the hidden state holds. The <strong>input size</strong>, <em>d</em>, is how many numbers each step reads. We also read a <strong>batch</strong>, several sequences at once. Within this article, we keep the weights fixed, so each example differs from the last in one way only.</p><h2>d=1, h=2, seq=5</h2><p>We give the memory a second number, in green. Every step still does the same thing. At step <em><strong>t</strong></em>, it reads its input <em><strong>x&#8348;</strong></em> and the hidden state from the step before, <em><strong>h&#8348;&#8331;&#8321;</strong></em>. What grows is the weights. <em>Wx</em>, <em>b</em> and <em>Wy</em> each gain an entry, one per memory number. <em>Wh</em> becomes a matrix. Why a matrix? Because each new memory number reads both old ones. Follow the arrows in the download; each one now carries the whole memory to the next step.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IfAz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IfAz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IfAz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 424w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 848w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!IfAz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a84676d-d18b-4bde-9e79-93351ad50842_1160x812.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-size">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Recurrence]]></title><description><![CDATA[RNNs by Hand, in Excel]]></description><link>https://www.byhand.ai/p/library-sheets-rnn-recurrence</link><guid isPermaLink="false">https://www.byhand.ai/p/library-sheets-rnn-recurrence</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sun, 27 Sep 2026 22:30:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!nksh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-sheets-rnn">RNNs by Hand, in Excel</a></h3><ol><li><p><strong>Recurrence</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-size">Size</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-outputs">Outputs</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-depth">Depth</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-seq2seq">Seq2Seq</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-tokens">Tokens</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-autoregressive">Autoregressive</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-loss">Loss</a></p></li><li><p><a href="https://www.byhand.ai/p/library-sheets-rnn-everything">Small Language Model</a></p></li></ol></div><p>How does a network remember? A recurrent neural network, or RNN, reads a sequence one step at a time. At each step, it takes one input and updates a <strong>hidden state</strong>. The hidden state is what the network remembers. We build an RNN in Excel, one change at a time. I keep the weights fixed, so each example differs from the last in one way only.</p><h2>d=1</h2><p>Let's start with the smallest network there is. It reads one input, <em><strong>x</strong></em>, in the cream cell at the top. The weight <em><strong>Wx</strong></em> and the bias <em><strong>b</strong></em>, in light red on the left, turn <em>x</em> into <em><strong>F</strong></em>. The bias is the darker red. We write the bias as one more weight, and put a constant <strong>1</strong> under <em>x</em> for it to multiply. So [<em>Wx</em> <em>b</em>] &#183; [<em>x</em>; 1] is the same as <em>Wx</em> &#183; <em>x</em> + <em>b</em>. A <strong>tanh</strong> turns <em>F</em> into the hidden value <em><strong>h</strong></em>, in green. Then <em><strong>Wy</strong></em> and <em><strong>by</strong></em> turn <em>h</em> into the output <em><strong>y</strong></em>, in blue. There is no memory yet.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nksh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nksh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nksh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nksh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nksh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nksh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nksh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nksh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nksh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3902b7d3-0706-4139-b958-035ed0ac85bd_480x620.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div>
      <p>
          <a href="https://www.byhand.ai/p/library-sheets-rnn-recurrence">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[AI by Hand ✍️ Yantra Jnana Award]]></title><description><![CDATA[Teach AI by Hand in India&#8217;s Languages]]></description><link>https://www.byhand.ai/p/library-newsletter-challenges-yantra-jnana-challenge</link><guid isPermaLink="false">https://www.byhand.ai/p/library-newsletter-challenges-yantra-jnana-challenge</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Fri, 04 Sep 2026 19:32:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RddY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Yantra Jnana means "Machine Knowledge" in Sanskrit. I learned this from Prof. Narendra Karamangala, who is leading a research effort at RV University to build a language model for India's languages.</p><p>September 5th is India&#8217;s Teachers' Day. We are pleased to announce the AI By Hand &#9997;&#65039;  Yantra Jnana Award, which is to recognize extraordinary work teaching AI in an Indian language, by hand, without relying on expensive technologies.</p><p>Please share this announcement with people you know who may be interested in this award!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RddY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RddY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RddY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" width="728" height="683.233870967742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:931,&quot;width&quot;:992,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:213593,&quot;alt&quot;:&quot;Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys" title="Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys" srcset="https://substackcdn.com/image/fetch/$s_!RddY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RddY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg" class="icon-noB79L"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Prof. Narendra&#8217;s hand writing in many Indian languages.</figcaption></figure></div><p>To enter the award, record a video of you teaching AI by hand in one of the following languages:</p><ul><li><p>Hindi</p></li><li><p>Punjabi</p></li><li><p>Marathi</p></li><li><p>Gujarati</p></li><li><p>Kannada</p></li><li><p>Tamil</p></li><li><p>Telugu</p></li><li><p>Malayalam</p></li></ul><p>We know there are a lot more languages in India. But please allow us to start with this initial round of 8 languages, which I believe have the most number of native speakers. If this round is well-received, we will definitely give more awards for cover other languages in the future.</p><h2>Awards</h2><p>We currently have funding to give 10 awards: one in each of the eight languages, and two more to the strongest entries remaining, in any language.</p><p>Each award carries:</p><ul><li><p>A fellowship of &#8377;40,000 (to support you to teach AI by hand to more people)</p></li><li><p>An award certificate (you can hang on the wall)</p></li><li><p>A year of Packt subscription</p></li><li><p>A year of paid subscription for my AI by Hand newsletter</p></li><li><p>Your video featured on my social media channels and YouTube</p></li></ul><h2>Format Requirements</h2><p>These requirements are what make this an AI By Hand &#9997;&#65039; award, so please read it closely.</p><ol><li><p>Print the material for your topic on paper, and work from it.</p></li><li><p>Or use a blackboard or a whiteboard. No iPad, no tablet, no digital ink.</p></li><li><p>Keep your hand in the frame for the entire video.</p></li></ol><h2>Judging Criteria</h2><p>Every entry is read by a panel of expert reviewer who work in your language.</p><p>Every entry is read by an expert reviewer who works in your language, and scored on five things:</p><ul><li><p><strong>Conceptual accuracy</strong> (35%): is the idea exactly right, however you chose to explain it?</p></li><li><p><strong>Pedagogical value</strong> (25%): does it build real intuition, or only state facts?</p></li><li><p><strong>Language quality</strong> (20%): is the language fluent and natural?</p></li><li><p><strong>Originality of approach</strong> (15%): is the teaching style your own, rather than a copy of the source&#8217;s framing?</p></li><li><p><strong>Production quality</strong> (5%): is it clear enough to watch and hear?</p></li></ul><p>These criteria and weights are subject to change until the submission window opens on September 12.</p><h2>Timeline</h2><ul><li><p>Saturday, September 5: Registration opens</p></li><li><p>Friday, September 18: Registration closes</p></li><li><p>Friday, October 16: Videos are due</p></li><li><p>Friday, October 30: Awards are announced</p></li></ul><h2>Register</h2><p>Registering is the only step to take right now. Once you have registered, we will email you the submission instructions.</p><p>Register by Friday, September 18: <a href="https://byhand.ai/yantra/register">byhand.ai/yantra/register</a></p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://byhand.ai/yantra/register&quot;,&quot;text&quot;:&quot;Register&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://byhand.ai/yantra/register"><span>Register</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Counting AI by Hand ✍️ ~ Recordings]]></title><description><![CDATA[Mohsena Ashraf on measuring what AI costs, in Excel]]></description><link>https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand</link><guid isPermaLink="false">https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:21:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ebNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Mohsena Ashraf, my PhD student at CU Boulder, leads this series on how to count AI by hand &#9997;&#65039;. Her research is in explainable AI, and her particular interest is cost. How much memory does a transformer layer need? How many tokens are sitting in an agent's memory? Where do the computational costs of AI actually come from?</p><p>The method is the same in every lecture. Instead of equations and Greek symbols, operations and tokens become 2D rectangles in a spreadsheet, and the area of a rectangle is the cost. Once you can see it, you can measure it, compare it, and count it by hand. Everything happens in Excel, so every formula is visible and every workbook is yours to keep and to modify.</p><ol><li><p>Transformer Ops</p></li><li><p>Agent Tokens</p></li><li><p>Loop Engineering [coming Sep 3]</p></li></ol><p>This series is sponsored by By Hand Research.</p><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">1. Transformer Ops (Jun 23, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Transformer Ops (Jun 23, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Transformer Ops (Jun 23, 2026)" title="Transformer Ops (Jun 23, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">2. Agent Tokens (Jul 14, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Agent Tokens (Jul 14, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Agent Tokens (Jul 14, 2026)" title="Agent Tokens (Jul 14, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">3. Loop Engineering (coming soon, Sep 3, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vC9t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Loop Engineering (coming soon, Sep 3, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Loop Engineering (coming soon, Sep 3, 2026)" title="Loop Engineering (coming soon, Sep 3, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!vC9t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Loop Engineering (coming soon, Sep 3, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:20:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fOmN!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F618d59fa-9b8f-4814-8d16-f29c2f23ae53_371x371.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand">Counting AI by Hand &#9997;&#65039;</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">Transformer Ops (Jun 23, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">Agent Tokens (Jul 14, 2026)</a></p></li><li><p><strong>Loop Engineering (coming soon, Sep 3, 2026)</strong></p></li></ol></div><p>The third lecture of Counting AI by Hand &#9997;&#65039; is on September 3.</p><p>The first lecture counted the operations inside the model, and the second counted the tokens moving through an application. This one counts what happens when nobody is re-prompting: the agent reads the goal, picks an action, checks whether it is done, and goes around again. You used to be the loop. Now the loop runs on its own, and every turn of it is billed.</p><p>Here is a preview of the workbook.</p><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Workbook</h2><p>Three exercises, all of them the same job search agent looping until it collects five good opportunities.</p><ol><li><p><strong>Loop Cost.</strong> Eight opportunities have to be checked before five turn out to be eligible, so how many LLM calls is that, and what do the input tokens, the output tokens and the bill come to?</p></li><li><p><strong>Expected Loops and Context Growth.</strong> Each opportunity has only a 50% chance of being eligible, so how many loops should you expect to run, and how much of what you pay for is the context that grows with every one of them?</p></li><li><p><strong>Loop Optimization.</strong> The same three steps in two different orders, priced side by side. One order is cheaper, and the reason is that the expensive step runs fewer times.</p></li></ol><p>There is a Solution sheet with every answer worked out, so you can fill the tables in yourself first or read straight through.</p><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/loop-engineering/LoopEngineering.xlsx">&#11015; Excel Workbook</a></p><p>The recording will be posted here after the lecture.</p>]]></content:encoded></item><item><title><![CDATA[Agent Tokens (Jul 14, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:19:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8Rno!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; Counting AI by Hand &#9997;&#65039;</h3><ol><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">Transformer Ops (Jun 23, 2026)</a></p></li><li><p><strong>Agent Tokens (Jul 14, 2026)</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">Loop Engineering (coming soon, Sep 3, 2026)</a></p></li></ol></div><p>Thank you for attending the second lecture of Counting AI by Hand &#9997;&#65039;, and for those who could not join us live, here is the recording.</p><p>The first lecture counted the operations inside the model. This one counts the tokens moving through an application, which is where the question that started the series finally gets a direct answer.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div><p>Here are some of the counting questions from this lecture.</p><ul><li><p><strong>[Input vs Output]</strong> Why does the text the model writes cost more than the text you typed?</p></li><li><p><strong>[Conversation History]</strong> What makes the same short question cost more late in a chat than at the start?</p></li><li><p><strong>[Tool Calls]</strong> Which costs more, three turns of plain chat or two turns that call a tool?</p></li><li><p><strong>[RAG]</strong> How many times do you pay for a chunk your retriever keeps finding?</p></li><li><p><strong>[Multi-Agent]</strong> What does it cost when every agent in a system keeps its own conversation?</p></li></ul><p>Mohsena works through every one of them in Excel, counting by hand. The cells hold tokens this time, and the total is your bill.</p><h2>Outline</h2><ol><li><p>Introduction (00:00)</p></li><li><p>Tokens basics, and why output costs more (01:51)</p><ol><li><p>FLOPs vs tokens</p></li><li><p>What a user sees</p></li><li><p>What actually happens: system prompt + history + tool results = input</p></li></ol></li><li><p>Chat history token counting (08:01)</p><ol><li><p>Basic chat, priced per turn</p></li></ol></li><li><p>Tool calls and token billing (18:07)</p><ol><li><p>Tool definitions, the call, the output</p></li><li><p>Why tool calls cost more (30:24)</p></li></ol></li><li><p>RAG workflow and token math (32:15)</p><ol><li><p>The same chunk, retrieved twice and paid for twice</p></li><li><p>Naive vs optimized: what has to be in the next request</p></li></ol></li><li><p>RAG variations and other inputs (47:15)</p><ol><li><p>Image + text</p></li></ol></li><li><p>Memory and multi-agent costs (48:27)</p><ol><li><p>Two sessions, and what the application stores between them</p></li><li><p>Planner and specialists, each with their own conversation</p></li></ol></li></ol><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Recording &amp; Workbook</h2><div id="youtube2-3chlg_dl_yA" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;3chlg_dl_yA&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/3chlg_dl_yA?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/agent-tokens/AgentTokens.xlsx">&#11015; Excel Workbook</a></p><div><hr></div><p>Next:<br><strong><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">3. Loop Engineering (coming soon, Sep 3, 2026)</a></strong></p>]]></content:encoded></item><item><title><![CDATA[Transformer Ops (Jun 23, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:18:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ebNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; Counting AI by Hand &#9997;&#65039;</h3><ol><li><p><strong>Transformer Ops (Jun 23, 2026)</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">Agent Tokens (Jul 14, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">Loop Engineering (coming soon, Sep 3, 2026)</a></p></li></ol></div><p>Thank you for attending the first lecture of Counting AI by Hand &#9997;&#65039;. Mohsena and I have been working on this series for months, and I am genuinely surprised by how many of you turned up for a topic like this one. This recording is for those who could not join us live.</p><p>Although the series is motivated by questions like "why are tokens costing so much?", we decided to go back and start from the foundational layer of counting the FLOPs, or the operations of the transformer architecture behind every model we are using today.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div><p>Here are some of the counting questions Mohsena works through in this lecture.</p><ul><li><p><strong>[Dot Product]</strong> Why does a single dot product cost more operations than the vectors have numbers?</p></li><li><p><strong>[Context Length]</strong> What happens to the cost of attention when you double the length of your prompt?</p></li><li><p><strong>[Concatenation]</strong> How many operations does it take to concatenate the outputs of six attention heads?</p></li><li><p><strong>[Attention vs MLP]</strong> Which costs more, attention or the MLP, and does that flip as models get bigger?</p></li><li><p><strong>[Backpropagation]</strong> How much more does it cost to train a block than to run it once?</p></li></ul><p>She built Excel worksheets to go over how you can "count" by hand to answer these questions. A matrix is a block of cells, and counting the operations is just counting the cells.</p><h2>Outline</h2><ol><li><p>What are FLOPs (00:00)</p><ol><li><p>Why FLOP matters</p></li></ol></li><li><p>Visualizing simple FLOP costs (03:09)</p><ol><li><p>Vector dot product</p></li><li><p>Matrix-vector product</p></li><li><p>Matrix-matrix product</p></li><li><p>FLOPs get huge</p></li></ol></li><li><p>Flow of the transformer architecture (11:51)</p><ol><li><p>Sequence length (n), embedding size (d), heads (h), layers (L)</p></li></ol></li><li><p>Counting attention FLOPs (17:27)</p><ol><li><p>Softmax scaling (27:02)</p></li><li><p>Value aggregation (27:40)</p></li><li><p>Concat and output projection (29:26)</p></li><li><p>Attention total (31:52)</p></li></ol></li><li><p>FLOP counting after attention (33:37)</p><ol><li><p>Residual add and LayerNorm</p></li></ol></li><li><p>FLOP counting for the MLP (40:48)</p><ol><li><p>Layer 1 and ReLU</p></li><li><p>Layer 2 and the block total (44:52)</p></li></ol></li></ol><p>The workbook carries two things the hour did not reach: a full backpropagation FLOP count on its own sheet, and the multi-head attention and full-stack sheets underneath it.</p><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Recording &amp; Workbook</h2><div id="youtube2-vSLvSzLq0hY" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;vSLvSzLq0hY&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/vSLvSzLq0hY?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/transformer-ops/TransformerFLOPs.xlsx">&#11015; Excel Workbook</a></p><div><hr></div><p>Next:<br><strong><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">2. Agent Tokens (Jul 14, 2026)</a></strong></p>]]></content:encoded></item><item><title><![CDATA[Kimi 3 ~ New Seminar Recording]]></title><description><![CDATA[AI by Hand &#9997;&#65039; Seminars]]></description><link>https://www.byhand.ai/p/library-videos-seminars-2026-kimi-3-seminar-recording</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-seminars-2026-kimi-3-seminar-recording</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Thu, 20 Aug 2026 14:22:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!L8wb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-videos-seminars-2026">Seminar Series 2026</a></h3><ol><li><p><a href="https://www.byhand.ai/p/manifold-constrained-hyper-connections">Manifold-Constrained Hyper Connections (mHC) from DeepSeek (Jan 9, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/how-small-models-learn-tool-use">How Small Models Learn Tool Use (Jan 11, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/introduction-to-gen-ai">Generative AI (Jan 11, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/seminar-foundation-attention-to-frontier">Attention (Jan 15, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/google-ironwood-tpu-from-bits-to">Google Ironwood TPU: From Bits to HBM (Jan 19, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/ai-eval-equations-you-must-know">9 AI Eval Formulas You Must Know (Jan 24, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/meta-superintelligence-labs-vs-facebook">Meta Superintelligence Labs vs Facebook AI Research (Jan 30, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/transformer-six-levels-of-understanding">Transformer: Six Levels of Understanding (Feb 13, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/openclaw-seminar">OpenClaw Seminar (Feb 23, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/recording-ppo-dpo-grpo-rubrics">PPO &#8594; DPO &#8594; GRPO &#8594; Rubrics (Mar 2, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/gemma-4-seminar-recording">Gemma 4 (May 7, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/qwen-3-6-seminar-recording">Qwen 3.6 (May 21, 2026)</a></p></li><li><p><strong>Kimi 3 (Aug 6, 2026)</strong></p></li></ol></div><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L8wb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L8wb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></div></figure></div><p>Thank you to everyone who joined the Frontier AI Seminar on Kimi 3.</p><p>It has been a while since I gave the last seminar on Qwen. Happy to get together with many of you again to study frontier model math and architecture by hand in Excel!</p><p>We are blessed with <a href="https://x.com/natolambert">Nathan Lambert</a>, the author of <a href="https://www.interconnects.ai">Interconnects</a>, some of the most authoritative writing on open models, as a special guest. Nathan also wrote the <a href="https://rlhfbook.com">RLHF book</a> which has just been <a href="https://www.manning.com/books/the-rlhf-book">published by Manning</a>.</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OKF-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OKF-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1456w" sizes="100vw"></picture><div></div></div></div></figure></div><p>Here are some of my favorite moments:</p><ul><li><p>Nathan shared his behind-the-scenes story about his trip to Moonshot AI.</p></li><li><p>Nathan's famous dog Phoebe had a surprise appearance on camera.</p></li><li><p>I got to finally talk about Linear Transformer line of frontier model advances.</p></li><li><p>I got to mention LeBron James in my explanation of the attention mechanism.</p></li></ul><p>Thanks for your feedback!</p><div class="captioned-image-container"><figure><div class="image-link image2" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2y-t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2y-t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></div></figure></div><p>Before the summer, I did plan to talk about Linear Transformer line and wanted to use NVIDIA Nemotron as the backdrop. However, when Kimi 3 was released, I found an even stronger storyline, one where I can track the evolution much further from Linear Attention, DeltaNet, to the latest Kimi Delta Attention (KDA).</p><h2>Outline</h2><ol><li><p>Interview and Discussion</p><ul><li><p>Nathan Lambert</p></li><li><p>Moonshot AI Tour</p></li><li><p>Open vs Closed Models</p></li><li><p>Audience Q&amp;A</p></li></ul></li><li><p>Kimi 3 by Hand</p><ul><li><p>Attention</p></li><li><p>Quadratic Attention</p></li><li><p>Inference and KV Cache</p></li><li><p>Local Attention</p></li><li><p>Linear Attention</p></li><li><p>DeltaNet</p></li><li><p>Kimi Delta Attention (KDA)</p></li><li><p>Convolution and Gating</p></li><li><p>Chunkwise Parallel Computation</p></li><li><p>Seq2Seq LSTM</p></li></ul></li></ol><h2>Recording &amp; Workbook</h2><p><em>Limited-time free: the full recording and the Excel workbook are open to everyone for now.</em></p><div id="youtube2-d1O_hQQUe7s" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;d1O_hQQUe7s&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/d1O_hQQUe7s?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/seminars-2026/kimi-3-seminar-recording/Kimi3.xlsx">&#11015; Excel Workbook</a></p>]]></content:encoded></item><item><title><![CDATA[Context Problems]]></title><description><![CDATA[Agentic AI by hand &#9997;&#65039;]]></description><link>https://www.byhand.ai/p/library-series-agents-context</link><guid isPermaLink="false">https://www.byhand.ai/p/library-series-agents-context</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 05:20:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zPTv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is the second workbook in the series, and the one I promised at the end of the first. That one was about tokens: what they are, how to count them, what they cost. This one is about where they go.</p><p>Every model has a context window, and every window is a budget. These problems ask you to spend it. You will mark out a window and fill it turn by turn, work out whether the next message still fits, and count how many turns you get before it does not. Then retrieval arrives and takes its share, and you will see what a single retrieved document does to the turns you had left.</p><p>Halfway through, the window runs out and you have to decide what to do about it. Dropping the oldest turn is the simple answer, and problem 10 asks what that costs you. Compaction is the better one, and five problems work through what it spends, when to reach for it, and what survives.</p><p>The last five changed how I think about long conversations. A stateless API resends the entire context every turn. Add that up across a session and the cost is not the length of the conversation, it is the square of it. You will do the addition by hand, which is the only way I know to make that number feel real.</p><p>Twenty problems again. Bring a pen.</p><h3><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">1. The Context Window</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zPTv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Context Window&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Context Window" title="The Context Window" srcset="https://substackcdn.com/image/fetch/$s_!zPTv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">2. Window Occupancy</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Window Occupancy&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-fills-the-window&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Window Occupancy" title="Window Occupancy" srcset="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">3. Growth per Turn</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-turn-by-turn" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qxNW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Growth per Turn&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-turn-by-turn&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Growth per Turn" title="Growth per Turn" srcset="https://substackcdn.com/image/fetch/$s_!qxNW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">4. Remaining Space</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-will-it-fit" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m-g8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Remaining Space&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-will-it-fit&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Remaining Space" title="Remaining Space" srcset="https://substackcdn.com/image/fetch/$s_!m-g8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">5. Turn Budget</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-turns-until-full" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1Qng!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Turn Budget&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-turns-until-full&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Turn Budget" title="Turn Budget" srcset="https://substackcdn.com/image/fetch/$s_!1Qng!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">6. Retrieval Footprint</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-chunking-a-document" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nSnf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval Footprint&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-chunking-a-document&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Retrieval Footprint" title="Retrieval Footprint" srcset="https://substackcdn.com/image/fetch/$s_!nSnf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">7. Retrieval per Turn</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kh_e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval per Turn&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Retrieval per Turn" title="Retrieval per Turn" srcset="https://substackcdn.com/image/fetch/$s_!kh_e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">8. Search Rounds</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ap9A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Search Rounds&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-three-rounds-of-search&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Search Rounds" title="Search Rounds" srcset="https://substackcdn.com/image/fetch/$s_!ap9A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">9. Window Sizing</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-sizing-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P9h2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Window Sizing&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-sizing-the-window&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Window Sizing" title="Window Sizing" srcset="https://substackcdn.com/image/fetch/$s_!P9h2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">10. Truncation</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2m11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2m11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Truncation&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Truncation" title="Truncation" srcset="https://substackcdn.com/image/fetch/$s_!2m11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2m11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">11. Compaction</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-compacting-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1rUo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Compaction&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-compacting-the-window&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Compaction" title="Compaction" srcset="https://substackcdn.com/image/fetch/$s_!1rUo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">12. The Compaction Bill</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YIIa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Compaction Bill&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-compaction-costs&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Compaction Bill" title="The Compaction Bill" srcset="https://substackcdn.com/image/fetch/$s_!YIIa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">13. Compacted Retrieval</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0yAg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Compacted Retrieval&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Compacted Retrieval" title="Compacted Retrieval" srcset="https://substackcdn.com/image/fetch/$s_!0yAg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">14. The Compaction Threshold</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-when-to-compact" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ylAh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Compaction Threshold&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-when-to-compact&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Compaction Threshold" title="The Compaction Threshold" srcset="https://substackcdn.com/image/fetch/$s_!ylAh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">15. Verbatim Tail</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6YFH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Verbatim Tail&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-compaction-keeps&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Verbatim Tail" title="Verbatim Tail" srcset="https://substackcdn.com/image/fetch/$s_!6YFH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">16. Stateless API</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W79S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W79S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Stateless API&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-each-turn-sends&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Stateless API" title="Stateless API" srcset="https://substackcdn.com/image/fetch/$s_!W79S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W79S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">17. Retrieval Cost</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!al4O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!al4O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval Cost&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Retrieval Cost" title="Retrieval Cost" srcset="https://substackcdn.com/image/fetch/$s_!al4O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!al4O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">18. Context Tax</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Context Tax&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-paying-for-the-past&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Context Tax" title="Context Tax" srcset="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">19. Quadratic Cost</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yqn7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Quadratic Cost&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-adding-up-the-turns&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Quadratic Cost" title="Quadratic Cost" srcset="https://substackcdn.com/image/fetch/$s_!yqn7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">20. Cost Forecast</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-a-long-conversation" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fy4P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Cost Forecast&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-a-long-conversation&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Cost Forecast" title="Cost Forecast" srcset="https://substackcdn.com/image/fetch/$s_!fy4P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Cost Forecast]]></title><description><![CDATA[Budgeting a Long Session]]></description><link>https://www.byhand.ai/p/library-agents-context-a-long-conversation</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-a-long-conversation</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:51:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hKqy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dae594e-e8a2-47eb-951b-454357a44c25_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><strong>Cost Forecast</strong></p></li></ol></div><p>One turn's input grows by a fixed step, so the tenth turn sends ten times what the first did. That much is a straight line. But the bill is not the last turn, it is every turn added together, and adding up a straight line gives a curve. That is why doubling the length of a conversation does not double what it costs to run, it roughly quadruples it. The output never joins that curve. It is the same size every turn, so adding it up stays a straight line, and the input half of the bill runs away from it however dearly the output is priced.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Quadratic Cost]]></title><description><![CDATA[Adding Up the Turns]]></description><link>https://www.byhand.ai/p/library-agents-context-adding-up-the-turns</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-adding-up-the-turns</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:51:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Uf7S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ddcb2d-a9e7-418d-90ca-faeb0872c7e7_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><strong>Quadratic Cost</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Adding four numbers is easy. Adding a hundred is not, and a conversation does not stop at four. The input goes up by the same step every turn, and a run of numbers like that has an equation: multiply the number of turns by the next number up, halve it, then scale by the step. Work the small case by hand first, then check the equation against what you got. Two numbers decide the total: k, what one turn adds, and n, how many turns there have been. k is fixed by the agent, so shortening its answers drops every total, while n is the conversation itself, and because it appears twice, doubling it does not double the total.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>