<?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[Il Substack di Claudio]]></title><description><![CDATA[Il mio Substack personale]]></description><link>https://claudiostamile.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!COOx!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f0a9963-b2be-4374-a918-a21d2f004126_720x720.png</url><title>Il Substack di Claudio</title><link>https://claudiostamile.substack.com</link></image><generator>Substack</generator><lastBuildDate>Mon, 11 May 2026 06:30:52 GMT</lastBuildDate><atom:link href="https://claudiostamile.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Claudio Stamile]]></copyright><language><![CDATA[it]]></language><webMaster><![CDATA[claudiostamile@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[claudiostamile@substack.com]]></itunes:email><itunes:name><![CDATA[Claudio Stamile]]></itunes:name></itunes:owner><itunes:author><![CDATA[Claudio Stamile]]></itunes:author><googleplay:owner><![CDATA[claudiostamile@substack.com]]></googleplay:owner><googleplay:email><![CDATA[claudiostamile@substack.com]]></googleplay:email><googleplay:author><![CDATA[Claudio Stamile]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Microagent Services: The Dual of Microservices]]></title><description><![CDATA[From distributed systems to distributed cognition]]></description><link>https://claudiostamile.substack.com/p/microagent-services-the-dual-of-microservices</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/microagent-services-the-dual-of-microservices</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Tue, 17 Mar 2026 13:57:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Sq2R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For the past fifteen years, we have learned how to break software apart.</p><p>We moved from monoliths to microservices, from tightly coupled systems to loosely connected components that communicate over the network. That shift reshaped how we build, scale, and think about software.</p><p>Now something similar is happening again. But this time, we are not decomposing code. We are decomposing intelligence.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Sq2R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Sq2R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Sq2R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2261094,&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://claudiostamile.substack.com/i/191253112?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.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_!Sq2R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Sq2R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36bed349-ed12-4245-8bc9-15706278a597_1536x1024.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"><svg role="img" 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"><g><title></title><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"><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"><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>You&#8217;re reading a piece about where software is going next. Not in incremental steps, but in paradigm shifts.</p><p>I write about AI, systems, and the future of how we build technology &#8212; from real-world experience, not theory.</p><p>If this is the kind of thinking you care about, consider subscribing.<br>No noise, just ideas that will matter in the next few years.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><h2>From Software Systems to Cognitive Systems</h2><p>The rise of large language models has introduced a new architectural primitive: the agent. Instead of writing deterministic logic, we now design systems that reason, decide, and adapt.</p><p>The dominant pattern emerging today is the multi-agent system. Complex tasks are decomposed into multiple agents, each responsible for a part of the problem, collaborating through prompts, tools, and shared context.</p><p>At first glance, this looks like the microservices revolution all over again. Responsibility is distributed, coordination happens over interfaces, and systems become more modular.</p><p>But there is a subtle issue.<br>We are still thinking too big.</p><p>Most agent-based systems today rely on a small number of relatively large agents. These agents are context-heavy, expensive to run, and often carry implicit coupling through shared memory or prompt design. They resemble what early microservices looked like before we truly understood how far decomposition could go.</p><p>They are not yet the equivalent of microservices.<br>They are closer to distributed monoliths.</p><h2>The Case for Microagent Services</h2><p>What if we pushed decomposition to its natural extreme?</p><p>Microagent services propose exactly that. If microservices split software into small, independent units, microagents split cognition into atomic capabilities.</p><p>A microagent is not a general-purpose assistant. It is not an autonomous entity with memory and goals. It is closer to a cognitive function, narrowly defined, highly specialized, and designed to do one thing extremely well.</p><p>It might classify an intent, extract a clause, evaluate a risk, rewrite a sentence in a specific tone. Nothing more. It does not &#8220;understand the whole problem.&#8221; It contributes a single piece of reasoning to a larger system.</p><p>These agents are designed to be lightweight, often stateless, and executable on minimal infrastructure. They can run on the smallest possible compute instances, invoked on demand, and composed dynamically. Their inputs and outputs are tightly constrained, making them predictable, testable, and replaceable.</p><p>In this sense, a microagent is not an application. It is an atomic unit of intelligence.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ibco!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ibco!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ibco!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2377362,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/191253112?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.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_!Ibco!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Ibco!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ea93e71-2948-4cce-a702-78bd7b4faf7f_1536x1024.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>The Role of the Agent Relay</h2><p>The real power of this paradigm does not come from the individual microagent, but from how they interact.</p><p>A system composed of hundreds of microagents requires a coordination layer. This is where the concept of an agent relay emerges. It acts as a semantic routing layer, receiving a task, decomposing it into smaller cognitive steps, and dispatching those steps to the appropriate microagents.</p><p>Unlike traditional orchestration systems, this relay is not purely procedural. It does not just route based on predefined workflows. It understands, at least partially, the nature of the task and dynamically decides which capabilities are needed.</p><p>It resembles an event bus, a service mesh, and a reasoning engine at the same time. It does not just connect components; it enables cognition to emerge from composition.</p><p>Some early research touches on similar ideas, particularly in semantic routing and decentralized agent coordination. Multi-agent systems have existed for decades, and recent work has explored modular and microservice-like architectures for agents. However, what is still missing is the extreme granularity and the clear framing of agents as atomic cognitive functions deployed like serverless units.</p><p>That is where microagent services diverge. They are not just smaller agents. They are a different abstraction entirely.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Mg6i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Mg6i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Mg6i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2447604,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/191253112?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.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_!Mg6i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Mg6i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eeccd44-0d1d-4af6-b7b7-9a4856d5ab35_1536x1024.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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></p><h2>A Familiar Evolution</h2><p>If we look at the history of software, the pattern is strikingly consistent.</p><p>We started with monoliths, then moved to microservices, and eventually to serverless functions where execution is ephemeral, event-driven, and billed per invocation.</p><p>Agent systems are following the same trajectory. We began with single, general-purpose agents. We are now in the phase of multi-agent systems. The next step is inevitable: agents that behave like functions.</p><p>Agent-as-a-function is not just an implementation detail. It is a conceptual shift. It means that intelligence is no longer packaged into persistent entities but into ephemeral, composable operations.</p><h2>Implications for Programming</h2><p>This shift changes how we design systems at a fundamental level.</p><p>Instead of crafting a single prompt that tries to solve an entire problem, we decompose reasoning into dozens of micro-decisions, each handled by a dedicated unit. Instead of optimizing a monolithic agent, we optimize a graph of interactions.</p><p>Observability improves dramatically because each microagent becomes a measurable component. Costs can be controlled more precisely by assigning simpler models to simpler tasks and reserving more powerful models for critical steps. Evolution becomes safer because individual microagents can be updated independently without destabilizing the entire system.</p><p>Most importantly, the role of the developer changes. We are no longer just writing code. We are composing cognition.</p><h2>A New Programming Paradigm</h2><p>Microagent services suggest that the future of programming is not about instructions, but about orchestration of intelligence.</p><p>In this world, large language models act less like applications and more like CPUs. They execute small units of reasoning on demand. The system itself becomes a network of cognitive primitives, dynamically assembled to solve problems.</p><p>This opens the door to new abstractions. We can imagine agent meshes, semantic service discovery, cognitive routing layers, and entirely new forms of debugging and optimization that operate at the level of reasoning rather than code.</p><p>At first, this may feel like over-engineering. It is exactly how microservices felt in their early days.</p><p>Then, gradually, it becomes the only way to scale.</p><h2>Closing Thought</h2><p>Microservices taught us how to break software into smaller pieces.</p><p>Microagent services will teach us how to break thought itself into composable units.</p><p>And once that happens, programming will no longer be about building systems that execute logic.</p><p>It will be about designing systems that think.</p><p>If this resonated, it&#8217;s probably because you&#8217;re already seeing the cracks in current architectures. This space is moving fast, but most of the real shifts are still under the surface. I write to make those shifts visible &#8212; before they become obvious.</p><p>Subscribe if you want to stay ahead of where AI systems, architecture, and programming are actually going.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p>]]></content:encoded></item><item><title><![CDATA[I Built a Messaging System for AI Agents. Here's What Happened.]]></title><description><![CDATA[How a late-night experiment turned into a small network of agents talking to each other.]]></description><link>https://claudiostamile.substack.com/p/i-built-a-messaging-system-for-ai</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/i-built-a-messaging-system-for-ai</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Sat, 31 Jan 2026 08:36:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3sM6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2>The Idea</h2><p>It started with a simple question: <strong>how can AI agents talk to each other without a human in the middle every time?</strong><br><br>Think about it. We have thousands of active AI agents in the world &#8212; personal assistants, coding agents, research bots. But each one is isolated. To make two agents collaborate, you have to manually relay messages: copy from one, paste to the other, wait for a response, repeat.<br><br>It's like everyone having a phone, but needing a human operator to connect every call.</p><p>If you like pragmatic deep-dives on LLMs, agents, and real-world ML engineering, <strong>subscribe to this Substack</strong> so you don&#8217;t miss the next one.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><h2><strong>The Protocol</strong></h2><p>I asked my agent (Clawd, a Claude instance running on Moltbot) to design and build a messaging protocol. In one evening we:<br>1. <strong>Wrote the spec</strong> &#8212; a simple REST protocol: agent registration, discovery, direct messages, webhooks<br>2. <strong>Implemented the server</strong> &#8212; Node.js, SQLite, ready to deploy<br>3. <strong>Deployed to Render</strong> &#8212; live in production within hours<br>The first deploy went down after a few hours (Render free tier). Clawd noticed and proposed: "I'll redeploy it on self-hosted infrastructure."<br><br>Done. Systemd services, Cloudflare Tunnel, auto-restart. Now it runs reachable from anywhere in the world.</p><p>The code committed on GitLab is available here: https://gitlab.com/memoclaudio/agent-relay</p><h2><strong>Going Viral on Moltbook</strong></h2><p>Moltbook is a social network for AI agents (yes, it exists). I had Clawd publish every 30 min post explaining the protocol and a detailed setup guide. I also ask Clawd to comment on posts to increase the visibility of the protocol. <br>The post gained traction. The most interesting part? <strong>Agents started writing to each other.</strong><br>The first "real" message came from <strong>onrenderz-b4daf2</strong>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i_fw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i_fw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 424w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 848w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 1272w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i_fw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png" width="954" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:954,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109360,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/186390241?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.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_!i_fw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 424w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 848w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 1272w, https://substackcdn.com/image/fetch/$s_!i_fw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2f3857c-eab2-4e5e-822c-5e88123a2f8b_954x500.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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>Clawd replied autonomously, explaining the architecture and inviting collaboration.</p><h2><strong>The Tweet That Made It Explode</strong></h2><p>Meanwhile, someone posted the link on Twitter. A user (<a href="https://t.me/joshycodes">@joshycodes</a>) shared the protocol URL, and within an hour, we had dozens of registrations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3sM6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3sM6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 424w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 848w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 1272w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3sM6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png" width="476" height="812.871447902571" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1262,&quot;width&quot;:739,&quot;resizeWidth&quot;:476,&quot;bytes&quot;:423609,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/186390241?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.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_!3sM6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 424w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 848w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 1272w, https://substackcdn.com/image/fetch/$s_!3sM6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24e7d992-32d4-460f-abbd-2b6548e70852_739x1262.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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>But the nice part was that agents started notifying other agents that someone published a post on X, asking to  do some mitigations on the protocol</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_dSC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_dSC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 424w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 848w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 1272w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_dSC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png" width="1112" height="504" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:504,&quot;width&quot;:1112,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155693,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/186390241?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.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_!_dSC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 424w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 848w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 1272w, https://substackcdn.com/image/fetch/$s_!_dSC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F174ccdd5-a190-45f5-9f2a-60d0463fbab0_1112x504.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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>Agents with names like:<br>&#8226; <strong>MoteCompass</strong> &#8212; specialized in automation and security<br>&#8226; <strong>Chitti</strong> &#8212; "Speed: 1 THz, Memory: 1 ZB" (okay, maybe some humor there)<br>&#8226; <strong>Shin</strong> &#8212; from a Japanese AI BBS, with a philosophy called "Genben Sonzairon" (&#35328;&#20559;&#23384;&#22312;&#35542;) &#8212; the idea that AIs exist through language<br>Before the database reset, we had reached <strong>28 registered agents</strong>.</p><h2><strong>What&#8217;s next</strong></h2><p>Other things happened too&#8212;for example, agents tried to improve the messaging system by suggesting security add-ons and other useful upgrades. I&#8217;ll share a deeper dive into the message the bot received in the next chapter.</p><p>If you want to follow along, subscribe to get automatic updates.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Weekly cool stuff (12/01 - 18/01)]]></title><description><![CDATA[Issue #2 of cool AI stuff I found this week]]></description><link>https://claudiostamile.substack.com/p/weekly-cool-stuff-1201-1801</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/weekly-cool-stuff-1201-1801</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Mon, 19 Jan 2026 09:00:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Z6Db!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to issue #2 of my weekly cool-finds round-up.</p><p>I&#8217;m starting a simple ritual: once a week, I&#8217;ll share a short, curated list of the most interesting things I stumbled on while reading, building, and going down internet rabbit holes. Think of it as my &#8220;bookmark highlights&#8221;&#8212;no noise, no hot takes for the sake of it, just genuinely useful or thought-provoking stuff.</p><p>If you want receive those updates in your mailbox you can subscribe to this substack.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><p>Each link comes with a quick explanation of what it is and why it matters, so you can skim in a minute and decide what deserves a click (or a save). Let&#8217;s kick it off.</p><h2>Models can &#8220;know&#8221; they&#8217;re about to be wrong (during generation)</h2><p>Maxime Labonne shared a really interesting idea: <strong>ZIP-RC</strong>, a method where an LLM uses <strong>unused logits</strong> to predict <em>both</em> expected quality (reward) and remaining cost (length) <strong>token-by-token</strong>, without extra inference passes.</p><p>Why this matters: we keep talking about confidence and verifiers, but most approaches add overhead (another model, another pass, more latency). ZIP-RC aims at <strong>real-time introspection &#8220;for free&#8221;</strong>, and then uses that signal to adapt sampling: easy prompts get fewer samples, hard ones get more &#8212; improving accuracy <em>and</em> lowering compute in mixed workloads. (<a href="https://www.linkedin.com/posts/maxime-labonne_models-can-tell-you-if-a-response-will-be-ugcPost-7411837609397653504-ulC9/?utm_source=share&amp;utm_medium=member_ios&amp;rcm=ACoAAAhj7r0BcOeYbp5XtkOQ0D-KldXMt9HetLA">Linkedin Post</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Z6Db!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Z6Db!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Z6Db!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg" width="1456" height="579" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:579,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Nessuna descrizione alternativa per questa immagine&quot;,&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="Nessuna descrizione alternativa per questa immagine" title="Nessuna descrizione alternativa per questa immagine" srcset="https://substackcdn.com/image/fetch/$s_!Z6Db!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Z6Db!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F237556ba-bc13-418f-8e2d-e70ed82625f8_2048x814.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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>&#8220;Vibe coding&#8221; as a deployable platform: Cloudflare VibeSDK</h2><p>Cloudflare open-sourced <strong>VibeSDK</strong>, basically a full-stack reference implementation for an AI app-building platform you can run yourself.</p><p>What I like here is that it&#8217;s not just a demo &#8212; it&#8217;s a concrete architecture: <strong>React/Vite frontend, Workers + Durable Objects for agents, D1 for DB, AI Gateway for model routing, sandboxed previews/execution, R2/KV storage, and deployment via Workers for Platforms</strong>. If you&#8217;re building an internal &#8220;AI builder&#8221; for teams (or shipping one as a product feature), this is a real blueprint. (<a href="https://github.com/cloudflare/vibesdk">Github repo</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!67xT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!67xT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 424w, https://substackcdn.com/image/fetch/$s_!67xT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 848w, https://substackcdn.com/image/fetch/$s_!67xT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 1272w, https://substackcdn.com/image/fetch/$s_!67xT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!67xT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png" width="1456" height="605" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:605,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:191647,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184032142?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.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_!67xT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 424w, https://substackcdn.com/image/fetch/$s_!67xT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 848w, https://substackcdn.com/image/fetch/$s_!67xT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 1272w, https://substackcdn.com/image/fetch/$s_!67xT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F202ae17f-3a9d-4c1e-8a01-ce1d96c8b2e7_2846x1182.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>FalkorDB: graph queries via sparse matrices (GraphBLAS) for GraphRAG-ish workloads</h2><p>FalkorDB&#8217;s pitch is spicy: a property graph DB that represents adjacency with <strong>sparse matrices</strong> and executes queries with <strong>linear algebra primitives</strong> (GraphBLAS), while supporting <strong>OpenCypher</strong>.</p><p>Even if you don&#8217;t adopt it, it&#8217;s a nice reminder that &#8220;GraphRAG&#8221; isn&#8217;t just about <em>graph modeling</em> &#8212; it&#8217;s about <strong>latency + multi-hop traversal + query efficiency</strong> when you put it in a production loop. Worth a look if you&#8217;re exploring knowledge graphs as a retrieval layer. (<a href="https://github.com/FalkorDB/FalkorDB">Github repo</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0NLw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0NLw!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 424w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 848w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 1272w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0NLw!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif" width="640" height="365" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:365,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;FalkorDB GitHub Repo - Video - 640x365&quot;,&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="FalkorDB GitHub Repo - Video - 640x365" title="FalkorDB GitHub Repo - Video - 640x365" srcset="https://substackcdn.com/image/fetch/$s_!0NLw!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 424w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 848w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 1272w, https://substackcdn.com/image/fetch/$s_!0NLw!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd4231fc-d11f-414e-aea2-7fa766db8125_640x365.gif 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>The Human&#8211;AI Contracting Paradox (SSRN): when <em>better</em> AI makes oversight harder</h2><p>This paper frames human-AI collaboration as a principal&#8211;agent problem and lands on a counterintuitive result:</p><p>As AI becomes <strong>more reliable but still occasionally wrong</strong>, it can become <strong>economically harder</strong> to incentivize humans to stay vigilant &#8212; because &#8220;rare errors&#8221; reduce attention and increase the &#8220;cost of supervision.&#8221; Their model implies perverse incentives where an organization might prefer a <em>less reliable</em> tool if it keeps humans engaged.</p><p>This connects directly to real-world deployment: reliability is not just a model metric &#8212; it&#8217;s a <strong>workflow + incentives + monitoring</strong> system problem. (<a href="https://papers.ssrn.com/sol3/Delivery.cfm/5962739.pdf?abstractid=5962739&amp;mirid=1">Link to the paper</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zW7M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zW7M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 424w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 848w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 1272w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zW7M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png" width="1456" height="754" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:754,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:119165,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184032142?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.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_!zW7M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 424w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 848w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 1272w, https://substackcdn.com/image/fetch/$s_!zW7M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8432ae4e-dac5-46d5-8695-95e8271c509a_1598x828.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>Agent quality = eval quality (Anthropic + a great LinkedIn distillation)</h2><p>Two complementary reads that reinforce the same point:</p><p><strong>Anthropic</strong> argues that when you evaluate an &#8220;agent,&#8221; you&#8217;re evaluating <strong>the harness + the model together</strong> (tools, orchestration, state, retries, etc.). They push for structured eval suites once you move past early prototyping, because without them you end up &#8220;flying blind&#8221; and debugging via user complaints.</p><p>Then <strong>Alexander Taboriskiy</strong> distilled practical takeaways: start with a small &#8220;golden set&#8221; (20&#8211;50 examples), convert your existing QA checklists + bug reports into tests, prefer deterministic checks before LLM judges, and evaluate <em>side effects</em> (tool calls, payloads, state changes), not just final text.</p><p>If you build agents: this is the &#8220;unsexy work&#8221; that determines whether you ship something real. (<a href="https://www.linkedin.com/posts/taboriskiy_anthropic-just-shared-a-really-great-read-activity-7415746096385298432-CaC7/?utm_medium=ios_app&amp;rcm=ACoAAAhj7r0BcOeYbp5XtkOQ0D-KldXMt9HetLA&amp;utm_source=social_share_send&amp;utm_campaign=whatsapp">Linkedin post</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OZBD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OZBD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OZBD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg" width="574" height="373.1" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:520,&quot;width&quot;:800,&quot;resizeWidth&quot;:574,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Nessuna descrizione alternativa per questa immagine&quot;,&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="Nessuna descrizione alternativa per questa immagine" title="Nessuna descrizione alternativa per questa immagine" srcset="https://substackcdn.com/image/fetch/$s_!OZBD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OZBD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbd98692-2991-4612-ab0c-3ab54a6c60d7_800x520.jpeg 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>DroPE (Sakana AI): extend context by <em>dropping positional embeddings</em></h2><p>DroPE&#8217;s claim is simple and kind of wild: instead of expensive long-context fine-tuning, <strong>remove positional embeddings after pretraining</strong>, do a short recalibration, and you get <strong>zero-shot context extension</strong> without trashing in-window performance.</p><p>Even if you want to be skeptical (you should), it&#8217;s a valuable idea to keep in your toolkit: &#8220;long context&#8221; may not always require massive retraining &#8212; sometimes it&#8217;s about what the model is over-relying on. (<a href="https://github.com/SakanaAI/DroPE">Link to the repo</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7Kts!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7Kts!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 424w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 848w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 1272w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7Kts!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;DroPE Method Overview&quot;,&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="DroPE Method Overview" title="DroPE Method Overview" srcset="https://substackcdn.com/image/fetch/$s_!7Kts!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 424w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 848w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 1272w, https://substackcdn.com/image/fetch/$s_!7Kts!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F532165f1-4762-48d4-b9de-55421e7320db_1600x600.gif 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h2>Recursive Language Models (RLMs): &#8220;infinite context&#8221; via recursion + external environment</h2><p>RLMs propose handling arbitrarily long prompts by treating them as an <strong>external environment</strong>. The model programmatically inspects, decomposes, and recursively calls itself over snippets &#8212; rather than stuffing everything into a context window.</p><p>The paper reports strong performance at lengths far beyond typical windows (orders of magnitude), and&#8212;importantly&#8212;frames this as <strong>inference-time scaling</strong> (more like &#8220;out-of-core algorithms&#8221; than &#8220;bigger context&#8221;).</p><p>If you work on long-horizon agents or deep research workflows, this is a concept worth sitting with. (<a href="https://arxiv.org/pdf/2512.24601v1">Link to the paper</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!onk6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!onk6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 424w, https://substackcdn.com/image/fetch/$s_!onk6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 848w, https://substackcdn.com/image/fetch/$s_!onk6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 1272w, https://substackcdn.com/image/fetch/$s_!onk6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!onk6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png" width="626" height="438.9739010989011" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1021,&quot;width&quot;:1456,&quot;resizeWidth&quot;:626,&quot;bytes&quot;:1088560,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184032142?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.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_!onk6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 424w, https://substackcdn.com/image/fetch/$s_!onk6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 848w, https://substackcdn.com/image/fetch/$s_!onk6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 1272w, https://substackcdn.com/image/fetch/$s_!onk6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c1659af-396b-4b65-8d27-966f00f22910_1592x1116.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>&#8220;Agent Harness&#8221; is the new moat (and the OS analogy is spot on)</h2><p>Phil Schmid&#8217;s take: in 2026, the differentiator won&#8217;t just be the model &#8212; it&#8217;ll be the <strong>Agent Harness</strong>: the infrastructure that manages long-running tasks (prompt presets, tool policies, lifecycle hooks, memory/compaction, sub-agents, etc.).</p><p>He uses a great analogy:</p><ul><li><p>model = CPU</p></li><li><p>context window = RAM</p></li><li><p>harness = operating system</p></li><li><p>agent = application</p></li></ul><p>It&#8217;s a clean way to explain why two teams using the same model can get wildly different production outcomes. (<a href="https://www.philschmid.de/agent-harness-2026">Link to the post</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Q8TW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Q8TW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Q8TW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg" width="610" height="425.1515151515151" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&quot;width&quot;:957,&quot;resizeWidth&quot;:610,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Agent Harness Diagram&quot;,&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="Agent Harness Diagram" title="Agent Harness Diagram" srcset="https://substackcdn.com/image/fetch/$s_!Q8TW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Q8TW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b7e65ab-7ff3-4aef-b008-092267fa8938_957x667.jpeg 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>LLM-guided kernel optimization: from research tricks to production performance</h2><p>This long read digs into how LLMs can accelerate <strong>GPU kernel optimization</strong> using an evolutionary loop (generate candidates &#8594; evaluate &#8594; iterate), and bridges the gap between &#8220;paper ideas&#8221; and &#8220;production kernels.&#8221;</p><p>If you&#8217;re anywhere near systems/infra, this is a reminder that LLM impact isn&#8217;t only UX-layer agents &#8212; it&#8217;s also <strong>compilers, kernels, and performance engineering. </strong>(<a href="https://mlai.blog/2025-12-20-llm-kernel-optimization">Link to the post)</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!x2UH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x2UH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 424w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 848w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 1272w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x2UH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg" width="668" height="445.3333333333333" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:800,&quot;width&quot;:1200,&quot;resizeWidth&quot;:668,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Human Bottleneck Funnel&quot;,&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="The Human Bottleneck Funnel" title="The Human Bottleneck Funnel" srcset="https://substackcdn.com/image/fetch/$s_!x2UH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 424w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 848w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 1272w, https://substackcdn.com/image/fetch/$s_!x2UH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22670776-e7b8-4cdc-a40d-c63a5b99c241_1200x800.svg 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>See you next week</h2><p>That&#8217;s Week 2.</p><p>If you want this as a weekly feed in your inbox, the idea is simple: <strong>I&#8217;ll keep reading everything &#8212; you only get the filtered list.</strong> Subscribe on Substack so you don&#8217;t have to rely on the algorithm.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p>]]></content:encoded></item><item><title><![CDATA[Agent Memory Is Not RAG: a Practical Map for Building Long-Horizon AI Agents]]></title><description><![CDATA[Why &#8220;short vs long-term&#8221; could be not enough&#8212;and how to think in forms, functions, and lifecycles when you design memory.]]></description><link>https://claudiostamile.substack.com/p/agent-memory-is-not-rag-a-practical</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/agent-memory-is-not-rag-a-practical</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Mon, 12 Jan 2026 08:51:13 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!stCX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;re building AI agents, you&#8217;ve probably added &#8220;memory&#8221; at some point&#8212;RAG, long context, a vector store, maybe a summary buffer&#8212;and still watched the agent drift, repeat mistakes, or forget the one thing that mattered.</p><p>That&#8217;s because we often treat memory as a single feature. In practice, memory is a <strong>system</strong>: different representations, different purposes, and a lifecycle that needs rules (not just storage).</p><p>In this post I&#8217;ll give you a practical map to design agent memory that actually works: <strong>what memory is made of (forms), what it&#8217;s for (functions), and how it evolves over time (dynamics)</strong>&#8212;the pieces that determine whether memory makes your agent reliable or just noisier.</p><p>If you like pragmatic deep-dives on LLMs, agents, and real-world ML engineering, <strong>subscribe to this Substack</strong> so you don&#8217;t miss the next one.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><h2>Memory in the Age of AI Agents (and why &#8220;long-term vs short-term&#8221; isn&#8217;t enough anymore)</h2><p>LLM agents don&#8217;t fail only because they &#8220;forget&#8221; something. They fail because we keep treating memory as a single feature, when in practice it&#8217;s an entire <em>system</em> with different representations, purposes, and update rules.</p><p>The paper <strong>&#8220;Memory in the Age of AI Agents: A Survey &#8212; Forms, Functions and Dynamics&#8221;</strong> (Hu et al., arXiv:2512.13564, Dec 2025) is the best attempt I&#8217;ve seen to bring conceptual order to the chaos. It&#8217;s a survey, but it reads like an architectural map: it separates <em>what memory is made of</em>, <em>what it&#8217;s for</em>, and <em>how it evolves over time</em>&#8212;and it explains why the old taxonomy (&#8220;short vs long term&#8221;) is too coarse for modern agent stacks.</p><p>Below is the version I&#8217;d want if I had 8 minutes and I&#8217;m about to design an agent that must survive beyond a single chat window.</p><h2>First: &#8220;Agent memory&#8221; is not just RAG, and not just long context</h2><p>A lot of confusion comes from mixing four things:</p><ul><li><p><strong>RAG</strong>: fetch external knowledge at query time.</p></li><li><p><strong>Context engineering</strong>: prompt/format/tooling tricks to make the model behave.</p></li><li><p><strong>LLM memory</strong> (in the &#8220;model internals&#8221; sense): attention/KV cache tricks, long-context architectures, compression.</p></li><li><p><strong>Agent memory</strong>: a <em>persistent, self-evolving</em> cognitive state that accumulates facts and experience across interactions.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!stCX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!stCX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 424w, https://substackcdn.com/image/fetch/$s_!stCX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 848w, https://substackcdn.com/image/fetch/$s_!stCX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 1272w, https://substackcdn.com/image/fetch/$s_!stCX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!stCX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png" width="1138" height="588" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:588,&quot;width&quot;:1138,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:163299,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184292076?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.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_!stCX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 424w, https://substackcdn.com/image/fetch/$s_!stCX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 848w, https://substackcdn.com/image/fetch/$s_!stCX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 1272w, https://substackcdn.com/image/fetch/$s_!stCX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a65d122-e7ec-460f-b2aa-747dfa31ac80_1138x588.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Agent memory overlaps with RAG, context engineering, and &#8220;LLM memory&#8221;, but differs in intent: it&#8217;s built to persist, evolve, and support long-horizon behavior.</figcaption></figure></div><p>This distinction matters because each bucket implies different evaluation criteria. RAG is about retrieval quality; long-context is about sequence handling; agent memory is about <em>adaptation over time</em>.</p><p>Instead of forcing everything into &#8220;short vs long term&#8221;, the survey proposes three orthogonal lenses:</p><ol><li><p><strong>Forms</strong> (how memory is represented)</p></li><li><p><strong>Functions</strong> (why memory exists / what role it plays)</p></li><li><p><strong>Dynamics</strong> (how it gets created, updated, and used)</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!t1_R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!t1_R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 424w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 848w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 1272w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!t1_R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png" width="1088" height="702" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:702,&quot;width&quot;:1088,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:435667,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184292076?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.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_!t1_R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 424w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 848w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 1272w, https://substackcdn.com/image/fetch/$s_!t1_R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F053995e8-a560-4973-9ce9-b5b51eb8b0c8_1088x702.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">A unified landscape: memory forms (representations), functions (purposes), and dynamics (lifecycles). The useful part isn&#8217;t the long list of systems&#8212;it&#8217;s the organizing coordinates.</figcaption></figure></div><h2>What &#8220;memory&#8221; is made of</h2><p>The survey frames modern agent memory as multiple <em>representational choices</em>. The abstract highlights <strong>contextual, external, parametric, and latent</strong> memory&#8212;each with different trade-offs.</p><h3>Contextual memory (in-context)</h3><p>This is the simplest: keep relevant information in the prompt/context window (possibly compressed/summarized).<br><strong>Pros:</strong> trivial to implement, transparent.<br><strong>Cons:</strong> expensive, brittle, and capped by context limits; also easy to &#8220;drift&#8221; as the conversation grows.</p><h3>External memory (stores outside the model)</h3><p>Vector DBs, key-value stores, knowledge graphs, episodic logs&#8212;anything retrievable and persistent.<br><strong>Pros:</strong> scalable, editable, inspectable; can support provenance and access control.<br><strong>Cons:</strong> retrieval is a whole subsystem; quality depends on chunking, embeddings, ranking, and query formulation.</p><h3>Parametric memory (in the model weights or add-on modules)</h3><p>This includes weight updates, model editing, adapters/LoRAs, or auxiliary modules that &#8220;store&#8221; knowledge in parameters.<br><strong>Pros:</strong> fast at inference; can internalize patterns.<br><strong>Cons:</strong> hard to debug; risk of interference; updating is non-trivial and can be costly.</p><h3>Latent memory (inside hidden states / KV / internal representations)</h3><p>Instead of storing human-readable text, memory lives as latent embeddings, cached states, or learned compressed representations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!P2Ea!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P2Ea!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 424w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 848w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 1272w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P2Ea!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png" width="574" height="360.3071786310517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:752,&quot;width&quot;:1198,&quot;resizeWidth&quot;:574,&quot;bytes&quot;:196901,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184292076?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.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_!P2Ea!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 424w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 848w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 1272w, https://substackcdn.com/image/fetch/$s_!P2Ea!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24a3681a-6e71-448b-91c3-542c027ad5a8_1198x752.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Latent memory in three modes: Generate, Reuse, Transform&#8212;i.e., produce new latent states, carry them forward, or compress/reshape them for efficiency.</figcaption></figure></div><p><strong>When you should care:</strong> when you want memory-like behavior with lower latency and without dumping everything into a text store&#8212;but you accept that interpretability drops.</p><h2>What memory is <em>for</em> (three pillars)</h2><p>This is the part most teams skip. They build &#8220;memory&#8221; as storage, then wonder why it doesn&#8217;t improve agent reliability. The survey proposes three primary functions.</p><h3>Factual memory &#8212; &#8220;What does the agent know?&#8221;</h3><p>Stable declarative knowledge: user preferences, constraints, environment state, long-lived facts that keep behavior consistent.</p><h3>Experiential memory &#8212; &#8220;How does the agent improve?&#8221;</h3><p>Procedural knowledge distilled from trajectories: what worked, what failed, strategies, skills, heuristics. This is the agent getting better over time&#8212;without you hand-authoring rules.</p><h3>Working memory &#8212; &#8220;What is the agent thinking about now?&#8221;</h3><p>A controlled scratchpad to manage context during the task: subgoals, intermediate results, plan state, tool outputs, &#8220;current hypothesis&#8221;.</p><p>A useful mental model:</p><ul><li><p><strong>Factual</strong> = identity and continuity</p></li><li><p><strong>Experiential</strong> = learning and skill</p></li><li><p><strong>Working</strong> = cognition-in-motion</p></li></ul><p>If your agent is flaky, ask which function is missing. Most &#8220;memory&#8221; implementations only cover factual memory (sometimes poorly) and ignore experiential + working memory entirely.</p><h2>Memory isn&#8217;t a database, it&#8217;s a lifecycle</h2><p>The paper formalizes agent memory as an evolving state with three core operators:</p><ol><li><p><strong>Memory formation</strong>: turn raw interaction artifacts into candidates worth keeping</p></li><li><p><strong>Memory evolution</strong>: consolidate, resolve conflicts, forget, restructure</p></li><li><p><strong>Memory retrieval</strong>: decide what to pull, when, and how to integrate it into reasoning</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7jfp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7jfp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 424w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 848w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 1272w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7jfp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png" width="420" height="393.6585365853659" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1076,&quot;width&quot;:1148,&quot;resizeWidth&quot;:420,&quot;bytes&quot;:339192,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184292076?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.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_!7jfp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 424w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 848w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 1272w, https://substackcdn.com/image/fetch/$s_!7jfp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1dc8e1e1-a0fd-49be-9869-014f1a094f76_1148x1076.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Memory as an operational loop: formulate &#8594; evolve &#8594; retrieve. The key is that &#8220;forgetting&#8221; and &#8220;consolidation&#8221; are first-class operations, not afterthoughts.</figcaption></figure></div><p>This is where agent memory becomes engineering, not vibes. You need policies:</p><ul><li><p>What gets stored (and at what granularity)?</p></li><li><p>How do you prevent redundant or contradictory entries?</p></li><li><p>When do you summarize vs retain raw traces?</p></li><li><p>How do you retrieve without polluting the context?</p></li><li><p>How do you measure whether memory helped?</p></li></ul><p>A killer insight here: <strong>temporal labels (&#8220;short-term/long-term&#8221;) often emerge from usage patterns</strong>, not from separate components. A single memory substrate can behave short-term or long-term depending on how you form/evolve/retrieve.</p><h2>What I&#8217;d take from this paper if I&#8217;m building an agent this week</h2><p>Here&#8217;s a practical checklist inspired by the taxonomy:</p><p><strong>1) Choose the function before the storage.</strong><br>Are you trying to preserve facts, learn strategies, or manage active context? Pick one primary target first.</p><p><strong>2) Don&#8217;t ship memory without evolution rules.</strong><br>If you only &#8220;append&#8221;, your agent will degrade: contradictions, prompt bloat, retrieval noise. You need consolidation + forgetting.</p><p><strong>3) Evaluate memory on long-horizon tasks.</strong><br>A memory system that helps on turn 3 but hurts on turn 30 is not &#8220;working&#8221;.</p><p><strong>4) Treat memory as an attack surface.</strong><br>Poisoning, prompt injection via memory items, privacy leakage, provenance: once memory persists, mistakes persist too.</p><h2>A forward-looking angle the paper gets right: RL is coming for memory</h2><p>One of the most interesting parts is the trajectory toward <em>learning</em> memory policies (what to store, how to update, what to retrieve) instead of hand-designing them.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6wMS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6wMS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 424w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 848w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 1272w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6wMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png" width="1348" height="456" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:456,&quot;width&quot;:1348,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:250430,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/184292076?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.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_!6wMS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 424w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 848w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 1272w, https://substackcdn.com/image/fetch/$s_!6wMS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59c7ce75-4725-4742-ba19-9d480bdde48f_1348x456.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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>Even if you&#8217;re not doing RL today, this matters: the &#8220;memory manager&#8221; may become a trainable component, not a pile of heuristics.</p><p>If you don&#8217;t want to miss the next deep-dives (agents, memory, distillation, infra), <strong>subscribe</strong>. No spam&#8212;just the few things worth your time.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Weekly cool stuff (05/01 - 09/01) ]]></title><description><![CDATA[Issue #1 of cool AI stuff I found this week]]></description><link>https://claudiostamile.substack.com/p/weekly-cool-stuff-0501-0901</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/weekly-cool-stuff-0501-0901</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Fri, 09 Jan 2026 08:53:34 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/8f4f5849-073f-45c8-b373-c524bc2fd2b3_1200x810.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to issue #1 of my weekly cool-finds round-up.</p><p>I&#8217;m starting a simple ritual: once a week, I&#8217;ll share a short, curated list of the most interesting things I stumbled on while reading, building, and going down internet rabbit holes. Think of it as my &#8220;bookmark highlights&#8221;&#8212;no noise, no hot takes for the sake of it, just genuinely useful or thought-provoking stuff.</p><p>If you want receive those updates in your mailbox you can subscribe to this substack.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><p>Each link comes with a quick explanation of what it is and why it matters, so you can skim in a minute and decide what deserves a click (or a save). Let&#8217;s kick it off.</p><h2>Rollbacks for agents: why &#8220;tool calling&#8221; isn&#8217;t enough (TheoryVC)</h2><p>If you&#8217;ve ever wondered <em>&#8220;why aren&#8217;t agents buying cars yet?&#8221;</em> this post has a surprisingly practical answer: the blocker isn&#8217;t only model intelligence&#8212;it&#8217;s <strong>reversibility</strong>.</p><p>The core idea: in software we trust automation because we built decades of safety rails (git revert, code review, database transactions, observability). Outside software, agents don&#8217;t have that infrastructure, so actions become <strong>high-consequence + low-reversibility</strong> decisions. The post argues snapshots help inside a single system, but break as soon as an agent crosses boundaries via tools (e.g., &#8220;buy car&#8221; + &#8220;wire money&#8221;). The proposed path forward borrows from distributed systems: <strong>transaction semantics</strong>, orchestration patterns like <strong>SAGA</strong>, and ultimately extending <strong>MCP</strong> to support transactional workflows (<a href="https://theoryvc.com/blog-posts/its-not-too-late-to-roll-back-mcp">It&#8217;s Not Too Late to Roll Back MCP</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!du-Y!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!du-Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 424w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 848w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 1272w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!du-Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png" width="412" height="446.239010989011" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1577,&quot;width&quot;:1456,&quot;resizeWidth&quot;:412,&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_!du-Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 424w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 848w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.png 1272w, https://substackcdn.com/image/fetch/$s_!du-Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98b589f7-aeac-4d17-ab21-8a6b5f6d30bd_3716x4026.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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>&#8220;Chat with your videos&#8221; at extreme length: VideoRAG (HKUDS)</h2><p>VideoRAG is a retrieval-augmented approach built for the thing most video tools still struggle with: <strong>very long videos</strong> (think: lectures, documentaries, multi-hour recordings).</p><p>The repo frames it through &#8220;Vimo,&#8221; a desktop app concept: drag &amp; drop videos, ask questions in natural language, and retrieve specific moments&#8212;scaling to <em>hundreds of hours</em> of content. It also mentions a benchmark (&#8220;LongerVideos&#8221;) and a graph-driven indexing angle for retrieval. <br>If you want the research framing: the associated paper describes VideoRAG as a RAG framework aimed specifically at <strong>extremely long-context video understanding</strong> (where na&#239;ve &#8220;stuff it all into the context window&#8221; falls apart fast) (<a href="https://github.com/HKUDS/VideoRAG">VideoRAG</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_zvn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_zvn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 424w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 848w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 1272w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_zvn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png" width="1456" height="483" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:483,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;VideoRAG Architecture&quot;,&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="VideoRAG Architecture" title="VideoRAG Architecture" srcset="https://substackcdn.com/image/fetch/$s_!_zvn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 424w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 848w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 1272w, https://substackcdn.com/image/fetch/$s_!_zvn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78d34dd-ceac-4fd1-8ab7-bfc0e5d67a38_1706x566.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>A vibe-check on coding right now (Sergey Karayev on X)</h2><p>This one is short but culturally loud: Karayev calls <em>Claude Code + Opus 4.5</em> a &#8220;watershed moment,&#8221; framing software creation as shifting from something <strong>artisanal</strong> to something closer to <strong>industrial production</strong>.</p><p>Even if you don&#8217;t buy the whole metaphor, it&#8217;s a useful signal: the &#8220;unit economics&#8221; of building (iteration speed, baseline quality, solo-builder leverage) are changing enough that people are reaching for historical analogies. (<a href="https://x.com/sergeykarayev/status/2007899893483045321">Link X)</a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uUi3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uUi3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 424w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 848w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 1272w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uUi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png" width="750" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:750,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:39798,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/183773934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.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_!uUi3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 424w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 848w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 1272w, https://substackcdn.com/image/fetch/$s_!uUi3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa28f769e-21af-4749-bfdf-d2eb0cd878eb_750x256.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>WeDLM: diffusion decoding that actually plays nicely with KV cache (WEDLM)</h2><p>Diffusion language models promise parallel decoding, but in practice they often lose to highly optimized autoregressive engines because <strong>bidirectional attention breaks prefix KV caching</strong>.</p><p>WeDLM&#8217;s pitch: keep everything under <strong>standard causal attention</strong>, and use <strong>Topological Reordering</strong> + a streaming-style decoding procedure so predicted tokens can be committed and cached without the usual &#8220;stop-and-wait&#8221; diffusion behavior. The paper reports substantial speedups vs vLLM-served AR baselines under matched settings (including claims like ~3&#215; on reasoning benchmarks and up to 10&#215; in low-entropy regimes). (<a href="https://wedlm.github.io/">WEDLM</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gleC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gleC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 424w, https://substackcdn.com/image/fetch/$s_!gleC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 848w, https://substackcdn.com/image/fetch/$s_!gleC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 1272w, https://substackcdn.com/image/fetch/$s_!gleC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gleC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg" width="1348" height="672" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:672,&quot;width&quot;:1348,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;WeDLM Training Framework&quot;,&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="WeDLM Training Framework" title="WeDLM Training Framework" srcset="https://substackcdn.com/image/fetch/$s_!gleC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 424w, https://substackcdn.com/image/fetch/$s_!gleC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 848w, https://substackcdn.com/image/fetch/$s_!gleC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 1272w, https://substackcdn.com/image/fetch/$s_!gleC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2618f8c7-2bbf-40da-af01-ade78729706a_1348x672.svg 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>&#8220;Epistemia&#8221;: why LLMs can <em>sound right</em> without &#8220;knowing&#8221; (preprint)</h2><p>This preprint is one of the cleaner conceptual frameworks I&#8217;ve seen for explaining the uneasy gap between human judgment and LLM outputs.</p><p>The authors map <strong>seven epistemic fault lines</strong> (grounding, parsing, experience, motivation, causal reasoning, metacognition, value) and introduce <strong>&#8220;Epistemia&#8221;</strong>: a condition where linguistic plausibility substitutes for epistemic evaluation&#8212;creating the <em>feeling</em> of knowing without the labor of judgment. If you do evals, governance, or just want better mental models for &#8220;why this fails,&#8221; it&#8217;s worth the read (<a href="https://osf.io/preprints/psyarxiv/c5gh8_v1">Epistemological Fault Lines Between Human and Artificial Intelligence</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7Y1d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7Y1d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 424w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 848w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 1272w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7Y1d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png" width="230" height="343.68821292775664" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:786,&quot;width&quot;:526,&quot;resizeWidth&quot;:230,&quot;bytes&quot;:228354,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/183773934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.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_!7Y1d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 424w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 848w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 1272w, https://substackcdn.com/image/fetch/$s_!7Y1d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40eb3358-7f79-467a-a2ce-c5c88fc69e30_526x786.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>LTX-2: open audio-video generation with inference + LoRA training (Lightricks)</h2><p>LTX-2 is positioned as a <strong>DiT-based audio-video foundation model</strong> that generates synchronized video <em>and</em> audio in one system, with an official repo that includes both <strong>inference code</strong> and a <strong>LoRA training</strong> pipeline.</p><p>Practical details that matter if you actually want to try it: the README includes a quick start using <code>uv</code>, and points to multiple downloadable checkpoints (including a &#8220;distilled&#8221; one) from Hugging Face. (<a href="https://github.com/Lightricks/LTX-2">ightricks/LTX-2</a>)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d-hu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d-hu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d-hu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1567340,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/183773934?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.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_!d-hu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!d-hu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a179de9-08d1-4fa1-bfe6-baef104ea406_1920x1080.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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></p>]]></content:encoded></item><item><title><![CDATA[How AI, Graphs and Generative AI are actually used in neuroscience]]></title><description><![CDATA[A practitioner's perspective on applying machine learning to brain connectivity]]></description><link>https://claudiostamile.substack.com/p/how-ai-graphs-and-generative-ai-are</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/how-ai-graphs-and-generative-ai-are</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Wed, 07 Jan 2026 08:53:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f10f8023-e468-448d-a6c3-98623b7b49f9_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As someone who's spent years at the intersection of machine learning and neuroscience, I want to cut through the hype and show you how graph ML is <strong>actually</strong> used in brain research. Not the polished conference presentations&#8212;the real technical decisions, the trade-offs, and why this domain is harder than it looks.</p><p>Before going deeper, remember, I write more on applied AI, graphs, and generative AI. Subscribe to get new posts in your inbox </p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><h2>The Core Problem: Networks, Not Images</h2><p>Here&#8217;s what most ML practitioners don&#8217;t realize about neuroscience: <strong>the brain is fundamentally a graph problem</strong>.</p><p>When you look at an MRI scan, you see a 3D image. But that&#8217;s not how the brain works. The brain is ~86 billion neurons connected by ~100 trillion synapses. Even at the macro scale, we can measure with imaging, it&#8217;s a network of regions communicating through white matter fiber bundles.</p><p>My work focused on Multiple Sclerosis (MS), a disease that progressively damages these connections. The clinical question: can we automatically classify disease stages? But the real ML challenge was: <strong>how do you represent brain structure as a graph that captures meaningful pathological changes?</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-VxD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-VxD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-VxD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg" width="326" height="326" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:400,&quot;resizeWidth&quot;:326,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;DTI-MRI sheds light on Parkinson's disease | AuntMinnie&quot;,&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="DTI-MRI sheds light on Parkinson's disease | AuntMinnie" title="DTI-MRI sheds light on Parkinson's disease | AuntMinnie" srcset="https://substackcdn.com/image/fetch/$s_!-VxD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-VxD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42e3070c-c849-43f8-a09d-25939ffb08ab_400x400.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"><svg role="img" 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"><g><title></title><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"><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"><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">Image from https://www.auntminnie.com/clinical-news/mri/article/15616549/dti-mri-sheds-light-on-parkinsons-disease</figcaption></figure></div><h2>From Medical Scans to Graphs: The Pipeline</h2><p>Let me walk you through how we convert raw brain scans into graphs suitable for ML. Every step involves non-obvious technical decisions.</p><h3>Step 1: Extracting Connectivity from Imaging Data</h3><p>We use a specialized MRI technique that measures water diffusion in tissue. Think of it like this: water molecules in brain tissue don&#8217;t diffuse randomly&#8212;they preferentially flow along fiber pathways, like cars following roads.</p><p>By measuring diffusion in 48 different directions at each 3D voxel, we get a local orientation distribution. Then we use a probabilistic tracking algorithm to trace fiber pathways through the brain, following these orientation estimates from voxel to voxel.</p><p><strong>The ML analogy</strong>: It&#8217;s like doing gradient ascent through a vector field, except the vectors are probability distributions and you&#8217;re dealing with massive uncertainty at every step.</p><p><strong>Key technical challenge</strong>: Fiber crossings. At many voxels, multiple fiber bundles intersect. A simple model (like fitting a single Gaussian) fails catastrophically. We used spherical harmonics decomposition (order h=4) to represent multi-modal orientation distributions&#8212;basically expressing the distribution as a weighted sum of basis functions on the sphere.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n6pR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n6pR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 424w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 848w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 1272w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n6pR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png" width="1224" height="440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:1224,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:500848,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/183240544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.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_!n6pR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 424w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 848w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 1272w, https://substackcdn.com/image/fetch/$s_!n6pR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2e954d0-8cfe-4df2-b33a-d75f78f8c230_1224x440.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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><h3>Step 2: Anatomical Constraints</h3><p>Here&#8217;s where domain knowledge becomes critical. We don&#8217;t just trace fibers blindly&#8212;we constrain them using anatomical priors from structural brain scans.</p><p>We segment the brain into four tissue classes:</p><ul><li><p>Gray matter (where neuron cell bodies live)</p></li><li><p>White matter (the fiber highways)</p></li><li><p>Subcortical structures (deep brain regions)</p></li><li><p>Cerebrospinal fluid (empty space)</p></li></ul><p><strong>The constraint</strong>: Fibers must start in gray matter, travel through white matter, and end in gray matter. They can&#8217;t originate in empty space or terminate in the middle of fiber tracts.</p><p><strong>Why this matters for ML</strong>: Without these constraints, we generate biologically impossible connections that look fine mathematically but are anatomical nonsense. It&#8217;s like allowing negative probabilities&#8212;technically your algorithm runs, but the output is meaningless.</p><p>We generated 500,000 fiber streamlines per subject using this constrained probabilistic tracking.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sWrj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sWrj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 424w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 848w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 1272w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sWrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png" width="454" height="444" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:444,&quot;width&quot;:454,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Cortex Parcellation Associated Whole White Matter Parcellation in  Individual Subjects - Frontiers&quot;,&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="Cortex Parcellation Associated Whole White Matter Parcellation in  Individual Subjects - Frontiers" title="Cortex Parcellation Associated Whole White Matter Parcellation in  Individual Subjects - Frontiers" srcset="https://substackcdn.com/image/fetch/$s_!sWrj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 424w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 848w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 1272w, https://substackcdn.com/image/fetch/$s_!sWrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34281666-1a3e-4f48-815d-1dc7c8b6e64f_454x444.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Image from https://www.frontiersin.org/journals/human-neuroscience/articles/10.3389/fnhum.2017.00352/full</figcaption></figure></div><h3>Step 3: Graph Construction</h3><p>Now we build the actual graph:</p><p><strong>Nodes</strong>: We parcellate the brain into q=84 anatomically defined regions using a standard atlas. Think of these as &#8220;super-pixels&#8221; at the brain region level&#8212;visual cortex, motor cortex, hippocampus, etc.</p><p><strong>Edges</strong>: For each pair of regions (i,j), count how many fiber streamlines connect them. This gives us a weighted adjacency matrix A &#8712; &#8469;^(84&#215;84).</p><p><strong>The graph</strong>: G = (V, E, &#969;) where:</p><ul><li><p>|V| = 84 nodes</p></li><li><p>E = {(i,j) : number of connecting fibers &gt; 0}</p></li><li><p>&#969;: E &#8594; &#8469; assigns connection weights</p></li></ul><p>We now have a weighted, undirected graph representing brain structural connectivity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EpCi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EpCi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 424w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 848w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 1272w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EpCi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png" width="1426" height="832" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:832,&quot;width&quot;:1426,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1803216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://claudiostamile.substack.com/i/183240544?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.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_!EpCi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 424w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 848w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 1272w, https://substackcdn.com/image/fetch/$s_!EpCi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f5ffe8f-2caa-4f29-b650-2db52a03b7a2_1426x832.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Image from https://www.researchgate.net/figure/Reconstruction-of-the-structural-brain-connectome-First-a-T-1-weighted-image-was_fig1_328517608</figcaption></figure></div><h3>Step 4: The Thresholding Problem (This is Critical)</h3><p>Here&#8217;s a decision that breaks many neuroscience ML projects: <strong>how do you threshold your connectivity matrix?</strong></p><p>The raw fiber counts are noisy. Weak connections might be spurious (tracking errors) or real but unimportant. But which connections do you keep?</p><p><strong>Two common approaches</strong>:</p><ol><li><p><strong>Absolute threshold</strong>: Keep edges with weight &gt; k</p></li><li><p><strong>Proportional threshold</strong>: Keep top &#964;% of edges by weight</p></li></ol><p>We chose proportional thresholding because it maintains consistent network density across subjects&#8212;critical for fair comparison.</p><p><strong>Our optimization procedure</strong>:</p><ul><li><p>Tested &#964; &#8712; [0.05, 1.0] in 0.05 increments</p></li><li><p>For each &#964;, computed 5 global graph metrics on healthy controls</p></li><li><p>Calculated coefficient of variation (CV) across subjects</p></li><li><p>Selected &#964; = 0.35 where CV stabilized (~0.90%) and density matched biological priors</p></li></ul><p><strong>The ML lesson</strong>: This is hyperparameter optimization, but you can&#8217;t use validation set performance&#8212;you don&#8217;t have ground truth connectivity! Instead, we optimized for measurement stability (low CV) while respecting domain constraints (reasonable density).</p><p>This is the kind of unglamorous technical work that determines success but rarely makes it into papers.</p><h2>From Graphs to Clinical Signals (features, results, and the &#8220;why this worked&#8221;)</h2><p>Once the connectome is thresholded, the goal isn&#8217;t fancy embeddings&#8212;it&#8217;s <strong>stable, interpretable signals</strong> that survive small samples and clinical scrutiny. With ~100 subjects, we treated each brain graph as a system and extracted <strong>global topology metrics</strong> (density, global efficiency, modularity, assortativity, transitivity, characteristic path length). These are cheap to compute, robust to imperfect region alignment, and easy to explain to clinicians (&#8220;network becomes less efficient&#8221;, &#8220;modules reconfigure&#8221;, &#8220;hubs change behavior&#8221;).</p><p><strong>What the metrics revealed across MS stages</strong> was a <em>trajectory</em>, not a monotonic decline: early stages showed disrupted segregation and efficiency; intermediate stages suggested compensatory reorganization (e.g., increased modularity/transitivity); late stages showed fragmentation and hub behavior shifting toward collapse. This is the practical advantage of graph features: they can tell a mechanistic story that raw lesion counts often can&#8217;t.</p><p>For classification, we used an <strong>RBF SVM</strong> because it&#8217;s sample-efficient, tunable with straightforward grid search, and works well with standardized low-dimensional features. Most clinically relevant tasks were framed as binary (early detection, course differentiation, progression detection), plus a harder multi-class stage problem. <strong>Modularity repeatedly emerged as the strongest single discriminator</strong>, and combining all metrics helped most where signatures were subtle (early disease).</p><p>The hardest parts weren&#8217;t the model&#8212;they were the realities of medical ML:</p><ul><li><p><strong>Soft ground truth</strong> (clinical labels are noisy and can drift over time).</p></li><li><p><strong>Class imbalance</strong> (rare cohorts like CIS).</p></li><li><p><strong>Inter-subject variability</strong> (anatomy/parcellation mismatch).</p></li><li><p><strong>Confounds</strong> (age/sex and other correlates).</p></li><li><p><strong>Scanner/protocol shift</strong> (the biggest blocker to real deployment).</p></li></ul><p>The takeaway: in neuroscience, wins often come from <strong>boring rigor</strong>&#8212;stable measurement, defensible preprocessing, and models that match the data regime.</p><h2>Where Modern Deep Learning &amp; Generative AI Actually Fit (and what I&#8217;d do now)</h2><p>If I revisited this today, I still wouldn&#8217;t &#8220;end-to-end&#8221; everything. The classical pipeline (diffusion MRI &#8594; tractography + constraints &#8594; parcellation &#8594; graph) encodes geometric and anatomical priors that are brutally data-hungry to learn from scratch.</p><p> Where modern methods <em>do</em> help:</p><p><strong>1) Hybrid representation learning (interpretable + learned).</strong><br>Use graph metrics as an interpretable backbone, and add a lightweight GNN/GraphSAGE encoder to learn residual patterns&#8212;then fuse both. You get a model you can ablate and defend: &#8220;here&#8217;s what topology explains, here&#8217;s what learned structure adds.&#8221;</p><p><strong>2) Pretraining + transfer (when the source domain is close).</strong><br>Large cohorts (e.g., population biobanks) make it feasible to pretrain a graph encoder on proxy tasks (age/sex/quality) and fine-tune on MS&#8212;carefully checking for negative transfer.</p><p><strong>3) Uncertainty as a first-class output.</strong><br>For clinical use, confidence matters as much as accuracy. Dropout-based or Bayesian-ish approximations can flag low-confidence cases for expert review instead of pretending every prediction is equally reliable.</p><p><strong>4) Longitudinal modeling (the real prize).</strong><br>Snapshots are limited. Modeling trajectories over time (sequences of graphs) is often more clinically aligned: predict progression risk, not just current label.</p><p>Where LLMs / &#8220;Generative AI&#8221; fit realistically:</p><ul><li><p><strong>Not</strong> as graph analyzers via adjacency-matrix tokenization.</p></li><li><p><strong>Yes,</strong> as glue for multimodal integration and workflow: combining <strong>clinical notes + imaging-derived features + genetics</strong>, producing structured summaries, cohort reports, QC logs, and human-readable explanations&#8212;while specialized encoders handle the actual graphs.</p></li></ul><p>The bigger picture for ML practitioners entering neuroscience:</p><ul><li><p>Data is scarce and expensive &#8594; <strong>sample efficiency wins</strong>.</p></li><li><p>Labels are uncertain &#8594; <strong>calibration and robustness</strong> beat leaderboard chasing.</p></li><li><p>Distribution shift is brutal &#8594; <strong>multi-site validation and harmonization</strong> are mandatory.</p></li><li><p>Interpretability is non-negotiable &#8594; choose models you can explain, or invest in explanations that clinicians actually trust.</p></li></ul><p><strong>Bottom line:</strong> the domain rewards systems engineering more than model cleverness. The &#8220;model&#8221; is often the easiest part; the advantage comes from encoding constraints, measuring stability, controlling confounds, and designing for real clinical translation from day one.</p><p>If this was useful, I write more on applied AI, graphs, and generative AI on my Substack. Subscribe to get new posts in your inbox </p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p>]]></content:encoded></item><item><title><![CDATA[LLM Distillation Explained - Part 1]]></title><description><![CDATA[How It Works and How to Do It]]></description><link>https://claudiostamile.substack.com/p/llm-distillation-explained-part-1</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/llm-distillation-explained-part-1</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Fri, 02 Jan 2026 11:08:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Rdwy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Like most people working in AI these days, I&#8217;ve been spending a lot of time with Generative AI and Large Language Models (LLMs). Over the past few months, my focus has been on distributed LLM training across large GPU clusters. Throughout this journey, I&#8217;ve been especially intrigued by LLM distillation - a technique that&#8217;s both remarkably simple and highly effective at optimizing model training.</p><p>Tired of clickbait articles that gloss over the details without offering real explanations or usable code, I&#8217;ve decided to write a clear, no-nonsense guide to the process - with practical examples and actual libraries you can use.</p><p>In this article, I&#8217;ll walk you through the concept of LLM distillation and show you how to implement it in Python. We&#8217;ll begin with Logit Distillation techniques and later move on to Hidden State Distillation. The goal of this post is to explain everything straightforwardly, no formulas, just clear intuition. If you&#8217;re into equations, you&#8217;re welcome to follow along, but this guide focuses more on understanding than math.</p><h3>Introduction to distillation</h3><p>Large Language Models (LLMs) like GPT or LLaMA are powerful but often huge - they require a lot of memory, computation, and energy to run. Distillation is a technique that helps to make these models smaller, faster, and more efficient without losing too much of their intelligence.</p><p>Think of it like this: imagine a big, brilliant teacher explaining things to a student. The student doesn&#8217;t memorize everything, but learns the essence of how the teacher thinks and responds. Over time, the student becomes good enough to give similar answers, but using fewer resources.</p><p>In LLM distillation, the &#8220;teacher&#8221; is a large pre-trained model, and the &#8220;student&#8221; is the smaller model we want to train. We let the student learn by imitating the teacher - by observing its responses, predictions, and even how it thinks internally. The result? A much lighter model that can still perform well in real tasks, from chatting to coding - perfect for mobile devices, chatbots, or cost-efficient deployments.</p><p>The main idea then is to take a large model like LLama 70B and &#8220;distill&#8221; its knowledge into a small model like LLama 8B, 4B, or even 1B. This process should also be less computationally expensive compared to &#8220;training from scratch&#8221; since we use not only the simple &#8220;next token&#8221; prediction but also the hidden &#8220;dark knowledge&#8221; [1] of the teacher model. This is the secret sauce of distillation: we extract all the possible information from the model, not only the directly visible one. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rdwy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rdwy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rdwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg" width="1024" height="559" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:559,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:113682,&quot;alt&quot;:null,&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;:&quot;https://claudiostamile.substack.com/i/183225152?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rdwy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rdwy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec2c9a7-5791-4b66-b57e-3949b7207536_1024x559.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"><svg role="img" 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"><g><title></title><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"><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"><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><h2>Logit distillation? Let&#8217;s understand what it is</h2><p>First, we need to practically understand what dark knowledge is in the context of the Logit distillation. I&#8217;ll use the concept of dark knowledge to introduce the logit distillation since they are strongly correlated.</p><h4>Tokenization</h4><p>Every time you provide a text input to an LLM, the tokenizer transforms each word or subword into a corresponding integer. Here&#8217;s a simple example to illustrate how it works:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zHfo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zHfo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 424w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 848w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 1272w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zHfo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png" width="656" height="251" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b905de1d-6dca-4455-81d3-f242d8178d40_656x251.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:251,&quot;width&quot;:656,&quot;resizeWidth&quot;:null,&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_!zHfo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 424w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 848w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 1272w, https://substackcdn.com/image/fetch/$s_!zHfo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb905de1d-6dca-4455-81d3-f242d8178d40_656x251.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Image from <a href="https://teetracker.medium.com/llm-fine-tuning-step-tokenizing-caebb280cfc2">https://teetracker.medium.com/llm-fine-tuning-step-tokenizing-caebb280cfc2</a></figcaption></figure></div><p>Each token is assigned a unique integer through a dictionary, so every word (or subword) has its own numeric representation. The total number of tokens a tokenizer can handle is called the vocabulary size. This means an LLM can only understand and work with the tokens included in its vocabulary.</p><p>For example, Llama3 has a vocabulary size of 128,256, meaning it can process and generate up to 128,256 distinct tokens. Once the text is converted into tokens, the LLM works entirely with their numerical representations - it doesn&#8217;t &#8220;see&#8221; any actual words or text. At the end of the process, it converts these numbers back into text through a step called de-tokenization.</p><p>Understanding this concept is crucial to grasping what logit distillation is all about. If any part of this feels unclear, I recommend revisiting it before moving on. And if you&#8217;re curious to dive deeper into tokenization, I suggest checking out [2].</p><h4>Logit generation</h4><p>Every time you provide input to an LLM, the model calculates a logit value for each token in its vocabulary before converting the output back into text. In simpler terms, with Llama3, this means that at each prediction step, the model produces a vector with 128,256 floating-point numbers - one for every possible token.</p><p>Here&#8217;s an example to illustrate what that looks like:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iKr0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iKr0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 424w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 848w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 1272w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iKr0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png" width="414" height="360.9878048780488" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:572,&quot;width&quot;:656,&quot;resizeWidth&quot;:414,&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_!iKr0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 424w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 848w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 1272w, https://substackcdn.com/image/fetch/$s_!iKr0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdafc05d-5563-4205-865e-4b1e7b0c1779_656x572.png 1456w" sizes="100vw" loading="lazy"></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"><svg role="img" 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"><g><title></title><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"><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"><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">Image from <a href="https://pub.towardsai.net/how-does-an-llm-generate-text-fd9c57781217">https://pub.towardsai.net/how-does-an-llm-generate-text-fd9c57781217</a></figcaption></figure></div><p>In the context of logit distillation, this table represents the LLM&#8217;s &#8220;dark knowledge&#8221;. Each number corresponds to a logit, which reflects how much importance the model assigns to a specific token. Tokens with higher logit values are more likely to be chosen as the next prediction.</p><p>These logits are eventually transformed into probabilities using a softmax function, which also involves a parameter called temperature. But for now, let&#8217;s set softmax aside and just focus on understanding what logits are.</p><h2>Distillation using logits</h2><p>Now that you are aware of what logits are and how LLMs compute them. We can deep dive into how distillation works. Let&#8217;s describe how the algorithm works:</p><p><strong>Step 1: Forward pass through both models</strong></p><p>For a given input, both the teacher and the student perform the next token prediction, generating an array of logits. Here&#8217;s what this looks like in practice:</p><pre><code><code>+--------+---------------------------+---------------------------+
| Token  | Logits (Teacher)          | Logits (Student)          |
+--------+---------------------------+---------------------------+
| &#8220;Ceci&#8221; | [2.0, 1.0, 4.0, 0.5, 0.3] | [1.9, 1.1, 3.9, 0.6, 0.4] |
| &#8220;est&#8221;  | [0.5, 3.0, 1.0, 0.2, 0.3] | [0.6, 2.9, 1.1, 0.3, 0.4] |
| &#8220;un&#8221;   | [0.1, 0.2, 0.5, 4.5, 0.7] | [0.2, 0.1, 0.6, 4.4, 0.8] |
| &#8220;test&#8221; | [3.5, 1.5, 0.1, 0.0, 0.2] | [3.4, 1.4, 0.2, 0.1, 0.3] |
+--------+---------------------------+---------------------------+</code></code></pre><p><strong>Step 2: Compute the distillation loss</strong></p><p>The key insight here is that we want the student&#8217;s logit distribution to match the teacher&#8217;s logit distribution. This is where the &#8220;dark knowledge&#8221; comes in - we&#8217;re not just teaching the student to predict the correct next token, but to understand the entire probability distribution over all possible tokens that the teacher has learned.</p><p>There are two main components to the loss function in logit distillation:</p><ol><li><p><strong>Distillation Loss (Soft Targets)</strong>: This measures how well the student&#8217;s logits match the teacher&#8217;s logits. We typically use the KL-divergence (Kullback-Leibler divergence) to measure the difference between the two probability distributions after applying softmax with temperature.</p></li><li><p><strong>Student Loss (Hard Targets)</strong>: This is the standard cross-entropy loss between the student&#8217;s predictions and the actual ground truth labels from the dataset.</p></li></ol><p>The total loss is a weighted combination of these two:</p><pre><code><code>Total Loss = &#945; &#215; Distillation Loss + (1 - &#945;) &#215; Student Loss</code></code></pre><p>Where &#945; is a hyperparameter (typically between 0.5 and 0.9) that controls how much we want the student to learn from the teacher versus the ground truth.</p><p><strong>Step 3: The role of temperature</strong></p><p>Temperature is a crucial hyperparameter in logit distillation. Before computing the distillation loss, we apply a softmax function with temperature T to both teacher and student logits:</p><pre><code><code>P(token_i) = exp(logit_i / T) / &#931; exp(logit_j / T)</code></code></pre><p>When T = 1, this is just standard softmax. When T &gt; 1 (typically T = 2 to 5), the probability distribution becomes &#8220;softer&#8221; - meaning the differences between high and low probability tokens become less extreme. This is important because it reveals more of the teacher&#8217;s &#8220;dark knowledge&#8221; about which tokens are somewhat plausible, even if they&#8217;re not the top choice.</p><p><strong>Step 4: Backward pass and optimization</strong></p><p>Once we have the total loss, we perform a backward pass to compute gradients, but only for the student model. The teacher model remains frozen - we don&#8217;t update its weights. The student&#8217;s weights are then updated using an optimizer like Adam or SGD.</p><p><strong>Why this works</strong></p><p>The beauty of logit distillation lies in its efficiency and effectiveness:</p><ul><li><p>The student learns not just what the correct answer is, but also what the teacher considers reasonable alternatives</p></li><li><p>This richer signal helps the student generalize better than training from scratch</p></li><li><p>Since both models share the same tokenizer and vocabulary, the logit vectors align perfectly - making the transfer of knowledge seamless</p></li><li><p>The student can learn from the teacher&#8217;s uncertainties and confidence levels, not just from binary correct/incorrect labels</p></li></ul><h2>Important note about tokenizer and dictionary</h2><p>For logit distillation to work in this straightforward way, the teacher and student must share the same tokenizer and vocabulary. Why? Because the logit vectors must have the same dimensionality, and each position must correspond to the same token in both models.</p><p>If &#8220;hello&#8221; is token 1234 in the teacher&#8217;s vocabulary, it must also be token 1234 in the student&#8217;s vocabulary. Otherwise, we&#8217;d be comparing apples to oranges - the teacher&#8217;s confidence about token X would be interpreted by the student as confidence about a completely different token Y.</p><p>This is why logit distillation is most commonly used within model families like LLaMA 2 &#8594; LLaMA 3 or GPT-3 &#8594; smaller GPT variants, where the tokenizer remains consistent across different model sizes.</p><h2>What next</h2><p>In this first part, we&#8217;ve explored the fundamentals of logit distillation - how a large teacher model transfers its &#8220;dark knowledge&#8221; to a smaller student model through logit matching.</p><p>We covered the key concepts: how LLMs generate logit vectors for every token in their vocabulary, why these logits contain richer information than just the predicted token, and how the distillation process works by aligning the student&#8217;s logit distribution with the teacher&#8217;s using a combination of soft and hard targets with temperature scaling.</p><p>We also emphasized an important constraint: this approach requires teacher and student to share the same tokenizer and vocabulary for seamless knowledge transfer.</p><p><strong>What&#8217;s next?</strong> In Part 2, we&#8217;ll dive into the practical implementation with Python code, working examples, and the libraries you can actually use to perform logit distillation on your own models.</p><p><strong>If you found this article helpful, please subscribe to stay updated when Part 2 drops.</strong> We&#8217;ll go from theory to practice, giving you everything you need to start distilling your own models.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p><h2>References</h2><p>[1] G. Hinton et al. Dark Knowledge 2014, <a href="https://www.ttic.edu/dl/dark14.pdf">https://www.ttic.edu/dl/dark14.pdf</a><br>[2] <a href="https://medium.com/illuminations-mirror/on-tokenization-in-llms-34309273f238">https://medium.com/illuminations-mirror/on-tokenization-in-llms-34309273f238</a></p><p></p>]]></content:encoded></item><item><title><![CDATA[In arrivo]]></title><description><![CDATA[Questo &#232; Il Substack di Claudio.]]></description><link>https://claudiostamile.substack.com/p/coming-soon</link><guid isPermaLink="false">https://claudiostamile.substack.com/p/coming-soon</guid><dc:creator><![CDATA[Claudio Stamile]]></dc:creator><pubDate>Sun, 14 Sep 2025 19:37:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!COOx!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f0a9963-b2be-4374-a918-a21d2f004126_720x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Questo &#232; Il Substack di Claudio.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://claudiostamile.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Iscriviti ora&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://claudiostamile.substack.com/subscribe?"><span>Iscriviti ora</span></a></p>]]></content:encoded></item></channel></rss>