<?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[Random Walk: Machine Learning]]></title><description><![CDATA[Research projects, theories, and explorations in machine learning]]></description><link>https://ethansmith2000.substack.com/s/machine-learning</link><image><url>https://substackcdn.com/image/fetch/$s_!9kHo!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70b360df-6ddc-46fe-a9db-ce15e7fa233b_400x400.png</url><title>Random Walk: Machine Learning</title><link>https://ethansmith2000.substack.com/s/machine-learning</link></image><generator>Substack</generator><lastBuildDate>Mon, 27 Jul 2026 09:51:40 GMT</lastBuildDate><atom:link href="https://ethansmith2000.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ethan Smith]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[ethansmith2000@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[ethansmith2000@substack.com]]></itunes:email><itunes:name><![CDATA[Ethan Smith]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ethan Smith]]></itunes:author><googleplay:owner><![CDATA[ethansmith2000@substack.com]]></googleplay:owner><googleplay:email><![CDATA[ethansmith2000@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ethan Smith]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[TurboSoap]]></title><description><![CDATA[SOAP but 10x faster than QR, 34x faster than eigh]]></description><link>https://ethansmith2000.substack.com/p/turbosoap</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/turbosoap</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Tue, 12 May 2026 03:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!tmhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tmhQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tmhQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 424w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 848w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 1272w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png" width="1456" height="932" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:932,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7738097,&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://ethansmith2000.substack.com/i/195554601?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.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_!tmhQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 424w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 848w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.png 1272w, https://substackcdn.com/image/fetch/$s_!tmhQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce8484fd-3342-4eec-b4de-3c2658af5285_2592x1660.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div><hr></div><div><hr></div><h2>Code</h2><p><a href="https://github.com/ethansmith2000/TurboSOAP">https://github.com/ethansmith2000/TurboSOAP</a></p><h2></h2><h2>TLDR</h2><p>This optimizer keeps the core SOAP idea: rotate gradients into a covariance eigenbasis, perform Adam-style adaptation in that basis, then project the update back.</p><p>Standard SOAP periodically recomputes the covariance eigenbasis with eigh or qr subspace iteration. That gives an accurate basis, but it is expensive: eigendecomposition is cubic in the factor dimension. QR is a solid improvement, but is a particularly special torch operation that is less GPU friendly and does not reap the benefits of lower precision computations.</p><p>This version adds warm basis refreshes. Instead of solving for a fresh eigenbasis every time, we update the current basis `Q` with a small manifold step, then re-orthogonalize it with a Newton-Schulz polar retraction.</p><p>A more extensive description of tangent-step corrections and reothognalization with Newton-schulz was also done for <a href="https://substack.com/home/post/p-195599385">TransportMuon here,</a> explaining a bit of the principles of this kind of method along with visuals.</p><p></p><p>At a high level:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;eda99052-b6e9-44bb-95c4-1efeecf642ab&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">C = covariance factor

Q = current basis

C @ Q                       # apply covariance to current basis

direction = tangent/Brockett update

Q_new = retract(Q + eta * direction)</code></pre></div><p>The goal is not to perfectly solve the eigensystem every refresh. The goal is to keep <code>Q</code> good enough that Adam-style elementwise adaptation still happens in a mostly decorrelated basis, while avoiding frequent expensive decompositions.</p><p></p><h2><strong>Warm Basis Refreshes</strong></h2><p>SOAP maintains covariance factors and orthogonal bases for each tensor mode. The usual refresh is:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;53cdd06b-ffe7-4bee-99cb-3f5e57e4104b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">_, Q = torch.linalg.eigh(C)</code></pre></div><p>This gives eigenvectors of the covariance factor <code>C</code>.</p><p>The warm-refresh version treats <code>Q</code> as a point on the Stiefel manifold, the set of orthogonal matrices. We take a small step that improves diagonalization of <code>Q.T @ C @ Q</code>, then retract back to the manifold.</p><p>The refresh looks like:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d33d2343-9676-4a78-996d-82b3298ec276&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Q -&gt; Q + eta * direction -&gt; orthogonalize</code></pre></div><p>Where eta determines our step size of the correction factor, similar to a gradient step.</p><p>There are two useful directions here: a tangent direction and a Brockett-style direction.</p><p></p><h2><strong>Tangent Direction</strong></h2><p>The tangent direction is the simpler basis-tracking step.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;982d1d74-93fa-4401-89ff-9c4552b2c3bb&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def _soap_tangent_direction(Cq, q):
  diag = (q * Cq).sum(dim=0)
  return Cq - q * diag.unsqueeze(0)</code></pre></div><p>Here <code>Cq = C @ q</code>.</p><p>Conceptually, <code>C @ q_i</code> tells us where the covariance wants basis vector <code>q_i</code> to move. The term</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;718813f7-bf3f-4f61-9e4a-3a18bbdbfd65&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">q * diag.unsqueeze(0)</code></pre></div><p>removes the component already aligned with each current basis vector. That leaves the part of <code>Cq</code> that actually rotates the basis.</p><p>This is a cheap warm-started eigenvector tracking step. If the covariance EMA changes slowly, the old basis is already close, so a small tangent update can keep it useful without a full eigendecomposition.</p><p></p><h2><strong>Brockett Direction</strong></h2><p>The Brockett direction adds an ordering objective.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;python&quot;,&quot;nodeId&quot;:&quot;a65dd2eb-f451-43dd-998b-69553fb8b8e8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-python">def _soap_brockett_projected_direction(Cq, q, weights):

    grad = Cq * weights.unsqueeze(0)

    return grad - q @ _soap_sym(q.T @ grad)</code></pre></div><p>The objective is:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;af91581b-0aaa-4dee-84e9-ec25d3cf3a81&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">maximize trace(W Q^T C Q)</code></pre></div><p>where <code>W</code> is diagonal with decreasing weights.</p><p>This does two things:</p><ul><li><p>It encourages <code>Q.T @ C @ Q</code> to become diagonal.</p></li><li><p>It encourages the columns of <code>Q</code> to be ordered by eigenvalue.</p></li></ul><p>That ordering matters because SOAP&#8217;s Adam buffers live in the rotated basis. If the basis columns reorder unpredictably, the optimizer has to keep the moment buffers aligned with the new basis. Brockett-style diagonalization helps make the basis tracking more structured.</p><p>The projection term</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;9b60c87e-2263-4dc0-a687-ff63092ce8ab&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">q @ sym(q.T @ grad)</code></pre></div><p>keeps the update in the tangent space of the orthogonal matrices. So we are not just applying an arbitrary gradient step to <code>Q</code>; we are applying a step compatible with the orthogonality constraint.</p><p></p><h2><strong>Newton-Schulz Retraction</strong></h2><p>After either tangent or Brockett step, <code>Q + eta * direction</code> is no longer exactly orthogonal.</p><p>So we retract it back to the orthogonal manifold.</p><p>Instead of QR or <code>eigh</code>, to get back to the Stiefel manifold, this implementation can use Newton-Schulz polar iterations:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;a07559a8-e353-4645-804c-1499a6e7a18e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Q_new &#8776; X (X^T X)^-1/2</code></pre></div><p>where:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6e0f230c-0f4a-4a72-a178-10418fa586fd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">X = Q + eta * direction</code></pre></div><p>The practical benefit is that Newton-Schulz is mostly matrix multiplies. That makes it more GPU-friendly than repeatedly launching decomposition kernels, and it can often run in lower precision such as bf16.</p><p></p><p></p><h2><strong>Diagnostics, Fallbacks, and Naive Implementation Diffuclties.</strong></h2><p>Warm tracking can fail if the step is too large or the covariance changes too quickly.</p><p>A useful diagnostic is the normalized off-diagonal error:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;2420bf78-25e4-4185-aabe-e5353496fe59&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">diag_err = ||offdiag(Q^T C Q)|| / ||Q^T C Q||</code></pre></div><p>If the update reduces this error, the basis is becoming more diagonal. If it increases the error, the step was probably too aggressive.</p><p>This lets the optimizer do controller-style refreshes:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d7544c7f-8a60-4a03-a5a0-c9712a48048f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">try a warm step

measure diagonalization error

accept if it improves, possibly increase step size based on size of error improvement

shrink step size if it does not

optionally fall back to eigh if the basis is too poor</code></pre></div><p>This increases the optimizer time nearly double, which, while thats still not too bad overall, we can amortize by checking this once every N refreshes.</p><p></p><h2>Experiments</h2><p>LLM Pretraining</p><ul><li><p>dim=2048</p></li><li><p>depth=24</p></li><li><p>batch size=32</p></li><li><p>sequence=1024</p></li></ul><p></p><h4>Loss</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ee0B!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ee0B!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 424w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 848w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 1272w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ee0B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png" width="1456" height="947" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:947,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1459931,&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://ethansmith2000.substack.com/i/195554601?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.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_!Ee0B!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 424w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 848w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.png 1272w, https://substackcdn.com/image/fetch/$s_!Ee0B!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1eb1a3a1-c75b-49d0-8b33-6c82f5c98498_2430x1580.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Loss at 50k steps is about 0.02 higher than baseline, though I suspect this can be improved with tuning of settings around step size and/or normalized steps.</p><p></p><h4>Optimizer Time</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4k0x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4k0x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 424w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 848w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 1272w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4k0x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png" width="1456" height="962" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:962,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:458949,&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://ethansmith2000.substack.com/i/195554601?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.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_!4k0x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 424w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 848w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.png 1272w, https://substackcdn.com/image/fetch/$s_!4k0x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14982b36-959c-4ef3-bf16-fe6754a4f456_2428x1604.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><ul><li><p>398ms for tangent mode of TurboSOAP, every 5th refresh (50 steps) costing about 1000ms to recalibrate step size</p></li><li><p>~4000ms for QR</p></li><li><p>13300ms for eigh</p></li></ul><p></p><p></p><h2>Background on SOAP and the Second Moment in Optimizers For Nerds</h2><p>Most modern choices of deep learning optimizers, in addition to typical momentum of the gradient, often have their own unique form of performing some version of whitening or normalization, typically utilizing a sparse approximation of the second moment of the gradient.</p><p>For background, the idea of <strong>Moments</strong> comes from statistics when describing a distribution, where we consider expected values or averages of different orders, with general form as E[x^n].</p><ul><li><p>First Moment = E[x] or the mean or average</p></li><li><p>Second Moment = E[x^2]</p></li><li><p>Third Moment = E[x^3]</p></li><li><p>Fourth Moment = E[x^4]</p></li></ul><p>We typically make use of the <strong>Uncentered Moments </strong>like those above, but we also can have centered ones which have more unique names that are probably more familiar, just to connect it back. The general form is E[(x - E[x])^n]</p><ul><li><p>First Moment = E[x] or the mean or average (no difference, at least for practical purposes E[x-E[x]] isn&#8217;t very exiting)</p></li><li><p>Variance = E[(x-E[x])^2]</p></li><li><p>Skewness = E[(x-E[x])^3]</p></li><li><p>Kurtosis = E[(x-E[x])^4]</p></li></ul><p>Now this is the case for when we consider 1-Dimensional distributions. When we work in higher dimensions, the shape of the metric grows with each order. For a space of dimension N</p><ul><li><p>First = N</p></li><li><p>Second = NxN | <strong>uncentered E[xx^T]</strong>  | centered = E[(x-e[x])(x-e[x])^T] </p></li></ul><p>I&#8217;ve bolded the <strong>E[xx^T] </strong>as this is the object we&#8217;re typically estimating, though usually only sparse approximations of it. <br><br><em>Why?</em><br><br>When we have a parameter of size m x n, we know its gradient and momentum are the same size. Though when we want to estimate the second moment, we now need to consider every dimension multiplied with every other dimension. For the purposes of optimization, our m x n matrix is a somewhat symbolic structure, there are times it makes more sense to think of it as a vector of dimension m*n.</p><p>So, when we think about our second moment, its full size, to capture the interaction of every dimension with every other dimension is mn x mn. For at 1024x1024 matrix parameter, this is 1024^2 x 1024^2 which is 1 million by 1 million.</p><p>Obviously that&#8217;s unreasonable for us, so we typically aim for sparse forms of it. Probably the two most common are:</p><ul><li><p>Diagonal </p><ul><li><p>Only considers variance (each dimension&#8217;s interaction with itself, no cross interactions), the square root of that is what we normalize by.</p></li><li><p>The diagonal of the mn x mn matrix is just mn in size</p></li><li><p>This is what Adam does for normalization via its denominator. This is somewhat like the idea of a z-score but instead of typical (x-mean)/std we have moving averages at different speeds comprising something like ema_mean@0.9/ema_uncentered_std@0.999</p></li></ul></li><li><p>Rank-1 Kronecker-like or similar factorization</p><ul><li><p>Here we more explicitly consider the 2D structure of our gradient</p></li><li><p>For gradient g, in its 2d shape, we are often estimating both E[ggt] and E[gtg], each symmetric matrices representing covariance, which are then used to form both &#8220;left&#8221; and &#8220;right&#8221; preconditioners.</p></li><li><p>Similar to the Adam case, of applying v^(-1/2) (bringing us back to x-space from x^2-space per-se) to get our normalization factor, one form of normalization is to raise each of the matrices to -1/2 power.</p><ul><li><p>In some cases, this is -1/4 power, since we have both the left and right to apply.</p></li></ul></li><li><p>The resulting normalization matrix we get is often referred to as a preconditioner</p></li><li><p>One way we could feasibly apply our preconditioners is to do</p><ul><li><p>P = (P_left[:, None, :, None] * P_right[None, :, None, :]).flatten(mn,mn)</p></li><li><p>pg = g.flatten() @ P</p></li><li><p>This should remind you of how we can take the outer product of two 1d vectors to yield a 2d matrix, which can be done by matmul or <br>A[:,None] * B[None,:]. This is the same idea generalized to taking two 2d matrices outer product to form a 4d matrix, and flattening it.</p></li></ul></li><li><p>Recall that the outer product is effectively every dimension matched with every other dimension.</p></li><li><p>Overall, this is an attractive structure as it &#8220;acknowledges&#8221; the 2d structure of our network weights </p></li><li><p>Some examples include Shampoo and PSGD</p></li></ul></li></ul><p></p><h2>Enter SOAP</h2><p>Now <a href="https://arxiv.org/abs/2409.11321">SOAP Optimizer</a> (<strong>S</strong>hampo<strong>O</strong> with <strong>A</strong>dam in the <strong>P</strong>reconditioner&#8217;s eigenbasis)  is one particularly interesting and powerful optimizer. Its something of a hybrid of both styles, and can be quite powerful. </p><p>SOAP involves a normalization of the gradient/momentum in the eigenbasis coordinates of the gradient covariance in a Adam-like fashion. .</p><p>From our left and right (Exponential Moving Averages) EMAs, E[ggt] and E[gtg], we perform eigendecompositions (as A=Q&#923;Q&#8868; ) to obtain an orthogonal eigenbasis.</p><p>The idea of normalizing coordinates of orthogonal direction may remind you of Muon</p><p>Muon uses Newton-Schulz to perform a 0th power on the singular values of the gradient/momentum matrix itself (approximately aiming for uniform 1s of the singular values) but does this without explicitly performing SVD to obtain the singular values. In other words, one could imagine doing either SVD to obtain USVT and raising S to the 0th power to make S all ones (or just directly tossing it out) and fusing UVT. Meanwhile the output of Muon directly is an approximation that converges to UVT</p><p>Muon is approximately taking</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1b13dff7-38c5-4848-9447-11d2f321a5ef&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">M = U S V^T</code></pre></div><p>and applying:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;8551a007-04d6-476b-8f0f-50eb4c6da848&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">M -&gt; U V^T</code></pre></div><p>which is the polar factor of M. Equivalently, it replaces the singular values by ones, up to rank/rectangular-shape details. </p><p>So SOAP normalizes coordinates after rotating into an estimated covariance eigenbasis. Muon normalizes the singular spectrum of the update matrix itself.</p><p>The distinction is:</p><p><strong>SOAP: covariance eigenbasis + elementwise Adam normalization in that basis</strong></p><p><strong>Muon: polar/orthogonalized update direction of the gradient or momentum matrix</strong></p><p>For an m x n gradient matrix, Muon&#8217;s singular values are min(m, n) values from the matrix being updated.</p><p>SOAP&#8217;s covariance eigenvalues come from the row/column covariance factors: m eigenvalues for G G^T and n eigenvalues for G^T G for total of m x n, effectively per-coordinate (mn) of a factorized eigenbasis that is mn x mn.</p><p></p><p></p><h2>Difficulties with SOAP at scale</h2><h3>Memory</h3><p>There are difficulties with Matrix-based optimizers in general at scale but SOAP may be particularly difficult due to a large volume of persistent states.</p><p>If we think about an n x m parameter, we can talk about memory cost in terms of that. For example, Adam maintains a momentum and second moment term of the same dimensions. So its net memory usage is 2 x n x m.</p><p>SOAP on the other hand has the EMA of the gradient covariance on both sides, the preconditioner on both sides, and the momentum + diagonal second moment term. The net price you pay is 2 x n x n + 2 x m x m + 2 x m x n. This especially can bite on large rectangular matrices like MLP&#8217;s.</p><p></p><h3>Distributed/Sharded Training</h3><p>FSDP and other parallel methods have generally been pretty easy for Adam as all of its operations have been elementwise, considering each dimension in isolation. So formulations that have flattened parameters or sharded them like DTensor have had little issue.</p><p>For matrix-level optimizers, it&#8217;s been trickier as we have two conflicting requirements. </p><p>Our states and gradients, by default, are split between devices. However, we need to materialize the full matrix, gathering all shards to perform our matrix operations typically. This requires all devices to sync to communicate their shards. </p><p>However, at the same time, similar to how when we maintain the shard form with Adam, we&#8217;d also really like to split the responsibility of updating parameters across devices. Effectively, it would be desirable to evenly distribute our parameters across devices (or by a heuristic of expected computation time) and let each operate asynchronously.</p><p>So we&#8217;re fighting a need for sync against also wanting to be async, and the naive form can be pretty brutal. There are improvements but it can be tricky.</p><h3></h3><p>This work addresses the speed component, though the two points above still pose difficulty at scale, a common problem with matrix-level optimizers.</p><p></p><h3></h3><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Transport Muon: Beating Muon in Speed and Performance in 1 Newton Step]]></title><description><![CDATA[(+ 1 tangent step and the occasional refresh)]]></description><link>https://ethansmith2000.substack.com/p/transport-muon-beating-muon-in-speed</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/transport-muon-beating-muon-in-speed</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Tue, 28 Apr 2026 17:31:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kx1K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kx1K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kx1K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 424w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 848w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 1272w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kx1K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png" width="980" height="733" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:733,&quot;width&quot;:980,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:847207,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.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_!kx1K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 424w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 848w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.png 1272w, https://substackcdn.com/image/fetch/$s_!kx1K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fffe6319f-f7cf-47dd-88fd-309eba061e3b_980x733.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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">https://www.legacyias.com/what-are-muon/</figcaption></figure></div><div><hr></div><h2>Code</h2><p><a href="https://github.com/ethansmith2000/TransportMuon">https://github.com/ethansmith2000/TransportMuon</a></p><p></p><h2>Premise/Question</h2><p>The original Muon, at optimization step t, applies the Newton-Schulz 5th-order iteration to the gradient momentum matrix M_t to produce an update Q_t. Q_t approximates the polar factor of M_t:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;M_t = U_t S_t V_t^T&quot;,&quot;id&quot;:&quot;RIAOZEZLHB&quot;}" data-component-name="LatexBlockToDOM"></div><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Q_t &#8776; U_t V_t^T&quot;,&quot;id&quot;:&quot;XBXPRXDPJB&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>Since momentum uses a well-sized decay factor, e.g. beta = 0.95, consecutive momentum matrices M_t and M_{t+1} usually change slowly. Should the target polar factor U_t V_t^T also change slowly between optimizer steps? If so, can we avoid recomputing Q_{t+1} from scratch with several Newton-Schulz iterations, and instead cheaply update or correct the previous polar factor Q_t toward the new target associated with M_{t+1}?</p><p></p><h2>High-Level Idea</h2><p>Making use of Q_t and M_{t+1}, we&#8217;d like to reach the point of Q_{t+1}. </p><p>A difficulty is that Q lives on the Stiefel Manifold, a manifold of m x n matrices where m &gt;= n and the columns are orthonormal. This both influences how we consider measuring error/distance and creating an update. </p><p>Generally there are two schools of thought for this problem</p><ul><li><p>Intrinsic/Geodesic - the update itself stays directly on manifold</p></li><li><p>Extrinsic/Retraction-based - we take a step off in ambient euclidean space/tangent space and then retract back onto the manifold</p></li></ul><p>The first requires solving the exponential map, which can be expensive. The second has some nice tools we can make use of, and we already know an efficient retraction method: Newton-Schulz</p><p></p><p>I find the methods are nicely visualized when considering a simple manifold like the 2D unit-norm hypersphere (though i generally prefer to call them circles).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wWjN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wWjN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 424w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 848w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 1272w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wWjN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png" width="538" height="404.97802197802196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1096,&quot;width&quot;:1456,&quot;resizeWidth&quot;:538,&quot;bytes&quot;:73387,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.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_!wWjN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 424w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 848w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.png 1272w, https://substackcdn.com/image/fetch/$s_!wWjN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b0c54d8-65a8-4d95-8566-9ed5b4819a8b_1474x1110.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!G7K7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!G7K7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 424w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 848w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 1272w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!G7K7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png" width="530" height="441.5453296703297" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1213,&quot;width&quot;:1456,&quot;resizeWidth&quot;:530,&quot;bytes&quot;:93764,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.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_!G7K7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 424w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 848w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.png 1272w, https://substackcdn.com/image/fetch/$s_!G7K7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2c9cf6-8dbf-4528-9e38-3f18550474bb_1788x1490.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><h3>The TLDR</h3><p>Take a tangent step off manifold, aim to use only one newton step to retract back onto Stiefel manifold as faithfully as possible to the UVT representing the new momentum term, or the polar factor we would get from performing a full newton-schulz loop on the new momentum from scratch. </p><p>Every N optimization steps, perform an &#8220;anchoring&#8221; where we take a fresh momentum term and converge as closely as possible to singular values of 1. For this, I used 5 steps of the typical Newton-schulz-quintic tuned by <a href="https://kellerjordan.github.io/posts/muon/">Keller Jordan</a>. While this is a strong tuning for converging small singular values quickly, it notably does not converge singular values closely to 1.0. So, I follow up with 2x steps of cubic newton-schulz with a converging tuning. </p><p>Then for next N optimization steps, do 1 tangent update + 1 step NS to retract in place of full newton-schulz 5 steps. </p><p>For all Newton-schulz cases except for when we run the NS5 from scratch, instead of Frobenius norm, it&#8217;s been preferable to cap by an estimated top singular value. </p><p></p><h3>First: The Update</h3><p>Given the previous cached update Q_t and the new momentum M_{t+1}, we can measure misalignment via the skew-symmetric part of:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;R = Q_t M_{t+1}^T&quot;,&quot;id&quot;:&quot;IZVJROPLJT&quot;}" data-component-name="LatexBlockToDOM"></div><p>If Q_t is already close to the new polar factor, then R should be nearly symmetric. </p><p>We know this by this identity</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c1dd4f41-1b0f-49f3-8309-eafced7a7f57&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Q_{t+1} M_{t+1}^T = U V^T (U S V^T)^T
                  = U V^T V S U^T
                  = U S U^T</code></pre></div><p></p><p>The alignment error is the skew-symmetric component, effectively how mirrored positions differ, the quantified violations of symmetry.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Skew(R) = 0.5 * (R-R^T)&quot;,&quot;id&quot;:&quot;XMHYVTCOOQ&quot;}" data-component-name="LatexBlockToDOM"></div><p>Or elementwise</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;skew(R)_{ij} = 0.5 * (R_{ij} - R_{ji})&quot;,&quot;id&quot;:&quot;MOEOSQIZSJ&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><p>So if we can reduce the skew, this would signal we&#8217;re approaching our desired target.</p><p></p><p>We can frame our problem like this:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Q_{tilde} = Q_t + A Q_t&quot;,&quot;id&quot;:&quot;AVBSIFEQVA&quot;}" data-component-name="LatexBlockToDOM"></div><p></p><h4>Aside on this formulation:</h4><p>Let A is skew-symmetric (A^T = -A; A + A^T = 0)</p><p>This choice of A naturally lets AQt lie in the tangent space. Taking a step in this direction:</p><ul><li><p>First order error cancels, but we do have a second order error.</p></li><li><p>AQ_t is a &#8220;rotation-like&#8221; update to the rows of Q_t. Because A is skew-symmetric, it mixes rows in opposite directions: if row i moves toward row j, row j moves away from row i by the matching amount, preserving orthonormality for the infintesimally small step</p></li><li><p>Though we use a finite Euler step</p></li><li><p>This induces the second order error on both our orthogonality and inflates our singular values</p></li></ul><p>Let&#8217;s imagine a small step of our update</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Q_{eps} = Q_t + eps * A Q_t&quot;,&quot;id&quot;:&quot;XBULQDUYCI&quot;}" data-component-name="LatexBlockToDOM"></div><p>And then expand:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;e3a2312c-bc8b-4b5d-b8bc-4990c84a0dd0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Q_eps Q_eps^T
= Q_t Q_t^T
  + eps (A Q_t Q_t^T + Q_t Q_t^T A^T)
  + eps^2 (A Q_t Q_t^T A^T)</code></pre></div><p>If Q_t Q_t^T = I, then the first-order term becomes:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;eps * (A + A^T)&quot;,&quot;id&quot;:&quot;LFTMVXFPUT&quot;}" data-component-name="LatexBlockToDOM"></div><p>Which cancels out by the skew-symmetric identity.</p><p>Looking at the second order term, it reduces to </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;eps^2 * -A^2&quot;,&quot;id&quot;:&quot;JOHZQAFIXJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>-A^2 is positive semidefinite, so this will inflate singular values and screw up our orthogonality, hence the need for the retraction step. <strong>Remember that this error exclusively increases singular values; that will be a valuable property we can exploit in our design.</strong></p><p></p><h4>Back to how we get A</h4><p>We said that the update direction should reduce the skew of R (QMt). So starting from our original problem framing, of wanting to obtain the correct polar factor (Q), let&#8217;s get to R by multiplying each term by M_{t+1}</p><p>From:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Q_{tilde} = Q_t + A Q_t&quot;,&quot;id&quot;:&quot;STFJVSCUCJ&quot;}" data-component-name="LatexBlockToDOM"></div><p>to:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Q_t M_{t+1}^T + A Q_t M_{t+1}^T&quot;,&quot;id&quot;:&quot;OPWDDQGKCT&quot;}" data-component-name="LatexBlockToDOM"></div><p>simplified:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;R + AR&quot;,&quot;id&quot;:&quot;XWASGULVWZ&quot;}" data-component-name="LatexBlockToDOM"></div><p>and our target point is such that </p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Skew(R + AR) = 0&quot;,&quot;id&quot;:&quot;BWQZQTCFCP&quot;}" data-component-name="LatexBlockToDOM"></div><p>Solving this exactly is too expensive. Instead we can use a Jacobi-style diagonal approximation. For an off-diagonal pair (i, j), approximate the effect of A using mostly the diagonal entries of R.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;de07022a-c651-49a2-8fe5-e3e1282c4486&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">(AR)_ij &#8776; A_ij R_jj
(AR)_ji &#8776; A_ji R_ii = -A_ij R_ii</code></pre></div><p>Therefore:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d38fc72e-2ba6-402c-a679-f60aa35ad235&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">skew(AR)_ij = 0.5 * ((AR)_ij - (AR)_ji)
            &#8776; 0.5 * A_ij * (R_ii + R_jj)</code></pre></div><p>to cancel the skew error:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c011f7c0-4632-4b8d-9bed-e65290e3fa9c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">skew(R)_ij + 0.5 * A_ij * (R_ii + R_jj) &#8776; 0</code></pre></div><p>Finally:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4e9ccf7c-024c-4805-a41e-cd4397f0a131&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">A_ij &#8776; -2 * skew(R)_ij / (R_ii + R_jj)</code></pre></div><p>The negative sign moves against the skew error and the factor of 2 cancels the 0.5 in the skew definition (which in code we just omit the 0.5).</p><p></p><p>As in code (0.5 on skew included for clarity):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;a7f6fe89-e162-47c8-949f-5d7e7bf7fbb1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">R = q_prev @ work_matrix.mT
skew = 0.5 * (R - R.mT)

diag = torch.diagonal(R)
denom = diag.unsqueeze(1) + diag.unsqueeze(0)
floor = jacobi_eps * (diag.abs().mean() + 1e-8)
denom_abs = denom.abs().clamp_min(floor)
denom = torch.copysign(denom_abs, denom)

A = -2.0 * eta * skew * denom.reciprocal()
q_tilde = q_prev + A @ q_prev</code></pre></div><p></p><p></p><h3>Second: The Retraction</h3><p>The canonical Newton-Schulz used in Muon converges like this (green 1step + red 5step lines)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ihg_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ihg_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 424w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 848w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 1272w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ihg_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png" width="1456" height="815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:815,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:211344,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.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_!ihg_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 424w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 848w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.png 1272w, https://substackcdn.com/image/fetch/$s_!ihg_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff432dd22-b470-4019-861f-bde5e46ee1a6_1800x1008.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This is a very deliberate design choice. The singular value distribution we have in our gradient momentum is a black box, and its possible (and even likely) some singular values may be quite small. </p><p>So this variant is strong is moving small singular values quickly.</p><p>But it does not converge monotonically to singular values of 1.0, instead oscillating around [0.7, 1.3].</p><p>In practice, this has been fairly sufficient, but because we want to take lots of tangent steps from a single polar factor, we might want our initial starting point to be on manifold as much as possible. </p><p></p><p>Keller shares another set of coefficients (pictured here in the solid lines) as a base example. I started with this one, but tried exploring some others balancing between things like</p><ul><li><p>Convergence speed of small values</p></li><li><p>Convergence point</p><ul><li><p>Fixed or oscillating </p></li></ul></li><li><p>Maximum values before we risk explosions </p></li></ul><p>A general rule for convergence to 1.0 is to have: a - b + c = 1.0</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zizX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zizX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 424w, https://substackcdn.com/image/fetch/$s_!zizX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 848w, https://substackcdn.com/image/fetch/$s_!zizX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 1272w, https://substackcdn.com/image/fetch/$s_!zizX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zizX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png" width="1456" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:623486,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.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_!zizX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 424w, https://substackcdn.com/image/fetch/$s_!zizX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 848w, https://substackcdn.com/image/fetch/$s_!zizX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.png 1272w, https://substackcdn.com/image/fetch/$s_!zizX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb96070cf-cd60-4fd2-8c98-82d058ec1666_3450x1922.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DTDW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DTDW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 424w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 848w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 1272w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DTDW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png" width="834" height="356" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0030243-52ee-49c3-b5b7-805c4827527e_834x356.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:356,&quot;width&quot;:834,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:66168,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.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_!DTDW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 424w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 848w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.png 1272w, https://substackcdn.com/image/fetch/$s_!DTDW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0030243-52ee-49c3-b5b7-805c4827527e_834x356.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><p>This is another</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JR11!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JR11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 424w, https://substackcdn.com/image/fetch/$s_!JR11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 848w, https://substackcdn.com/image/fetch/$s_!JR11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 1272w, https://substackcdn.com/image/fetch/$s_!JR11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JR11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png" width="1456" height="691" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:691,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:545293,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.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_!JR11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 424w, https://substackcdn.com/image/fetch/$s_!JR11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 848w, https://substackcdn.com/image/fetch/$s_!JR11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.png 1272w, https://substackcdn.com/image/fetch/$s_!JR11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcefaa4fe-ed3c-4f87-b788-273c4ae9ab9c_3456x1640.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><p>As mentioned previously, when we do our tangent update, we exclusively increase our singular values.</p><p>From there, we can do a singular value upper bound estimate and normalize by that, which happens to use the gram matrix, making it a small detour away from our typical NS path.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AqTU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AqTU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 424w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 848w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 1272w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AqTU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png" width="1240" height="770" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/226b6154-6609-428d-a935-e9a51185de62_1240x770.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:770,&quot;width&quot;:1240,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:154757,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.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_!AqTU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 424w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 848w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.png 1272w, https://substackcdn.com/image/fetch/$s_!AqTU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F226b6154-6609-428d-a935-e9a51185de62_1240x770.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>What number we use for our cap depends on bit on where each form of NS starts to blow up. </p><p>I haven&#8217;t experimented with it as much, but personally could imagine benefit with one of the variants that has fast single step growth for smaller values, even if it overshoots a bit, we could then keep capping at 1.0.</p><p></p><h3>Full Thing in Pseudocode</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;f384f9cb-b8ec-473d-849d-d5584eadbcbd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Q_cur = None # Polar Factor (the update)
Q_prev

For i in train_steps:
    g = model_loss()
    M = update_momentum(g)
    if i == 0 or i % anchor_steps == 0 or i &lt; warmup_steps:
      Q_unstable = NS5(M)
      Q_cur = NS_cubic_2_step(Q_unstable)
    else:
      Q_tilde = tangent_step(Q_prev, M)
      Q_tilde = clamp_by_largest_sv(Q_tilde)
      Q_cur = NS_cubic_1_step(Q_tilde)
    update_model(Q_cur)</code></pre></div><p></p><h3>Experiment1</h3><ul><li><p>1024 dim</p></li><li><p>12 layers</p></li><li><p>1024 seqlen</p></li><li><p>32 batch</p></li><li><p>Muon default settings from original repo, 0.02 lr, 0.95 momentum</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_!6tJ2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6tJ2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 424w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 848w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6tJ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png" width="1456" height="892" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:892,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:729606,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.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_!6tJ2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 424w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 848w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!6tJ2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f7b00c3-fe00-44ab-b0b2-565fc2de3e6a_2598x1592.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Initially off to a rough start once we switch from full NS warmup to transport method. I imagine I did not warmup for long enough</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jJLG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jJLG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 424w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 848w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 1272w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jJLG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png" width="1456" height="949" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:949,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1035378,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.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_!jJLG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 424w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 848w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.png 1272w, https://substackcdn.com/image/fetch/$s_!jJLG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F41d7f275-84e0-4f89-b740-b9e1cf214a83_2620x1708.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Crosses below baseline around 25k-ish</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7Ih0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7Ih0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 424w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 848w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7Ih0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png" width="1456" height="891" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:891,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:901184,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.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_!7Ih0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 424w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 848w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.png 1272w, https://substackcdn.com/image/fetch/$s_!7Ih0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F823b07f5-aa66-45d0-85b2-44525222f4e1_2602x1592.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I suspect it possibly performs a bit better given that for our transport steps, and anchor, we approach very close to singular values of 1.0</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TD2L!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TD2L!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 424w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 848w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 1272w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TD2L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png" width="1456" height="953" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:953,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:264004,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.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_!TD2L!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 424w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 848w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.png 1272w, https://substackcdn.com/image/fetch/$s_!TD2L!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff35d48d-c2bb-4167-a613-38ab959e1388_2622x1716.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>It was a bit hard to display, so I disabled the other runs for the optimizer time. In ms, we have 85ms every 10th step, with other steps being about 11ms shorter. </p><ul><li><p>~32 seconds gained on anchor step</p></li><li><p>11x9=99ms seconds saved on transport steps</p></li></ul><p></p><p></p><h3>Experiment2</h3><p>Same as above but now 2048 dim</p><p>This time I decided to warmup for 2500 steps instead of 500</p><p></p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uFJp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uFJp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 424w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 848w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 1272w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uFJp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png" width="1456" height="895" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:895,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:784926,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.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_!uFJp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 424w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 848w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.png 1272w, https://substackcdn.com/image/fetch/$s_!uFJp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2e89494-1617-4542-bd5f-c936488a8358_2612x1606.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Base Muon takes the lead during the warmup phase, but right around the start of our anchor-transport loop, TransportMuon takes a significant dip. I was not expecting this. I figured it could be related to where singular values converge to, inflating learning rate, but given that I cap at 1.25 + retract, 1 step of NS is expected to give us 1.046 at the max.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Svk1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Svk1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 424w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 848w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 1272w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Svk1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png" width="1456" height="953" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:953,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1629957,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.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_!Svk1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 424w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 848w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.png 1272w, https://substackcdn.com/image/fetch/$s_!Svk1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c1e99c8-1ad0-4020-8b5d-69090b26b496_2618x1714.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Around 40k, pretty similar delta in loss.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Zd47!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zd47!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 424w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 848w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 1272w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zd47!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png" width="1456" height="908" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:908,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:256230,&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://ethansmith2000.substack.com/i/195599385?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.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_!Zd47!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 424w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 848w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.png 1272w, https://substackcdn.com/image/fetch/$s_!Zd47!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8ef8fe9-f5a3-410a-ae35-ed0769dd6cd9_2608x1626.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The optimizer speed on the other hand is a pretty comfortable improvement.</p><ul><li><p>~27.5ms gained on anchor step</p></li><li><p>~48.5*9=436ms saved on transport steps total</p></li></ul><p></p><h3>Related Work</h3><ul><li><p>Jordan, Jin, Boza, You, Cesista, Newhouse, &amp; Bernstein. <em>Muon: An optimizer for hidden layers in neural networks.</em></p></li><li><p>Carlson, Collins, Hsieh, Carin, &amp; Cevher. <em>Stochastic Spectral Descent for Restricted Boltzmann Machines.</em></p></li><li><p>Tuddenham, Pr&#252;gel-Bennett, &amp; Hare. <em>Orthogonalising gradients to speed up neural network optimisation.</em></p></li><li><p>Bernstein &amp; Newhouse. <em>Old Optimizer, New Norm: An Anthology.</em></p></li><li><p>Bernstein. <em>Deriving Muon.</em></p></li><li><p>Bernstein and the Thinking Machines team. <em>Modular Manifolds.</em></p></li><li><p>Cesista. <em>Heuristic Solutions for Steepest Descent on the Stiefel Manifold.</em></p></li><li><p>Cesista. <em>Steepest Descent on Finsler-Structured (Matrix) Manifolds.</em></p></li><li><p>Su. <em>Stiefel Muon.</em></p></li><li><p>Tilde Research. <em>Gram-Space Manifold Muon.</em></p></li><li><p><em>Manifold Constrained Steepest Descent (MCSD / SPEL).</em></p></li><li><p>Kong, Wang, &amp; Tao. <em>Momentum Stiefel Optimizer, with Applications to Suitably-Orthogonal Attention, and Optimal Transport.</em></p></li><li><p>Edelman, Arias, &amp; Smith. <em>The Geometry of Algorithms with Orthogonality Constraints.</em></p></li><li><p>Absil, Mahony, &amp; Sepulchre. <em>Optimization Algorithms on Matrix Manifolds.</em></p></li><li><p>B&#233;cigneul &amp; Ganea. <em>Riemannian Adaptive Optimization Methods.</em></p></li><li><p>Kasai, Jawanpuria, &amp; Mishra. <em>Riemannian Adaptive Stochastic Gradient Algorithms on Matrix Manifolds.</em></p></li><li><p>Li, Fuxin, &amp; Todorovic. <em>Efficient Riemannian Optimization on the Stiefel Manifold via the Cayley Transform.</em></p></li></ul>]]></content:encoded></item><item><title><![CDATA[Social Learning and Biases]]></title><description><![CDATA[In our pursuit to perfect neural networks, we often look to how humans learn for reference, which has had varying degrees of success.]]></description><link>https://ethansmith2000.substack.com/p/social-learning-and-biases</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/social-learning-and-biases</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Thu, 05 Jun 2025 11:19:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zJFE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zJFE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zJFE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 424w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 848w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 1272w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zJFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png" width="912" height="547" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:547,&quot;width&quot;:912,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!zJFE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 424w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 848w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.png 1272w, https://substackcdn.com/image/fetch/$s_!zJFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7283f2eb-aa8a-44d6-8eee-81e9fc26ca86_912x547.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>In our pursuit to perfect neural networks, we often look to how humans learn for reference, which has had varying degrees of success. Whether or not these inspirations lead to performant models, the research itself, both positive and negative results, is interesting, and I like to think it only adds to our knowledge compendium.</p><p>One space of human-inspired learning I am particularly interested in is how humans learn in social settings. The human, rarely if ever, learns alone. Unlike our typical methods, we don&#8217;t chug through data in isolation. Imagine, for a second, if that were the case. We&#8217;d go through life seeing, reading, feeling, and hearing our environments. We&#8217;ll also allow watching others behave as neural networks take in data like this as well.</p><p>However, we&#8217;d remove many places for learning we have, such as debates with our peers trying to enforce our world models upon each other, dealing with cognitive dissonance when we experience mismatches between reality and our notions of the world, assembling the perspectives of those in proximity with us, balancing others&#8217; opinions to help gauge our own, and so forth. These behaviors, I would argue, do not have well-defined analogues in neural network learning.</p><p>One could argue teacher-student learning could constitute an example of social learning, though it feels more like distillation and a single-channeled knowledge transfer. Namely, I would be interested in cases where a neural network both learns from its own data stream but is also forced to weigh its developing world model against others with distinctly different ideas. Methods like Bayesian learning do resemble the idea of balancing our priors with new incoming information, though we somewhat predefine the weights of how we balance this dynamic.</p><p>How might a neural network develop its own agency to decide what information is not worth adding to its knowledge base, writing it off as noise or invalid, and what is worth learning? I believe we&#8217;d call this bias.</p><p>You&#8217;ll hear many people refer to neural networks as biased. This couldn&#8217;t be further from the truth. Our models have slight biases towards solutions that generalize well and are &#8220;smooth&#8221; by dynamics of gradient descent and some other magic we still haven&#8217;t fully understood yet. Though, overall, they are very close to unbiased estimators of the distribution of observed data. They approximate mirrors of the reality they were shown. When we accuse neural networks of acting in biased ways, what&#8217;s really happening is that its training set was sampled in a biased fashion, and our model just absorbed that bias without its own bias. For instance, when neural networks generate images of professions with a noticeable demographic bias, you&#8217;ll typically find a very similar bias performing a search on Google. Thus, it is the bias of humans selecting how we build our digital world that results in a collection of images on the internet that are not representative of reality that the neural network later digests. The distribution of images on the internet is in no way representative of how often they occur in reality, which not only hurts the chance of neural networks learning accurate depictions but also further biases ourselves as we see a distorted picture of reality.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7LoP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7LoP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 424w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 848w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 1272w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7LoP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png" width="987" height="592" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:592,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!7LoP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 424w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 848w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 1272w, https://substackcdn.com/image/fetch/$s_!7LoP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afd6eed-de8f-4d4f-9701-e7baab34dbf9_987x592.png 1456w" sizes="100vw"></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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>So I hope this example drives home the point that neural networks effectively learn an unbiased reflection of their dataset (indicated by low cross entropy or FID), while humans are biased creatures. Unbiasedness seems like a desirable trait to have for fairness and accuracy in our neural networks. Though, I believe human biases exist for a reason outside of discrimination and other maladaptive behaviors. Our biases serve us to select for information that we consider valuable or coherent with our existing notions and reject noise or dissonance. This kind of intuition feels nontrivial to construct in current neural networks.</p><p>Somehow networks would need to develop their own sense of how to weigh incoming information by utility, preference, and consonance, not just by surprisal factor, predefined loss clipping, and a KL distance to another model. Perhaps reinforcement learning could account for some of this, but I&#8217;d be interested in how we could better understand this phenomenon and design training methodologies that replicate the ways we acquire knowledge through socialization and use biases to filter what influences our world models.</p><p>I have no idea how this should look, though I have a few mental models of things that could be fun to explore for social learning examples despite not having a great outlook for profound results.</p><p><strong>Socially Cooperative Learning</strong></p><p>A method of training where a fleet of models each see different shards of a dataset, but each model also depends on the others for filling out the gaps of what is not available in their shards.</p><p>A possible scenario:</p><ol><li><p>Initialize N models of the same type (using the same initialization?)</p></li><li><p>Split the dataset into N evenly sized shards</p></li><li><p>At every training step</p><ol><li><p>each model trains on a batch from its own shard and updates its weights</p></li><li><p>each model takes a step towards all of the other models by linear interpolation</p></li></ol></li></ol><p>Another possible scenario:</p><ol><li><p>Initialize N models of the same type (using the same initialization?)</p></li><li><p>Split the dataset into N+1 evenly sized shards, one shard will be communal</p></li><li><p>At every training step</p><ol><li><p>each model trains on a batch from its own shard and updates its weights</p></li><li><p>all models make a prediction on a batch from the communal shard</p></li><li><p>predictions are averaged, and this becomes the target for each model to train on as opposed to using ground truth labels of the communal set.</p></li></ol></li></ol><p>Cons:</p><ul><li><p>This is quite expensive both in computation, loss of parallelism, and memory for storing multiple models. Would probably only try this with SSL or classifier models.</p></li><li><p>It&#8217;s uncertain how much of an advantage is here compared to EMA training or post-training model soups/merging</p></li><li><p>More hyperparameters to decide how large of a step models should take towards each other, although there may be a heuristic that fits here, like weighing the step size by distance.</p></li></ul><p>The hope:</p><ul><li><p>Improved generalization capabilities as indicated by performance on the validation set and reaching flatter minima.</p></li><li><p>It could be interesting for decentralized/async training options where model weights exhibit a controlled divergence across devices instead of being identical copies and having the update step with other models be less frequent.</p></li><li><p>In the end, the models would be used as an ensemble, weighing all of their predictions together or averaging all model weights into a single model.</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_!JlfZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JlfZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 424w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 848w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 1272w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JlfZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png" width="837" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/abb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:837,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!JlfZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 424w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 848w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.png 1272w, https://substackcdn.com/image/fetch/$s_!JlfZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fabb66912-bcd3-4289-89e2-7264a40ccc1b_837x700.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><strong>Socially Adversarial Learning</strong></p><p>A method of training where 2 generative models face off against each other, attempting to &#8220;persuade&#8221; the opponent model towards becoming more like itself. In short, a model aims to generate the optimal dataset such that when trained on, the opponent model &#8220;agrees&#8221; more with it.</p><p>A possible scenario:</p><ol><li><p>Obtain 2 fine-tuned LLMs, each fine-tuned from the same base model on different sets. It&#8217;s likely important that the models have meaningful distance from each other, i.e., not equivalent solutions that are permutations of each other.</p></li><li><p>Obtain a dataset of answerable questions or prompts for the LLMs to respond to</p></li><li><p>Each LLM writes an answer to the question; the output is fed to the opponent to train on.</p></li><li><p>The reward each model gets is the cosine similarity between the opponents update direction and the difference between the two LLM weights, scaled by the update&#8217;s norm</p></li><li><p>To regularize, each LLM also takes a small step towards its original weights (or KL-style regularization) to prevent collapse and stay somewhat anchored to its original self.</p></li></ol><p>Cons:</p><ol><li><p>This kind of RL would likely have high variance and be difficult to train</p></li><li><p>Outputs from models could end up appearing like adversarial examples rather than being meaningful. In other words, generating text that is persuasive with respect to affecting another model&#8217;s weights might not necessarily make a model persuasive.</p></li></ol><p>The hope:</p><ol><li><p>Not as sure here! There is some hope that models can use adversarial games for continual self-improvement, but I&#8217;m not quite sure what to expect here.</p></li><li><p>Another example may be more purely in the data space rather than fussing about with model weights. For instance, two LLMs debate each other, a winner is somehow decided, and this becomes the reward and penalty to improve one&#8217;s debating abilities.</p></li></ol>]]></content:encoded></item><item><title><![CDATA[Recurrent Parameterless Attention is a Consensus Algorithm]]></title><description><![CDATA[In another post, I wrote about parameterless (boneless) attention as a means of mixing information across datapoints weighted by their correlation.]]></description><link>https://ethansmith2000.substack.com/p/recurrent-parameterless-attention</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/recurrent-parameterless-attention</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sat, 24 May 2025 11:17:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_rR7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In another post, I wrote about parameterless (boneless) attention as a means of mixing information across datapoints weighted by their correlation.</p><p>Doing this recurrently until convergence yields what I&#8217;d like to call a consensus algorithm.</p><p>A consensus algorithm smells a lot like unsupervised clustering algorithms in that they identify groupings of points, but with the added component that the values of points themselves are modified at each iteration to move closer to their neighbors until all points reach a &#8220;consensus&#8221; or an agreed-upon value they all take on.</p><p>To make this more concrete, we can say more on how it differs from something like K-means clustering.</p><p>K-Means</p><ul><li><p>Initialize centroids in the same space as the data</p></li><li><p>Move these centroids around in order to have minimal distance from the data points in their cluster</p></li><li><p>Reassign data points to centroids based on how close they are to each centroid.</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_!2G_5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2G_5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2G_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg" width="576" height="432" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:432,&quot;width&quot;:576,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;https://www.youtube.com/watch?v=_aWzGGNrcic&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="https://www.youtube.com/watch?v=_aWzGGNrcic" title="https://www.youtube.com/watch?v=_aWzGGNrcic" srcset="https://substackcdn.com/image/fetch/$s_!2G_5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2G_5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7586a5c-c22d-4b43-875d-4da6785165b3_576x432.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"></figcaption></figure></div><div id="youtube2-_aWzGGNrcic" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;_aWzGGNrcic&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/_aWzGGNrcic?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>Consensus algorithm</p><ul><li><p>Data points themselves serve as the centroids</p><ul><li><p>No predefined number of clusters: potential to have as many clusters as there are data points. Hyperparameters used to define the update step may influence how many points we converge upon</p></li></ul></li><li><p>Instead of updating the initialized centroids at each step, we update the data points themselves to take a step in a direction that considers all other data points, with the directions corresponding to their closest neighbors having the most importance</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_!_rR7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_rR7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 424w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 848w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 1272w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_rR7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png" width="987" height="799" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:799,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!_rR7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 424w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 848w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.png 1272w, https://substackcdn.com/image/fetch/$s_!_rR7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63d0e40f-bbb5-4c74-95a9-e4f03e108176_987x799.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Parameterless attention is one possible consensus algorithm. I originally discovered this use case when trying to design a color clustering loss that could be differentiable for backpropagation and benefit from GPU acceleration. To note, despite it being differentiable, it did not work very well as a loss.</p><p>Assuming you know how attention works, and specifically the QKNorm variant, it works as follows:</p><ul><li><p>For each data point:</p><ul><li><p>Calculate vector of cosine similarities with all other points</p></li><li><p>Apply temperature scaling, a hyperparameter that decides how strongly to prioritize nearer points over farther away points</p></li><li><p>Apply softmax over this vector, giving us the mixing coefficients or weights.</p></li><li><p>Take a weighted sum of all the data points scaled by the mixing coefficients</p></li><li><p>Perform the update: a linear interpolation between the existing data points and the output of the attention operation we just did.</p></li></ul></li></ul><p>This should probably ring a bell for attention methods used in graph neural networks.</p><p>It looks like this</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JrNE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JrNE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 424w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 848w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 1272w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JrNE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png" width="760" height="332" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:332,&quot;width&quot;:760,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!JrNE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 424w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 848w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.png 1272w, https://substackcdn.com/image/fetch/$s_!JrNE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a8dc95-6f47-423b-a774-c944da5a0ce3_760x332.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We can use it to perform segmentation of an image in color space</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AqKf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AqKf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 424w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 848w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 1272w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AqKf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp" width="231" height="229" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:229,&quot;width&quot;:231,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!AqKf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 424w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 848w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 1272w, https://substackcdn.com/image/fetch/$s_!AqKf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08c12780-ff84-4c20-ad43-5778a3c30361_231x229.webp 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_19l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_19l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 424w, https://substackcdn.com/image/fetch/$s_!_19l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 848w, https://substackcdn.com/image/fetch/$s_!_19l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 1272w, https://substackcdn.com/image/fetch/$s_!_19l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_19l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp" width="229" height="229" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:229,&quot;width&quot;:229,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&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="" title="" srcset="https://substackcdn.com/image/fetch/$s_!_19l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 424w, https://substackcdn.com/image/fetch/$s_!_19l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 848w, https://substackcdn.com/image/fetch/$s_!_19l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 1272w, https://substackcdn.com/image/fetch/$s_!_19l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa7124b11-3ad6-473f-8d73-4524cf4e8105_229x229.webp 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Or, by initializing random noise centroids instead, and performing something closer to &#8220;<a href="https://arxiv.org/abs/2103.03206">Perceiver Attention</a>&#8220;, we can perform something closer to a &#8220;soft&#8221; K-means algorithm.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PoQf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PoQf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 424w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 848w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 1272w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PoQf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png" width="817" height="963" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:963,&quot;width&quot;:817,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!PoQf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 424w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 848w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.png 1272w, https://substackcdn.com/image/fetch/$s_!PoQf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa127a0c8-f3fc-440c-bfb4-b5893799629b_817x963.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!opT7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!opT7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 424w, https://substackcdn.com/image/fetch/$s_!opT7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 848w, https://substackcdn.com/image/fetch/$s_!opT7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 1272w, https://substackcdn.com/image/fetch/$s_!opT7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!opT7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png" width="987" height="179" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:179,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!opT7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 424w, https://substackcdn.com/image/fetch/$s_!opT7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 848w, https://substackcdn.com/image/fetch/$s_!opT7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 1272w, https://substackcdn.com/image/fetch/$s_!opT7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad982c9-5fa4-424d-91dc-11e36669e71f_987x179.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>We can also perform consensus in spatial domains.</p><p>I initially tried using the same hyperparameters as before but found that the points did not move at all. With the scale as high as it was, it&#8217;s possible that nearly all the weight was put on self and immediate neighbors.</p><p>scale=100.0</p><p>step_size=0.85</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UN8p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UN8p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 424w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 848w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 1272w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UN8p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png" width="987" height="519" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:519,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!UN8p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 424w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 848w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.png 1272w, https://substackcdn.com/image/fetch/$s_!UN8p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51a1b5ca-7c15-4a63-b90d-b842a1c5e5db_987x519.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>at smaller scales, we just collapse to the mean, which is probably pretty reasonable behavior for single gaussian, which really is just a single cluster of points.</p><p>scale=1.0</p><p>step_size=0.85</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vRFl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vRFl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 424w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 848w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 1272w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vRFl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png" width="987" height="517" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:517,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!vRFl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 424w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 848w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.png 1272w, https://substackcdn.com/image/fetch/$s_!vRFl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8623c4cd-dc2f-4acd-8017-78f1a8a47197_987x517.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This time around, I initialized 3 gaussians with means (1,1), (0,-1) and (-1,1). This appears to reach consensus with 3 clusters as we may expect.</p><p>scale=10.0</p><p>step_size=0.85</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qOOZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qOOZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 424w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 848w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 1272w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qOOZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png" width="987" height="516" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83410409-867f-4779-9900-a6a39aafd8a6_987x516.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:516,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!qOOZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 424w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 848w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.png 1272w, https://substackcdn.com/image/fetch/$s_!qOOZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83410409-867f-4779-9900-a6a39aafd8a6_987x516.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The code I used for this is here:</p><p><a href="https://github.com/ethansmith2000/attention-cluster">https://github.com/ethansmith2000/attention-cluster</a></p>]]></content:encoded></item><item><title><![CDATA[The Mean Preference is a Bad Estimate of Preferences]]></title><description><![CDATA[I felt compelled to make this post after seeing yet another reinforcement learning paper for diffusion models that does spectacularly in terms of being able to fit to the reward function, but the actual results look terrible, collapse to a single style, and are otherwise kitsch.]]></description><link>https://ethansmith2000.substack.com/p/the-mean-preference-is-a-bad-estimate</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/the-mean-preference-is-a-bad-estimate</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 18 May 2025 11:15:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iAnX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iAnX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iAnX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 424w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 848w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 1272w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iAnX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png" width="953" height="524" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:524,&quot;width&quot;:953,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!iAnX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 424w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 848w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.png 1272w, https://substackcdn.com/image/fetch/$s_!iAnX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1de91895-6ff7-4e88-9c00-04b95ecae22e_953x524.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I felt compelled to make this post after seeing yet another reinforcement learning paper for diffusion models that <a href="https://dancegrpo.github.io/">does spectacularly in terms of being able to fit to the reward function, but the actual results look</a> terrible, collapse to a single style, and are otherwise kitsch.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!So_P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!So_P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 424w, https://substackcdn.com/image/fetch/$s_!So_P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 848w, https://substackcdn.com/image/fetch/$s_!So_P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 1272w, https://substackcdn.com/image/fetch/$s_!So_P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!So_P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png" width="987" height="732" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:732,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!So_P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 424w, https://substackcdn.com/image/fetch/$s_!So_P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 848w, https://substackcdn.com/image/fetch/$s_!So_P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 1272w, https://substackcdn.com/image/fetch/$s_!So_P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88858c7a-67d4-4d50-a1c9-223a2bdcfad9_987x732.png 1456w" sizes="100vw"></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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This is not at all a criticism of the author&#8217;s work. They proposed a new method of reinforcement learning, and it successfully fit the objective quite well. But the images all have the same tired, fake HDR, airbrushed look that make them all painful to look at.</p><p>I&#8217;m reminded of the diagram when OpenAI intended to show that DALLE3 had improved over their previous DALLE2, but the newer outputs were just so much worse.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!orBl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!orBl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 424w, https://substackcdn.com/image/fetch/$s_!orBl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 848w, https://substackcdn.com/image/fetch/$s_!orBl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 1272w, https://substackcdn.com/image/fetch/$s_!orBl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!orBl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png" width="784" height="528" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:528,&quot;width&quot;:784,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!orBl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 424w, https://substackcdn.com/image/fetch/$s_!orBl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 848w, https://substackcdn.com/image/fetch/$s_!orBl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 1272w, https://substackcdn.com/image/fetch/$s_!orBl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F42f0bc50-5d9a-4ff8-8bcd-8cd0219170fe_784x528.png 1456w" sizes="100vw"></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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The problem is that the reward function itself, I think, sucks.</p><p>In this post, I want to discuss the nature of human preferences and why standard reward models, which learn the expectation or average over many human labels, might be doing us a disservice.</p><h3>The Nature of Human Preferences</h3><p>The kinds of things humans like differ wildly from person to person. As for what makes a pleasing image, some people may prefer a piece by Van Gogh, others may prefer anime drawings, and others may prefer abstract art.</p><p>When collecting ratings of these things across many people, we might get wildly different answers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VCci!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VCci!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 424w, https://substackcdn.com/image/fetch/$s_!VCci!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 848w, https://substackcdn.com/image/fetch/$s_!VCci!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 1272w, https://substackcdn.com/image/fetch/$s_!VCci!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VCci!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png" width="987" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!VCci!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 424w, https://substackcdn.com/image/fetch/$s_!VCci!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 848w, https://substackcdn.com/image/fetch/$s_!VCci!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.png 1272w, https://substackcdn.com/image/fetch/$s_!VCci!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5adbe49-d6d6-4350-a1e5-f33fce7ec3b9_987x489.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Inevitably, because we all have our own subjective preferences, there is a lot of variance and inconsistency in human ratings. One person&#8217;s trash is another&#8217;s treasure.</p><p>We hope that by getting many unbiased ratings, we can &#8220;average out&#8221; this noise and reach the common denominator of what makes an image aesthetically pleasing, regardless of the exact kind of content.</p><p>In other words, while some may prefer oil paintings and others may prefer 3D-rendered art, what are the universal components that are pleasing to all? Maybe certain colors are universally enjoyed on average by a certain population. Maybe there are certain compositions or uses of light that are generally preferred.</p><p>However, I think if there is any preference that persists on average across such a large population, it is something so primitive and vague that it entirely misses the individual nuances of what people actually love.</p><p>I say this because many aesthetic preferences are mutually exclusive. Let&#8217;s imagine a toy example of this.</p><p>Let&#8217;s say half of a population enjoys dark, brooding art, and the other appreciates the opposite: light and happy scenes. We then collect a dataset composed of these two art styles, again half and half. The dark crowd always rates the dark art highly and the light art negatively, and vice versa.</p><p>For our model, this is unfortunately not an informative trait it can use to make predictions. If half of the labels over dark art are rated highly and the other half are rated lowly, the minimum error prediction is to predict a value right in the middle, effectively making this trait invariant to its prediction.</p><p>Instead, the model will need to depend on other features that on average yield higher ratings. Like, let&#8217;s say pictures of people are rated more highly on average by both groups; the low ratings are slightly higher, and the high ratings are also slightly higher.</p><p>I would worry that at scale, over many different ratings, a lot of the nuance of what makes a certain image preferable is canceled out, and we are left only chasing a mean that embodies a bunch of &#8220;safe&#8221; traits that are meant to be universally receptive but appeal specifically to no one!</p><p>The space of human reward functions is extremely variant and often contradictory. Here, the floor axes represent different kinds of images, and the vertical axis shows how highly a certain person may rate them. For a model to estimate such noisy variant scores from many people with the least error, it would learn the mean preference, which, notice, is not rated highly by anyone here. We&#8217;re trying to fit a single reward function to many highly incompatible reward functions that each exist in our data in conflicting ways, which manifests as highly variant, inconsistent datapoints, making it difficult to fit to.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sLhT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sLhT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 424w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 848w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 1272w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sLhT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png" width="776" height="499" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:499,&quot;width&quot;:776,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!sLhT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 424w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 848w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.png 1272w, https://substackcdn.com/image/fetch/$s_!sLhT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d89f5ad-7033-445a-a663-8667a7edb045_776x499.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>In neural network modeling, we have explainable variance and variance from noise. Explainable variance is something we can exploit in learning, variance from noise is just something we have to deal with. If we trained a classifier on cats and dogs, we&#8217;d hope that the change in visual features corresponds nicely to the change in labels. However, if the labels are unreliable and noisy, like if we just randomly labeled each image, the model would likely converge to outputting p=0.5 for every image, as this would be the safest bet it can make with no pattern it can reliably depend on.</p><p>The variance we have in labels and scores here, while it is sampled in a meaningful way, may manifest as noise due to trying to learn from partial subsets of many exclusively different functions.</p><p>When our reward dataset is more objective, say, successfully solving math problems, rendering text that can be read correctly by an OCR, or the compressibility of an image, I think we can get away with it though.</p><p>A finding that might support the claim is that the LAION aesthetic predictor v2 was trained on a dataset of images labeled 0-10. Though in practice, we observe in generating predictions over millions of images, something like 99% of the data falls between 4-6, suggesting that the model learns a very conservative fit to the data due to the noisy labels. Granted, I also don&#8217;t know the nature of the labeling process.</p><p>Another way I like to visualize this problem is to imagine doing time series predictions.</p><p>Let&#8217;s imagine the pattern in blue occurs many times in the dataset. Half of the time it continues steeply upward, and the other half of the time is continues steeply downward.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!amsX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!amsX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 424w, https://substackcdn.com/image/fetch/$s_!amsX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 848w, https://substackcdn.com/image/fetch/$s_!amsX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 1272w, https://substackcdn.com/image/fetch/$s_!amsX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!amsX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png" width="668" height="468" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:468,&quot;width&quot;:668,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!amsX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 424w, https://substackcdn.com/image/fetch/$s_!amsX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 848w, https://substackcdn.com/image/fetch/$s_!amsX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.png 1272w, https://substackcdn.com/image/fetch/$s_!amsX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f7045c7-bd65-4798-a239-6d76fd2b01b0_668x468.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Just predicting the mean tells us a terrible story about what possible continuations might look 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_!hrF-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hrF-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 424w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 848w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 1272w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hrF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png" width="651" height="469" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:469,&quot;width&quot;:651,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!hrF-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 424w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 848w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.png 1272w, https://substackcdn.com/image/fetch/$s_!hrF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd9e3e0ad-0f5f-4ef1-adc6-9d3a34b9c8a6_651x469.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>If we predict mean and variance, we at least have a sense of spread, but still the majority of probability mass is on the center, which is inaccurate.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IxjE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IxjE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 424w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 848w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 1272w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IxjE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png" width="664" height="513" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:513,&quot;width&quot;:664,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!IxjE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 424w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 848w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.png 1272w, https://substackcdn.com/image/fetch/$s_!IxjE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa24af45f-74f8-4281-b092-0d86e6eed9c5_664x513.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Once we get to Gaussian mixture model territory, we can respect the multiple clusters of outcomes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!chWS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!chWS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 424w, https://substackcdn.com/image/fetch/$s_!chWS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 848w, https://substackcdn.com/image/fetch/$s_!chWS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 1272w, https://substackcdn.com/image/fetch/$s_!chWS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!chWS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png" width="712" height="492" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:492,&quot;width&quot;:712,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!chWS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 424w, https://substackcdn.com/image/fetch/$s_!chWS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 848w, https://substackcdn.com/image/fetch/$s_!chWS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.png 1272w, https://substackcdn.com/image/fetch/$s_!chWS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad145ec7-3c7e-4de9-b9df-7522429af0b4_712x492.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now, if we can accept that the typical strategy of reward modeling ignores a lot of nuance and focuses on the universal component instead of respecting clusters of human preferences, then we can consider some solutions. First we&#8217;ll discuss solutions for creating the actual reward model. We also need to figure out how to use that reward model to train an image model.</p><h2>Training more nuanced reward models</h2><h3>1) Gaussian Mixture models</h3><p>Noting that our data is composed of many multimodal distributions we&#8217;d like to learn, we can try using a model that is capable of fitting to such distributions. Namely, the Gaussian mixture model is composed of many Gaussians.</p><p>Let&#8217;s visualize our light and dark example. Again we have very split distributions of scores</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cDPP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cDPP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 424w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 848w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 1272w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cDPP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png" width="821" height="557" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:557,&quot;width&quot;:821,&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_!cDPP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 424w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 848w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.png 1272w, https://substackcdn.com/image/fetch/$s_!cDPP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F804a3e57-394d-4dbf-b2af-9f25335ced08_821x557.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>With a mixture of Gaussians, we can learn to divide and conquer. One Gaussian can take on modeling the light crowd, and the other can model the dark crowd. Because our data is split half and half, we&#8217;d likely also see that the mixing weights are [0.5, 0.5], which, if we were to mix, would have us right back where we started. But now, we have effectively factorized the view, we can assess looking at each Gaussian independently.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OPVJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OPVJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 424w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 848w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 1272w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OPVJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png" width="864" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:864,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!OPVJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 424w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 848w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.png 1272w, https://substackcdn.com/image/fetch/$s_!OPVJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5801426-7f39-4590-b8dc-15f20cfa88ef_864x540.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>One issue is that the number of Gaussians we choose to model with is an integer value. We don&#8217;t know how many Gaussians we should be using, which is a common issue in unsupervised clustering problems, i.e., how many means to use in k-means. However, all cases might still be more useful than the base case of a single Gaussian, and we can choose how much granularity we want.</p><h3>2) Conditioning on the rater</h3><p>If we have information about our raters, we could provide that as a condition to the model, factorizing the full distribution of ratings into many conditional Gaussians, where each one models a specific crowd. If we have any metadata as well about scores, i.e., users from Australia typically rate art from the 1970s with X score, these factors could also be engineered into a condition. We&#8217;re now modeling p(rater|x) for across many raters but still able to get p(x) through marginalization</p><h3>3) Z-vector or random condition.</h3><p>Similar to the spirit of VAEs, we may be able to inject a randomly sampled z-vector in one of the deeper parts of the network, and get a different rating per z-vector we provide</p><h2>Reinforcement Learning with our nuanced reward model</h2><p>A problem now is that in all of these cases, we are outputting multiple scores. The GMM outputs as many scores as we have Gaussians, conditioning on the rater gives us a possible score per rater condition, and there&#8217;s a similar scenario for the Z-vector case.</p><p>We could aim to maximize all scores, but then we&#8217;d be back at our original problem of getting an average output that is universally pleasing to all raters.</p><p>Instead, I think we should condition the generative model on the specific rater/vector and accordingly reward it as such. We can think of this like task embeddings, i.e., &#8220;make an output that is pleasing to rater 5.&#8221; In other words, we now have many, many reward models and many input conditions describing the task scenario. It should be equivariant, meaning as we swap the nature of evaluation, we also swap the nature of the instruction/task.</p><p>This expands our training space substantially, since we can train on a single image but also have many different scenarios to evaluate it on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RTxF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RTxF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 424w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 848w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 1272w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RTxF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png" width="816" height="603" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:603,&quot;width&quot;:816,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!RTxF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 424w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 848w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.png 1272w, https://substackcdn.com/image/fetch/$s_!RTxF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fee7b1230-83ce-4a92-88fe-31708fae69a6_816x603.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>]]></content:encoded></item><item><title><![CDATA[How Do We Tackle Noisy Recognition?]]></title><description><![CDATA[How to match human performance in assessing noisy/distorted data?]]></description><link>https://ethansmith2000.substack.com/p/how-do-we-tackle-noisy-recognition</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/how-do-we-tackle-noisy-recognition</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Wed, 09 Apr 2025 11:12:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Ese2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ese2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ese2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ese2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg" width="463" height="619" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:619,&quot;width&quot;:463,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Ese2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ese2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f31d416-7302-4e9a-af71-ff4129293d38_463x619.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Something I&#8217;ve been thinking about a lot lately is how humans handle noisy recognition. Maybe you recognize the image above, if not you probably haven&#8217;t seen the <a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTed_Kaczynski&amp;psig=AOvVaw1kN_55fFXzqblsxyEbXubX&amp;ust=1742816284399000&amp;source=images&amp;cd=vfe&amp;opi=89978449&amp;ved=0CBQQjRxqFwoTCJi7292OoIwDFQAAAAAdAAAAABAE">original image</a>. The fact is, many people do astonishingly recognize the person in the image, despite the fact that the image has been substantially downsampled and destroyed. However, the message/signal, the identity of the person, remains intact for us. How?</p><p>Meanwhile, AI visual models tend to fail hard at these perturbed recognition tasks, being vulnerable to even relatively mild amounts of image distortion.</p><p>The fact that current AI models can&#8217;t recognize this feels like a missing piece. Though another part of me wonders if we should even want AI models to be able to recognize these edge cases.</p><p>Not for reasons around robots beating Captcha&#8217;s or anything like that. More, is it a desirable trait for vision that we look at a smear of pixels and hallucinate something there that isn&#8217;t exactly present?</p><p>We can look at things like ink blots and clouds and see entire stories within them, and while this can serve as an interesting microscope into the psyche, is it a beneficial trait to have to project our minds onto reality?</p><p>Here, I want to discuss the status quo of how AI currently &#8220;sees&#8221;, how we might strategize an approach that allows for seeing obscured messages through &#8220;controlled hallucinations&#8221;, and whether this might be desirable.</p><h3>How AI Currently Sees</h3><p>Computer vision, in most familiar forms, operates in a <strong>bottom-up</strong> fashion. An incoming visual signal discretized onto a grid of pixels arrives at the input layer of a neural network and is propagated all the way through to the end to be processed into an semantic representation. In short, image -&gt; conceptual representation. This flow is unidirectional.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xtsz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xtsz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 424w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 848w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 1272w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xtsz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png" width="987" height="309" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:309,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;https://www.mdpi.com/2624-7402/4/4/56&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="https://www.mdpi.com/2624-7402/4/4/56" title="https://www.mdpi.com/2624-7402/4/4/56" srcset="https://substackcdn.com/image/fetch/$s_!Xtsz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 424w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 848w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.png 1272w, https://substackcdn.com/image/fetch/$s_!Xtsz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a1bd1a-b0e3-4c15-8df9-38968f4e5376_987x309.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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 href="https://www.mdpi.com/2624-7402/4/4/56">https://www.mdpi.com/2624-7402/4/4/56</a></figcaption></figure></div><p>An alternative form of flow is <strong>top-down processing, </strong>where we proceed in the reverse direction, beginning from the idea and mapping back to the visual stimuli. In short conceptual representation -&gt; image. This type of processing is typically reserved for generative tasks, where we may provide a text caption such as &#8220;a cat&#8221; to guide a model towards generating a picture of a cat.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TyTB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TyTB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 424w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 848w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 1272w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TyTB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png" width="715" height="308" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/825001af-3074-4a85-b753-bf29aa8e794f_715x308.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:715,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!TyTB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 424w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 848w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.png 1272w, https://substackcdn.com/image/fetch/$s_!TyTB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F825001af-3074-4a85-b753-bf29aa8e794f_715x308.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>There is some nuance we&#8217;ll uncover as we go on, but these modes often appear separately from one another, and for tasks such as image classification, segmentation, encoding, and visual language modeling, it typically manifests as somewhat exclusively bottom-up.</p><p>Vision, at minimum, requires bottom-up processing. We need some means of taking in a signal and further processing it. However, it is possible to have have visual processing that makes use of both forms.</p><h3>How Humans See</h3><p>This section is summarizes this <a href="https://www.youtube.com/watch?v=iPj9D9LgK2A">video</a> and also borrows visuals from it.</p><p>When perceiving, humans make use of a mixture of top-down and bottom-up processing.</p><p>Higher cognitive areas constantly generate models of what we expect to perceive based on prior knowledge, context, and recent experience. These predictions flow <em>downward</em> through the neural hierarchy.</p><p>Meanwhile, raw sensory data flows <em>upward</em> from our sensory organs. Importantly, what moves up isn&#8217;t all sensory data, but primarily the <strong>prediction errors</strong> - the differences between what was predicted and what was actually sensed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VlW2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VlW2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 424w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 848w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VlW2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg" width="635" height="403" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:635,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!VlW2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 424w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 848w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!VlW2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe72a55c9-02f3-42cd-8158-b58437678ea7_635x403.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The brain assigns different weights to prediction errors based on their estimated reliability. In clear conditions, sensory input gets higher weighting; in ambiguous situations, prior expectations may dominate.</p><p>The two streams attempt to align with each other and meet in the middle. We hold &#8220;hypotheses&#8221; about what might be in front of us, and send them <em>downward</em>. Meanwhile, the view of the object in front of us enters through the eyes and is sent <em>upward. </em>In other words, the final result of what we interpret is a mixture of what we guess and what actually enters the visual stream.</p><p>This is an efficient design that avoids computational waste by leveraging existing knowledge.</p><p>If the two streams agree early on, then there is no need for further processing, our hypothesis was correct. If not, the gates are opened for the visual signal to propagate further, and we adjust our hypotheses with the new incoming evidence. If you stare at the same thing for a while, there is no purpose in repeatedly processing the entire visual field. This becomes our new &#8220;default&#8221;, and we then only need to process the changes or residuals from this new default. <strong>We depend on expectations, and only process unexpected information, which then becomes part of our expectation</strong>. The entirety of this scheme is known as Predictive Coding.</p><p>Additionally, the top-down stream allows for generating plausible predictions when information is incomplete. For instance, if we see a cat walking out from around a wall, but can only see its head, based on the entirety of our past experiences, we make the reasonable leap of faith that this head is attached to a cat-like body with the same fur coloration as well.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gJzw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gJzw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 424w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 848w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 1272w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gJzw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png" width="800" height="429" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:429,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!gJzw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 424w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 848w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.png 1272w, https://substackcdn.com/image/fetch/$s_!gJzw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d29d7c9-df1b-4fee-bf40-8ff47b26fa44_800x429.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The top-down stream, in a sense, has the final say in this operation. We constantly generate &#8220;guesses&#8221; and then seek evidence to either confirm or reject our guess. Though it is also responsible for adjusting its beliefs when encountering errors or mismatches with new information entering our sight, aiming to minimize disagreement or &#8220;Free Energy&#8221;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HDp4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HDp4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 424w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 848w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 1272w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HDp4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png" width="736" height="385" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:385,&quot;width&quot;:736,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!HDp4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 424w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 848w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.png 1272w, https://substackcdn.com/image/fetch/$s_!HDp4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4bf0b8bc-7760-4b6b-9f87-bc1ce7d1afc7_736x385.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The top-down component is also quite important due to how little of the world the eyes actually take in. Artist renderings to be taken with grain of salt.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xhB4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xhB4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 424w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 848w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 1272w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xhB4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png" width="669" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:669,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;https://www.researchgate.net/figure/Normal-Vs-Tunnel-vision-example-The-top-picture-shows-a-healthy-vision-and-the-bottom_fig2_331409336&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="https://www.researchgate.net/figure/Normal-Vs-Tunnel-vision-example-The-top-picture-shows-a-healthy-vision-and-the-bottom_fig2_331409336" title="https://www.researchgate.net/figure/Normal-Vs-Tunnel-vision-example-The-top-picture-shows-a-healthy-vision-and-the-bottom_fig2_331409336" srcset="https://substackcdn.com/image/fetch/$s_!xhB4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 424w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 848w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.png 1272w, https://substackcdn.com/image/fetch/$s_!xhB4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e65a52d-d0ec-484d-b9ac-9e76a4b7afc5_669x367.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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 href="https://www.researchgate.net/figure/Normal-Vs-Tunnel-vision-example-The-top-picture-shows-a-healthy-vision-and-the-bottom_fig2_331409336">https://www.researchgate.net/figure/Normal-Vs-Tunnel-vision-example-The-top-picture-shows-a-healthy-vision-and-the-bottom_fig2_331409336</a></figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oGWA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oGWA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 424w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 848w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 1272w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oGWA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp" width="736" height="413" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:413,&quot;width&quot;:736,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;https://www.reddit.com/r/Damnthatsinteresting/comments/mr5cv5/how_our_brains_process_the_raw_image_our_eyes/&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="https://www.reddit.com/r/Damnthatsinteresting/comments/mr5cv5/how_our_brains_process_the_raw_image_our_eyes/" title="https://www.reddit.com/r/Damnthatsinteresting/comments/mr5cv5/how_our_brains_process_the_raw_image_our_eyes/" srcset="https://substackcdn.com/image/fetch/$s_!oGWA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 424w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 848w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 1272w, https://substackcdn.com/image/fetch/$s_!oGWA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe517ae75-fb5b-4a39-bdf6-a78eb7acba13_736x413.webp 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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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 href="https://www.reddit.com/r/Damnthatsinteresting/comments/mr5cv5/how_our_brains_process_the_raw_image_our_eyes/">https://www.reddit.com/r/Damnthatsinteresting/comments/mr5cv5/how_our_brains_process_the_raw_image_our_eyes/</a></figcaption></figure></div><p>There is much in our vision that we see that isn&#8217;t actually present, and some things that are present but only obstructive, like our blind spot. Our top-down processing can learn to ignore the constant parts and fill in the gaps of the parts we need to know.</p><p>This assumptive mechanism is also the same reason optical illusions can fool our visual system, like how an inside out mask still looks right side up given how used to we are seeing faces in this manner. We have learned a number of predictive context clues depending on lighting, shadows and contiguity of edges that can sometimes fail us when applied in edge cases. It is also the reason we may see things in the dark that aren&#8217;t there-- our top-down processing is still generating guesses, but it has little to no sensory input to keep it in check, causing it to dominate the resulting interpretation. Psychoactive drugs which alter our perception, can also be explained as interfering with the balance between top-down and bottom-up, as well skewing the actual mechanism of each.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nLMv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nLMv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 424w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 848w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 1272w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nLMv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png" width="572" height="317" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:317,&quot;width&quot;:572,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!nLMv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 424w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 848w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.png 1272w, https://substackcdn.com/image/fetch/$s_!nLMv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F907b2266-68a7-471a-ad89-ad3e9f5478f2_572x317.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vOiy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vOiy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 424w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 848w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 1272w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vOiy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png" width="415" height="316" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:316,&quot;width&quot;:415,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!vOiy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 424w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 848w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.png 1272w, https://substackcdn.com/image/fetch/$s_!vOiy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94e7713f-d6f9-453c-96fe-1281e5cfaa92_415x316.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aOs8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aOs8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aOs8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg" width="547" height="308" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:308,&quot;width&quot;:547,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!aOs8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aOs8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffbca9b69-6a05-4015-b911-f1d0c1bea92e_547x308.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Perception that works by mixing our expectations (priors) and raw senses (evidence) to produce the final result (posterior) is considered a Bayesian approach, a statistical framework that takes into account not just what we learn but all of what we already know.</p><p>We know at least this method of perception is desirable from an efficiency standpoint, but here, we&#8217;ll imagine AI has infinite compute. What is in question is whether the strategy of cycling guesses with evidence until agreement is reached is a trait we want AI to have.</p><p>Dreaming is also an interesting case here. In a dream you both construct an experience, and experience it as well.</p><p>Thus far, it appears that it can be useful for generalization to new unseen scenarios, but optical illusions reveal a few failure modes. Though ultimately, whether the benefits outweigh the cons is up for debate.</p><p>These controlled hallucinations are incredibly useful when they are right, but are problematic when wrong. So if we do opt for this route, it seems essential to understand how to build in assumptions that are correct most often and can adapt readily to failures.</p><h3>AI that performs both bottom-up and top-down</h3><p>There are a few cases of neural networks, I would argue, that do make use of the dual-stream approach.</p><p>While a pure one-step generative model like normalizing flow models or GANs do not appear to be exercising bottom-up, multi-step methods like diffusion do.</p><p>Diffusion model generation begins with a canvas of pure noise, which we can analogize to a lack of signal, or a scrambled signal, like looking at a cloud or seeing in the dark.</p><p>At the very first step, without much context to work with, our guess at what the final image looks like is primarily top-down.</p><p>From our guess, we then slightly update or refine our canvas to add a bit of context to it, now treating it as signal we will then read bottom-up in the next step.</p><p>As we continue removing noise from the canvas the data is revealed, lessening the role of top-down processing and increasing the role of bottom-up.</p><p>Typically when a diffusion generation is visualized, we are observing the current state of the noisy canvas. However here is a visualization of what our guess is of the final denoised output at every step. In early steps, this changes significantly. Our context is low, so our hallucinated end result is in flux. But as we add more context, it starts to solidify as agreement is reached.</p><p><strong>A key difference here is that we are allowed to update the data with our guesses. Normally in human perception, your guesses need to adapt to the static unchanging phenomena. However, here the guesses actually change reality and modify what is received bottom-up on the next step. The model takes a look, add its own hallucination on top of it, rinse and repeat until the hypothesis and the visual signal become the same.</strong></p><p>Another example of this is Google&#8217;s DeepDream. DeepDream takes a model that is purely bottom-up but runs optimization to reverse the flow of the model. At every step, we encode the canvas, compare it to a reference concept (for instance, how much does this image embody &#8220;dogness&#8221;?) and then optimize the image to embody more of that concept. Once again, we are modifying reality per se. The resulting images are quite reminiscent of psychedelic visuals, possibly hinting at what happens when top-down processing overpowers bottom-up</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xDP5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xDP5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 424w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 848w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xDP5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg" width="607" height="471" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:471,&quot;width&quot;:607,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!xDP5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 424w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 848w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!xDP5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f0c7f2a-dc25-404e-a049-46856c26a2f2_607x471.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This is why outputs of models are often referred to as hallucinations. Not just when they hallucinate the wrong answer, but more generally the entirety of their outputs begin from nothing or partial context, and then are built by by a cycle of reading the current state and making a guess that is written back onto the canvas.</p><p>Hallucination is a feature, not a bug. It is the whole means by which we are able to generate new content. It is only problematic when the continued sentence by the language model tells me Paris is the capital of Antarctica. However, when the model correctly tells me Paris is the capital of France, it has still hallucinated one of many possible text continuations, just one that happens to align with our reality. Therefore, the holy grail lies in achieving controlled hallucinations.</p><p>However, when we feed an image to a visual language model for it to answer questions on, the visual signal itself is static. While the text thereafter is hallucinated, the image itself is processed entirely bottom-up.</p><h3>How could we achieve top-down/generative recognition in AI? What are the advantages?</h3><p>A few thoughts come to mind as to how we may develop recognition models with top-down processing.</p><p>This is a <a href="https://x.com/u_m_a_m_i/status/1902815388104090084">prime example</a> of where we&#8217;d want to be cautious. Upscaling a heavily compressed image of someone reveals the model&#8217;s priors/biases, biases that do not align with our own. With a popular image of someone famous like Obama has a high level of expectation/bias given the iconicity, plus perhaps the fact that the features we most depend on for recognition may remain more intact despite the destruction, the distorted signal is enough to trigger proper identification for us. However, for the model, imaginably trained on a dataset of disproportionately white people, is biased in a different direction.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QcpP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QcpP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 424w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 848w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 1272w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QcpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp" width="841" height="429" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:429,&quot;width&quot;:841,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!QcpP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 424w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 848w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 1272w, https://substackcdn.com/image/fetch/$s_!QcpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2429e060-407f-4e46-83c3-f552b750d4ba_841x429.webp 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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now the funny thing is with guesses from partial, compressed, or distorted information like this is that <strong>there is no right answer</strong>. For all we know, both we and the model are wrong and the distorted picture of Obama is actually a close Obama look-alike. When going from low information to higher information content, we inevitably have to fill in and hallucinate the gaps.<strong> It is a one-to-many problem in that there are many possible high information data that when compressed could give the exact observed downsampled version.</strong> Every person and AI model has different inductive biases as to what they will assume, and its quite possible someone who has never seen Obama could make a guess of something like the example on the right.</p><p><strong>Confidence</strong></p><p>Where this becomes appalling is the confidence the model appears to show. When people don&#8217;t immediately recognize a downsampled image, we might admit, we don&#8217;t know who it is. Instead of jumping to a conclusion, an exact sample, we may sit in the superposition of all the possibilities it could be without actually committing to any answer. The model on the other hand, whether a stochastic or deterministic upsampler, is asked to deliver a sample instead of a superposition. I would equate this to being given a downsampled image of a person and someone forcing you to make a high-fidelity sketch of what this person could look like. You&#8217;d have to rely on your biases to fill in the gaps.</p><p>A lot of models are actually capable of exposing their uncertainty, its just not often revealed. For instance, the sharpness of a VAE distribution or a categorical distribution for discrete reveals something of the model&#8217;s confidence in its answer.</p><p>Nonetheless, it feels important to use confidence/uncertainty measurements as a guardrail against incorrect hallucinations. This is some of the philosophy behind projects like <a href="https://github.com/xjdr-alt/entropix">Entropix</a> which use the entropy of model predictions to choose what words a language model puts out.</p><p><strong>A Common Language to communicate by</strong></p><p>One neat thing about sharing similar biases and priors is that it <strong>enables communication of data that would be stored in a large number of bytes but as very compressed versions</strong>. Despite the highly compressed Obama, we, the humans, got the message across, and you could probably compress the image quite a bit further. A similar case for the photo up by the title of this post.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PSKn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PSKn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 424w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 848w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 1272w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PSKn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png" width="375" height="355" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6feb562f-e060-414e-919b-4854faa50495_375x355.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:355,&quot;width&quot;:375,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!PSKn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 424w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 848w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.png 1272w, https://substackcdn.com/image/fetch/$s_!PSKn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6feb562f-e060-414e-919b-4854faa50495_375x355.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We can speak in highly compressed codes because we know what the code represents. This is also why we can convey rich ideas in the language we speak, but are clueless to languages we are unfamiliar with. More subtly, when it comes to slang or words with multiple meanings, people of your in-group may immediately get what you mean, but those with different biases/expectations might understand your speech to mean something else. This is one place humans may still be able to beat machines on Captcha&#8217;s. We share biases and experiences that we are yet to crack with AI, and thus gravitate towards a common &#8220;answer&#8221; or that is not an obvious choice for machines.</p><p>This was especially apparent for problems in the <a href="https://arcprize.org/">ARC-challenge set</a>. As a primer, given the sequence 1,2,1,2,1,2,_,_. what would you imagine comes next? Probably 1,2. Though this is not a &#8220;correct&#8221; answer. The masked portion of the sequence could be anything, maybe it starts going 1,2,3,4,1,2,3,4 and looping that until 1,2,3,4,5,6. A new pattern. But we are all commonly biased to recognize the original a reasonable solution, so much so that it feels obvious. The ARC challenge was similarly interesting in that AI got some problems right that appear very difficult to humans, and some wrong that appear obvious to humans. We differ in how the solutions we gravitate towards in ambiguity. Humans are right in similar ways and wrong in similar ways to other humans, emphasizing the common mental models we share.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!m__2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m__2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 424w, https://substackcdn.com/image/fetch/$s_!m__2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 848w, https://substackcdn.com/image/fetch/$s_!m__2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 1272w, https://substackcdn.com/image/fetch/$s_!m__2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m__2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png" width="588" height="571" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:571,&quot;width&quot;:588,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!m__2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 424w, https://substackcdn.com/image/fetch/$s_!m__2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 848w, https://substackcdn.com/image/fetch/$s_!m__2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.png 1272w, https://substackcdn.com/image/fetch/$s_!m__2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84451a67-e46f-4dd3-b683-cd6375e38fe0_588x571.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I would go as far to say that these specific biases, what&#8217;s hallucinated in every scenario, embodies not only the remaining gap between AI and humans, but also what differentiates humans between each other and makes each one unique.</p><p><strong>Multimodal LLMs hallucinating in the image space.</strong></p><p><em>Note, this is more fun speculating than anything, I don&#8217;t have a ton of intuition to go off to imagine these approaches would result in aligning with human biases and solving our problem.</em></p><p>Normally, multimodal LLMs receive clean images, in contrast to the diagrams of human vision which has a narrow focal point. So perhaps the opportunity to make use of hallucinated vision isn&#8217;t really present in the first place given the image is already fully intact.</p><p>So, it would seem we&#8217;d want to somehow perturb the image + give the model a chance to restore the perturbation before generating text. The kind of noising we choose biases the model into relying on certain features, i.e. gaussian noise wipes out higher frequency details forcing dependence on lower frequencies. In the limit, one could craft a perturbation strategy that would aim to mimic human vision by giving it the same flaws (but also need to give it the same pros somehow as well? Like boosting outlines or contrast?)</p><p>Though, performing something like masking and prediction or noising and denoising with a separate model just to feed it through to the VLM afterwards just feels like a data preprocessing, or at the very least, somehow this would need to be jointly trained and part of the same objective.</p><p>Somehow, what I&#8217;d like to do is create a sequence of refinements preceding the LLM&#8217;s answer. Something like this</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jTi_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jTi_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 424w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 848w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 1272w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jTi_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png" width="803" height="491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/88d223e2-0797-4654-b362-4df2e8e94910_803x491.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:491,&quot;width&quot;:803,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!jTi_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 424w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 848w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.png 1272w, https://substackcdn.com/image/fetch/$s_!jTi_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F88d223e2-0797-4654-b362-4df2e8e94910_803x491.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At train time, only the noisy observation would be shown. In place of noising, one could also remove patches of the image, or apply blur around a focal point.</p><p>I&#8217;d like to somehow also encapsulate a looped reasoning process, where we alternate between a text hypothesis and an image hypothesis. To do this, I think we could rearrange to move text to the middle. This can then be looped by truncating context, noising the new reconstruction, and then let that serve as the noisy observation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9WLU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9WLU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 424w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 848w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 1272w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9WLU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png" width="829" height="683" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:683,&quot;width&quot;:829,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!9WLU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 424w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 848w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.png 1272w, https://substackcdn.com/image/fetch/$s_!9WLU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcb547e43-eaad-4fff-93a4-8f7401f7877a_829x683.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>What I would imagine doing here is looping this process until we reach a steady state where neither text nor image end up changing much, this would be perhaps a sign that generative processes and recognition processes are in equilibrium. One might notice that this somewhat resembles a VAE where everything is in context. A noisy observation is encoded into text stochastically and then stochastically decoded.</p><p>One issue here though is I could imagine potentially veering off away continually rather than converging. To ensure we have a way of anchoring ourselves to the original data, we could potentially show two noisy observations:</p><ul><li><p>one which is the original noised data</p></li><li><p>one which is the most recent noised sample</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_!x2U6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x2U6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 424w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 848w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 1272w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x2U6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png" width="816" height="580" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:580,&quot;width&quot;:816,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!x2U6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 424w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 848w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.png 1272w, https://substackcdn.com/image/fetch/$s_!x2U6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74ec8c29-46dc-417a-bb48-c96c77b2d613_816x580.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><strong>Multimodal LLMs hallucinating in the text space.</strong></p><p>The second approach I would imagine is... already happening! When you give a VLM an image and have it reason in text space before giving an answer, I would argue that generated text serves as hallucinating on top of the original visual observation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GNVG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GNVG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 424w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 848w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 1272w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GNVG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png" width="987" height="321" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!GNVG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 424w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 848w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.png 1272w, https://substackcdn.com/image/fetch/$s_!GNVG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fea3387-d87c-4782-98b8-d60d87cbf975_987x321.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>As more text is generated, later text then conditions on both the original image, but also previous text it has seen.</p><p>If we imagine prompt injecting &#8220;This may look like a cat, but don&#8217;t be fooled, its a human in a costume, consider this when delivering your answer&#8221; this would inevitably affect our final output. Or before receiving the image, imagine prefixing the text, &#8220;You are an artist looking for something to paint&#8221; or &#8220;You are a historian looking through photos of the 2000s&#8221;. This also may skew the intrerpretation.</p><p>I would call this &#8220;External Hallucinations,&#8221; where text is injected into the reasoning chain influencing how the model interprets the image.</p><p>If we imagine having a multi-turn conversation with an LLM, giving it an ambiguous picture like the Downsampled Obama, it might volley ideas at us as to what the picture contains and be met with our feedback. After enough back and forth, its answer can be influenced by the picture plus the whole script of text containing both its own generated text plus ours.</p><p>A criticism with this approach is the actual image features, when encoded, are entirely deterministic and invariant to anything else the model writes after.</p><p>As stated previously, I don&#8217;t know if this is exactly a desirable trait, nor how much these methods will give us what we&#8217;re looking for. After all, the first method I could imagine possibly harming performance. Though it would be really interesting to know what it would take to get a model to recognize the picture at the top of this without seeing something like that in a dataset.</p>]]></content:encoded></item><item><title><![CDATA[Boneless Attention and Low Rank Attention Layers]]></title><description><![CDATA[Building up attention from scratch, one step at a time]]></description><link>https://ethansmith2000.substack.com/p/boneless-attention-and-low-rank-attention</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/boneless-attention-and-low-rank-attention</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 23 Mar 2025 10:09:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OVSr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OVSr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OVSr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OVSr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg" width="819" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:819,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!OVSr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OVSr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff389d50b-cf6e-4b81-b4c7-3f768a8dc31f_819x489.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I&#8217;ve seen a lot of convoluted tutorials on attention but nothing really made it click for me more as understanding as <strong>mixing a projected version of your tokens across a sequence weighted by their &#8220;softmaxed&#8221; unnormalized correlations in a different space.</strong></p><p>Let&#8217;s strip that back a bit and assess each part</p><ul><li><p><strong>Projected version of your tokens</strong></p><ul><li><p>We&#8217;re not mixing the original copy of the tokens, but the <strong>Value</strong> projected versions.</p></li></ul></li><li><p><strong>Unnormalized</strong></p><ul><li><p>correlation is measured by dot product, with is unbounded as opposed to being in between [-1,1]</p></li></ul></li><li><p><strong>Correlations</strong></p><ul><li><p>the NxN matrix of the dot products between every vector combination. These are the mixing weights, for new tokens to be created as weighted sums.</p></li></ul></li><li><p><strong>In a different space</strong></p><ul><li><p>tokens are first projected into another space by <strong>Query/Key</strong> projections when calculating the correlations</p></li></ul></li><li><p><strong>Softmaxed</strong></p><ul><li><p>As opposed to using the values of the unnormalized correlations directly as is, we apply the softmax kernel which normalizes and &#8220;sparsifies&#8221; the weights.</p></li></ul></li></ul><p>Let&#8217;s try <strong>mixing your tokens across a sequence weighted by their unnormalized correlations. </strong>Sans<strong> </strong>the &#8220;different space&#8221;, &#8220;projected version of your tokens&#8221;, &#8220;softmaxed&#8221; parts. We&#8217;ll then build up to attention from there.</p><p>If you&#8217;d like to follow along, all experiments are performed in this <a href="https://github.com/ethansmith2000/TransformerExperiments/blob/main/train_gpt.py#L132">repo</a>.</p><h3>1) Boneless Attention. Just correlation</h3><p>Before drawing out this minimal attention with matrices and vectors, let&#8217;s look at it in a symbolic way.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vbsK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vbsK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 424w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 848w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 1272w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vbsK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png" width="468" height="155" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:155,&quot;width&quot;:468,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!vbsK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 424w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 848w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 1272w, https://substackcdn.com/image/fetch/$s_!vbsK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b6183e-49cc-46f5-b125-3c31d76ed8a2_468x155.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Each one of these arrows/vectors is a <strong>token</strong>. The vector is in 2d space and can be described with an x coordinate and a y coordinate. The full set of vectors is our <strong>sequence.</strong></p><p>Now, we&#8217;d like to create a new set of arrows aka vectors aka tokens, by mixing our existing ones together, but the ratios we mix them at should correspond to how similar or related they are. How can we measure how correlated two tokens are? By how closely they point in the same direction.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tgQx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tgQx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 424w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 848w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 1272w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tgQx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png" width="643" height="345" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:345,&quot;width&quot;:643,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!tgQx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 424w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 848w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.png 1272w, https://substackcdn.com/image/fetch/$s_!tgQx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4dc00d5-6b2c-45c7-abfb-29a8dc9d3586_643x345.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Here, we&#8217;ve plotted the similarities of the first token with the others. The opacity of the red arrows represents how similar the first token is with the one it is pointing to. Note, we are also having it point to itself.</p><p>Now with our similarities in hand, we can mix the tokens to obtain a new token corresponding to the first in this sequence.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S9ro!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S9ro!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 424w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 848w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 1272w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S9ro!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png" width="569" height="536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:569,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!S9ro!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 424w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 848w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.png 1272w, https://substackcdn.com/image/fetch/$s_!S9ro!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92c6fc55-35ea-4b8c-af06-ea59915889a9_569x536.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We can illustrate that a given token should contribute less to the output by making it smaller. When we add all the vectors up tip to tail we&#8217;ll see it has less of an effect.</p><p>We then repeat the process for all the other vectors in our sequence.</p><p>Now we&#8217;re ready for a bit more mathy notation.</p><p>First, we need our correlation matrix.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5UD5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5UD5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 424w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 848w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 1272w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5UD5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png" width="987" height="493" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:493,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!5UD5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 424w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 848w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.png 1272w, https://substackcdn.com/image/fetch/$s_!5UD5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec54df2c-77f5-4f66-8ceb-ccd3834ae19f_987x493.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Next we will &#8220;mix&#8221; our tokens, as a weighted sum with weights determined by the values in the correlation matrix.</p><p>Because we have 3 vectors, each new vector will be a mix of those 3. Looking at the first one (on the left cell of the blue row), we have:</p><p>Now doing them all simultaneously, as a matrix multiplication.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7Neg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7Neg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 424w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 848w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 1272w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7Neg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png" width="987" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!7Neg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 424w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 848w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.png 1272w, https://substackcdn.com/image/fetch/$s_!7Neg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4ad604a7-d768-4e7b-8154-fb0af2627cc4_987x487.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Notice that the vectors didn&#8217;t change a ton, aside from changing length a bit and slight shifts to direction, a product of the fact that they highly interacted with themselves but not as much their peers.</p><p>If we repeat this process over and over again, vectors that are less than 90 degrees apart from each other will increasingly move closer to each other.</p><p>This stripped back form of attention, but also attention somewhat in general, I like to describe as a &#8220;consensus&#8221; algorithm. It encourages the vectors to all agree on a direction, which is a smoothed, mixed result of all the initial vectors. <strong>This is a parameterless (boneless) attention. There are no learned weights.</strong></p><p>However, this explosion of length makes for not such an exciting operation.</p><p>Next up, enter softmax.</p><h3>2) Boneless Attention. Softmaxed correlation,</h3><p>Same as before, except now we&#8217;ll apply softmax normalization to the correlation matrix. This makes the weights sum to one, avoids negative values, and also has the capability of &#8220;sparsifying&#8221; the operation, often driving many values close to 0.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Grob!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Grob!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 424w, https://substackcdn.com/image/fetch/$s_!Grob!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 848w, https://substackcdn.com/image/fetch/$s_!Grob!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 1272w, https://substackcdn.com/image/fetch/$s_!Grob!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Grob!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png" width="876" height="465" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:465,&quot;width&quot;:876,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Grob!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 424w, https://substackcdn.com/image/fetch/$s_!Grob!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 848w, https://substackcdn.com/image/fetch/$s_!Grob!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.png 1272w, https://substackcdn.com/image/fetch/$s_!Grob!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb570f41c-b9f6-46eb-b38e-06fa4ec11995_876x465.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now, despite having no actual parameters, I&#8217;d argue this confers some practical value.</p><p>One <a href="https://github.com/ethansmith2000/attention-cluster/blob/main/color_extract.ipynb">example</a> is where I used parameterless attention as a clustering algorithm for colors in an image.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!556n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!556n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 424w, https://substackcdn.com/image/fetch/$s_!556n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 848w, https://substackcdn.com/image/fetch/$s_!556n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 1272w, https://substackcdn.com/image/fetch/$s_!556n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!556n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png" width="645" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&quot;width&quot;:645,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!556n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 424w, https://substackcdn.com/image/fetch/$s_!556n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 848w, https://substackcdn.com/image/fetch/$s_!556n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.png 1272w, https://substackcdn.com/image/fetch/$s_!556n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12b228e5-976f-48c3-a28f-8665b04fcfa8_645x624.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Another, is that you can actually train transformer networks like language models using this kind of layer. The performance is not nearly as satisfying, but its also very far from terrible, raw correlation alone is at least doing something. (this is 1000 steps on GPT2 just as a proof of concept, so take with a <em>massive</em> grain of salt)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O5F6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O5F6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 424w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 848w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 1272w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O5F6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png" width="539" height="413" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:413,&quot;width&quot;:539,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!O5F6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 424w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 848w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.png 1272w, https://substackcdn.com/image/fetch/$s_!O5F6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f2fc423-2e43-4184-80b4-92f1cbd2f1ac_539x413.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now, let&#8217;s add in the Value projected version of our tokens.</p><h3>3) Attention. Softmaxed correlation, weighted sum over Value projected versions</h3><p>Here, as opposed to using the same versions of our original vectors for both determining correlation weights, and what tokens get mixed together, we&#8217;ll use a separate set for the vectors to be mixed.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rjAh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rjAh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 424w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 848w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 1272w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rjAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png" width="987" height="581" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:581,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!rjAh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 424w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 848w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.png 1272w, https://substackcdn.com/image/fetch/$s_!rjAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fe10747-6e8a-4839-8db4-82a77ca68e04_987x581.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This can give us a bit more of an uplift. Interestingly, loss plummets faster initially, perhaps because correlation in native space as opposed to one created by random projections may be a stronger starting place off the bat. But as Query and Key weights are given time to adjust, baseline quickly surpasses this modded version.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lVdS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lVdS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 424w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 848w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 1272w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lVdS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png" width="760" height="483" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:483,&quot;width&quot;:760,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!lVdS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 424w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 848w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.png 1272w, https://substackcdn.com/image/fetch/$s_!lVdS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b3cdc0-632b-4066-a609-acedb2b123ee_760x483.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>4) Bonafide Attention. Correlation can be taken in another space.</h3><p>Here now, we introduce the Query and Key learnable projection matrices. When we measure our correlations between tokens now, we&#8217;ll do them between two different versions of the original set.</p><p>Why would we want to do this?</p><p>One of our original problems with attention is that it is guided towards consensus, but not too much beyond that. We also found that the self-interaction was also always very high, sort of loosely explaining part of what the outcome will be before we even proceed.</p><p>By projecting to another space, we can more finely decide which tokens should correlate with each other, increasing the expressive power of attention.</p><p>This operation is WAY more flexible and expressive in higher dimensions, but we can imagine this simple 2d case where we have 4 vectors. We could apply a stretching transformation as such, increasing the similarity between nearby vectors and further decreasing it between ones farther away, letting us modify correlation weights and thus the output of attention.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PLft!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PLft!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 424w, https://substackcdn.com/image/fetch/$s_!PLft!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 848w, https://substackcdn.com/image/fetch/$s_!PLft!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 1272w, https://substackcdn.com/image/fetch/$s_!PLft!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PLft!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png" width="856" height="381" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d634537c-6eab-4564-9d27-94d241252b75_856x381.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:381,&quot;width&quot;:856,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!PLft!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 424w, https://substackcdn.com/image/fetch/$s_!PLft!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 848w, https://substackcdn.com/image/fetch/$s_!PLft!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.png 1272w, https://substackcdn.com/image/fetch/$s_!PLft!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd634537c-6eab-4564-9d27-94d241252b75_856x381.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GagS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GagS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 424w, https://substackcdn.com/image/fetch/$s_!GagS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 848w, https://substackcdn.com/image/fetch/$s_!GagS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 1272w, https://substackcdn.com/image/fetch/$s_!GagS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GagS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png" width="987" height="581" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:581,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!GagS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 424w, https://substackcdn.com/image/fetch/$s_!GagS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 848w, https://substackcdn.com/image/fetch/$s_!GagS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.png 1272w, https://substackcdn.com/image/fetch/$s_!GagS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faa4f4ef2-374f-466e-8e35-304a1e2f0c0c_987x581.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now for fun, let&#8217;s see what happens if we double the initial values of the correlations prior to feeding them to softmax. This should help give a feel of the advantages of softmax and its sparsifying properties. For some more interesting <a href="https://www.ethansmith2000.com/post/softmax-attention-is-a-fluke">tidbits</a> see here.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zkYS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zkYS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 424w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 848w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 1272w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zkYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png" width="987" height="596" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:596,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!zkYS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 424w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 848w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.png 1272w, https://substackcdn.com/image/fetch/$s_!zkYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76a2c0c5-2290-4584-aa87-f7fcbaf8ee37_987x596.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This then becomes the weights for the value tokens (green in previous diagrams) to be mixed by.</p><p>At this point, the tutorial is complete, this is attention! The remainder of this post is further experiments on attention leveraging the fact that it is somewhat similar to the idea of calculating raw correlations.</p><h3>5) Bonafide Attention. Initialize Query/Key projections to identity function</h3><p>Seeing the initial fast loss drop of the previous method, it seemed worthwhile to try initializing the Query and Key projection matrices to the identity function, BUT unlike pure &#8220;just correlation&#8221; attention, they are free to adapt from there. Perhaps this is a good place to start and adapt from?</p><p>This might be our strongest contender so far, though still baseline surpasses it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gdYn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gdYn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 424w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 848w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 1272w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gdYn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png" width="848" height="501" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:501,&quot;width&quot;:848,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!gdYn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 424w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 848w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.png 1272w, https://substackcdn.com/image/fetch/$s_!gdYn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F188acb1d-eb5d-4f75-b418-0ffb005f0c66_848x501.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I Imagine a counter argument here is that this kind of thing simply doesn&#8217;t optimize well, and we do our random initialization for a reason.</p><p>There&#8217;s still more we can try though. What is a common way we can include the identity function? Residuals!</p><h3>6) Bonafide Attention. Make Query/Key projections residual layers</h3><p>Here now we change the query and key calculation from</p><blockquote><p>Q = wQ(x) K = wK(x)</p></blockquote><p>to</p><blockquote><p>Q = wQ(x) + x K = wK(x) + x</p></blockquote><p>This is motivated by correlation making for a useful starting bias, but also wanting to give adequate freedom to the optimization process.</p><p>Here the two were now run for about 4k steps. The two are approximately neck and neck with residual attention seemingly having a slight edge.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JZoD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JZoD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 424w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 848w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 1272w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JZoD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png" width="848" height="496" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/157ae306-17e9-4500-9e13-0386e64f5720_848x496.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:496,&quot;width&quot;:848,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!JZoD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 424w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 848w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.png 1272w, https://substackcdn.com/image/fetch/$s_!JZoD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F157ae306-17e9-4500-9e13-0386e64f5720_848x496.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>A Discussion on Low Rank Attention Weights</h3><p>A point I&#8217;ve seen a few papers contend on is the rank we observe of the weights used in attention layers. This is approximated by taking the singular value decomposition and seeing how % of singular values are &#8220;properly large&#8221;.</p><p>Low rank layers are generally seen as a bad thing. It can suggest dimensional collapse and an <em>underutilization</em> of the network&#8217;s capacity. But is this always true? When we begin training, sampling our weights from normal distribution, our matrices begin as 100% full rank, so it can really only go down from there regardless.</p><p>An instance here is the the knowledge that CLIP embeddings are low rank, a few axes explain the majority of the variation in the output, making them feasibly much more compressible and lower dimensional than they reveal. Here we have the singular values extracted from the covariance matrix of 500,000 OpenCLIP VITG embeddings</p><p>It very rapidly approaches 0</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NyFa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NyFa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 424w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 848w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 1272w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NyFa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp" width="652" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:652,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!NyFa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 424w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 848w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 1272w, https://substackcdn.com/image/fetch/$s_!NyFa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F597feaea-8211-4f6a-a708-609ab02767e2_652x500.webp 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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We can also see how this affects the output by decoding the embeddings back into images, after pruning out smaller singular vectors. This is an example from the DALLE2 paper.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Lta5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lta5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 424w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 848w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 1272w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lta5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png" width="987" height="468" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:468,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Lta5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 424w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 848w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.png 1272w, https://substackcdn.com/image/fetch/$s_!Lta5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0192c8e-da79-4a66-97e8-2c553e52ba15_987x468.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Starting from the top 320 dimensions, we can prune out the last 120 with not a majorly substantial change to the output. Though once we get down to 40, 80 range we can see these larger dimensions are much more vital.</p><p>The <a href="https://arxiv.org/abs/2203.02053">Modality Gap</a> paper looks at CLIP in depth and the factors around contrastive learning that induce this low-rankness</p><p>This <a href="https://arxiv.org/pdf/2405.18570">paper</a> also then finds a way to address it, recovering full use of dimensions and slightly increasing performance.</p><p>So at least for embedding representations, low rankness seems undesirable but evidently far from catastrophic.</p><p>The paper, <a href="https://arxiv.org/pdf/2410.23819">Weight decay induces low-rank attention layers</a>, comes off as a scary title. However, the results are a bit surprising.</p><p>They measure low-rankness by the observed 95% saturation point. We can see that higher values of weight decay, indicated by lambda, very much reduces the rank of attention layers. I&#8217;m tempted to say the the charts on the right are particularly interesting, that the pseudo rank drops and then increases over the course of training, however this measurement doesn&#8217;t imply that dimensions have fully collapsed and then recovered, it could just as much be our largest dimensions decreasing as small ones increasing. Nevertheless it&#8217;d be interesting to see if that chart continued a bit more to the right.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AOZG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AOZG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 424w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 848w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 1272w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AOZG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png" width="987" height="739" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:739,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!AOZG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 424w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 848w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.png 1272w, https://substackcdn.com/image/fetch/$s_!AOZG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225281ac-36c7-450e-8946-0c742ddd10ef_987x739.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Despite finding this massive drop in rank, performance does not plummet in the same manner. In fact, performance seems to improve a bit in some cases, and this effect extends to MLP layers as well. The benefit could be explained by low-rankness, or it might be some other factor around weight decay shrinking the magnitude of weights offering regularization. It could also be the case that &#8220;pseduo-rank&#8221; might not be telling us the whole story. Regardless, it doesn&#8217;t correlate to the expected loss of performance we would imagine with decreased rank.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!06Wk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!06Wk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 424w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 848w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 1272w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!06Wk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png" width="904" height="577" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:577,&quot;width&quot;:904,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!06Wk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 424w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 848w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.png 1272w, https://substackcdn.com/image/fetch/$s_!06Wk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15caedd0-84e9-481a-b808-ad42760f04bd_904x577.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>So perhaps, this is not something we should aim to avoid but something we can lean into? Maybe attention layers, as they are, are over parameterized by dense matrices, but possibly this suggests this is a good place we can use structured sparse matrices like LoRA.</p><p>And this is kind of exactly what Deepseek&#8217;s Multi-Latent Attention does, both reducing computation a bit and the size of KV caches.</p><p>This was a similar motivation for the experiments on correlation done in this post. If correlation can already do alright, do we need such a heavily parameterized operation?</p>]]></content:encoded></item><item><title><![CDATA[Softmax Attention is a Fluke]]></title><description><![CDATA[Calibrated Attention]]></description><link>https://ethansmith2000.substack.com/p/softmax-attention-is-a-fluke</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/softmax-attention-is-a-fluke</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Thu, 13 Mar 2025 10:03:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ovmv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ovmv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ovmv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 424w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 848w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 1272w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ovmv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png" width="564" height="544" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:544,&quot;width&quot;:564,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!ovmv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 424w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 848w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.png 1272w, https://substackcdn.com/image/fetch/$s_!ovmv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F464d5d11-fcb6-4291-b2d3-9bfc9711dc6c_564x544.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div><hr></div><p><a href="https://github.com/ethansmith2000/calibrated_attention">Calibrated Attention</a></p><p><a href="https://github.com/ethansmith2000/nanoGPT_calibrated_attn">Calibrated Attention NanoGPT</a></p><p>Attention is the magic ingredient of modern neural networks. It is the core of what has launched performant language models into the spotlight starting with GPT, and since then, it has extended its hands across all modalities.</p><p>There are a number of desirable properties that make attention a first-class building block. Namely:</p><ul><li><p>It handles variable sequence lengths with ease</p></li><li><p>It allows for a global receptive field without needing to scale parameters</p><ul><li><p>as opposed to convolutional neural networks</p></li></ul></li><li><p>It enables dynamic routing of information between tokens</p></li><li><p>It is parallelizable and incredibly GPU-friendly</p></li></ul><p>The core principle of projecting tokens into another space, calculating their correlations, and using those as weights to define mixing strategies of the values is solid.</p><p>But here I want to very boldly claim that our specific choice of the well-known attention equation is a fluke. In particular, softmax appears to come out of nowhere.</p><h3>Why Softmax?</h3><p>Numerous papers have developed alternatives that did not end up making it to the mainstream for lack of competitive performance. So why dare to make the 1001th attempt to contend with this? Is it possible we got it right the first time?</p><p>To be fair, most attention alternatives aim to circumvent the O(n^2) scaling of computation in sequence length by attempting to linearize the computation or use cheaper, more flexible activation functions. Attempts to skirt around the cost may naturally lend themselves to drops in capability. Perhaps the O(n^2) is inevitable.</p><p>However, let&#8217;s stay with the core circuit of attention. The part I&#8217;d like to question is why specifically the exponential function, normalized across the sequence.</p><p>It&#8217;s a natural choice. Softmax appears all around neural networks. It is a sensible means of turning real-valued vectors into a row of probabilities. It is also nicely differentiable and has the ability to non-linearly &#8220;silence&#8221; and filter out noise to reveal signal.</p><p>Attention, I would argue, makes good use of the latter traits. Here&#8217;s an example of the suppression it can provide.</p><p>Let&#8217;s imagine here that we have taken one vector and dot&#8217;ed it with 10 others, loosely measuring their correlation scaled by norms. This is a plot of their interactions.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hO4i!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hO4i!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 424w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 848w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 1272w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hO4i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png" width="538" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:538,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!hO4i!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 424w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 848w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.png 1272w, https://substackcdn.com/image/fetch/$s_!hO4i!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3baf3b2e-9888-4ad4-b42c-a2374f9b9f7b_538x367.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>If we were to take a weighted sum of the 10 vectors with these coefficients, we could end up with a vector whose norm is quite large, where we generally like to have a consistent steady range of values for our neural network to run smoothly and not explode. So we can start by subtracting by the mean and sum normalizing it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ceka!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ceka!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 424w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 848w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 1272w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ceka!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png" width="549" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:549,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Ceka!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 424w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 848w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.png 1272w, https://substackcdn.com/image/fetch/$s_!Ceka!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4eec4de7-649d-4fdb-92d5-c6554741bb43_549x367.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This is okay, but note that our final output will be a pretty mixed blend of all the tokens. It&#8217;ll be 30% token 6, approximately 15% token 7 and 15% token 8 and so on.</p><p>But let&#8217;s say we wanted to pull out the token with the largest interaction, or maybe a few, and not have noise from the other tokens mixed in. This is a common desire in database lookups (an established analogy for the role attention and dot products play in neural networks) where we might take be interested in the top-k vectors.</p><p>We&#8217;ll want some means of setting the other positions to zero, but just doing <strong>max(x) </strong>or manually setting other positions to zero is not differentiable. Enter <strong>softmax</strong><em><strong>.</strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M4g7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M4g7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 424w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 848w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 1272w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M4g7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png" width="540" height="372" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:372,&quot;width&quot;:540,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!M4g7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 424w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 848w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.png 1272w, https://substackcdn.com/image/fetch/$s_!M4g7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feaadef7a-1bf3-4bac-a541-6f7bf245442a_540x372.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now if we take a weighted sum over the tokens, we almost recover the function of <strong>max(x). </strong>The output will be approximately ~99% token 6. This function has a useful winner-take-all nature to it via the nonlinear exponentiation followed by normalizing across the sequence. The growth of mass in one value means a loss in others, even being able to drive its comrades close to zero.</p><p>I&#8217;ve made a case up until now for why we really like softmax. It&#8217;s noise suppression is useful. Though the other aspect of softmax is its root in forming probability distributions.<strong> For that, there isn&#8217;t exactly a reason we need to think of attention mixing weights as probabilities.</strong></p><p>There are plenty of other kernels that can yield a similar effect. For example, x^3 actually gives a pretty similar result for this case</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_RqQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_RqQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 424w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 848w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 1272w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_RqQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png" width="540" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:540,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!_RqQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 424w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 848w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.png 1272w, https://substackcdn.com/image/fetch/$s_!_RqQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5ee34d9-dc06-48c9-b79c-adc5d47c2119_540x367.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>This is the argument of this <a href="https://arxiv.org/abs/2410.18613">work</a>, which reveals a number of polynomial kernels that can also perform well on toy tasks.</p><p>Additionally, do we need mixing coefficients to be exclusively positive? Why?</p><p>This was an argument I made <a href="https://www.ethansmith2000.com/post/dipole-attention-opposites-may-be-deep-connections">here</a>, where I argued that negative correlations may be just as much informative as positive ones, and it is perhaps the small correlations instead that should be suppressed. This later became a <a href="https://arxiv.org/abs/2411.07176">paper</a> under a similar motivation.</p><p>Lastly, another <a href="https://arxiv.org/abs/2005.09561">work</a> explored breaking free from typical normalization, allowing attention to take weighted sums outside of its convex cage.</p><p>So the questions I see are:</p><ol><li><p>Why e^x? Especially if we don&#8217;t need to use the values as probabilities?</p></li><li><p>Do we need sum-to-one normalization?</p></li><li><p>Why only positive values?</p></li></ol><p>None of these, however, feel like bugs.</p><p>We may find further merit in searching the space of alternatives that deviate from these conventions, but after all, as I said, softmax was a fair choice for a first iteration due to its common usage and it was sufficient to bring us where we are today.</p><p>However, there is one aspect around how normalization and scaling is treated that I do feel <em>is a bit of a bug </em>with attention. Particularly in cases where our sequence length can vary, like with causal language models.</p><h3>Normalization Across Variable Length Sequences</h3><p>Loosely summed up in this <a href="https://x.com/torchcompiled/status/1873100060680167917">tweet</a> here.</p><p>The one part I find particularly fragile about attention is the dynamics around normalization, and how it can vary depending on the length of the sequence. Firstly, let&#8217;s see a toy example of this in action. We&#8217;ll sample logits randomly from the Gaussian distribution across different lengths and apply softmax to them. Observe what happens to the size of the largest value, entropy, and overall sharpness of the distribution.</p><p>At 2 elements (Note: if we only had one element, 100% of the mass would go to it always, it would be a weighted sum over 1 element making attention pointless)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mn8X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mn8X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 424w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 848w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 1272w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mn8X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png" width="540" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:540,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!mn8X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 424w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 848w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.png 1272w, https://substackcdn.com/image/fetch/$s_!mn8X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0ed6fa0-c4ac-4405-8ca1-95cf2304ddcf_540x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At 5 elements</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ewCS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ewCS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 424w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 848w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 1272w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ewCS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png" width="548" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:548,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!ewCS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 424w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 848w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.png 1272w, https://substackcdn.com/image/fetch/$s_!ewCS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c56f667-b28c-42e9-bd8e-a2b92445c592_548x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At 25 elements</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VU2N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VU2N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 424w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 848w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 1272w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VU2N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png" width="557" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:557,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!VU2N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 424w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 848w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.png 1272w, https://substackcdn.com/image/fetch/$s_!VU2N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8f71f7f-d78a-4453-b967-308d39b039c3_557x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At 1000 elements</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0x-a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0x-a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 424w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 848w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 1272w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0x-a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png" width="557" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:557,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!0x-a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 424w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 848w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.png 1272w, https://substackcdn.com/image/fetch/$s_!0x-a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc0fb302d-65ad-49ce-b178-8fa0330f64df_557x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>The distribution becomes progressively more flat, entropy increases, and the largest value becomes much smaller.</p><p>This is not just a reality of Gaussian variables, but is also observed with attention maps from our models for a generated piece of text, namely GPT2-large here.</p><p>At length 5</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6pH8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6pH8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 424w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 848w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 1272w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6pH8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png" width="558" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8826db94-546a-474c-8821-592ae8467052_558x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:558,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!6pH8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 424w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 848w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.png 1272w, https://substackcdn.com/image/fetch/$s_!6pH8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8826db94-546a-474c-8821-592ae8467052_558x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At length 50</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T44Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T44Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 424w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 848w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 1272w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T44Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png" width="564" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:564,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!T44Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 424w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 848w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.png 1272w, https://substackcdn.com/image/fetch/$s_!T44Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d3d69db-d59d-4ed3-a5fc-cf9b2b469e8d_564x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>At length 250</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YFKM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YFKM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 424w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 848w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 1272w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YFKM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png" width="578" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:578,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!YFKM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 424w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 848w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.png 1272w, https://substackcdn.com/image/fetch/$s_!YFKM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F914e8293-12d7-4204-a8d8-f98088d86d17_578x389.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Ignore the first token for now, that&#8217;s something we&#8217;ll talk about later. With growing sequence length so does the requirement to produce outlier-ly large values to overwhelm all the others and achieve sharpness. We end up with many small spikes rather than few large ones. Now entropy naturally increases with the number of choices, though again, is it necessary to apply the probability lens to attention?</p><p>It took reading a few works before what&#8217;s happening really cemented in my mind, and now it&#8217;s impossible to look away from.</p><h3>Achieving Null Attention</h3><p>The first was <a href="https://www.evanmiller.org/attention-is-off-by-one.html">Softmax-plus-one</a>, which argues attention should be able to do &#8220;nothing.&#8221; I don&#8217;t consider this a huge issue, and not the aspect I think of as the aforementioned bug, but a solution here would feel like a &#8220;nice to have.&#8221;</p><p>This blog post criticizes the dependence the denominator has on the numerator. It could be the case that the a token would like to choose inaction, or have weighting coefficients that sum to less than 1 to reduce the magnitude of effect of a given attention layer.</p><p>Recall softmax looks like this</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jY2M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jY2M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 424w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 848w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 1272w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jY2M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png" width="432" height="128" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:128,&quot;width&quot;:432,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!jY2M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 424w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 848w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 1272w, https://substackcdn.com/image/fetch/$s_!jY2M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70a5a7b4-9621-473b-aeb6-1c1e75228424_432x128.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>In the current formulation, this isn&#8217;t particularly possible*. We can try to reduce our token-token interactions as much as possible, even making them exclusively negative, and attention would still have an effect. In fact, one could imagine an attempt at this kind of adaptation could backfire. If all correlations drop evenly, we&#8217;d approach a uniform distribution of attention as opposed to isolating a few candidates, which is exactly what brought us to using softmax in the first place!</p><p>The &#8220;fix&#8221; is to add a bias to the denominator, slightly decoupling the denominator&#8217;s dependence. It would now be possible to output very small values in the numerator but have the denominator remain as a constant value.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3GES!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3GES!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 424w, https://substackcdn.com/image/fetch/$s_!3GES!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 848w, https://substackcdn.com/image/fetch/$s_!3GES!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 1272w, https://substackcdn.com/image/fetch/$s_!3GES!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3GES!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png" width="447" height="140" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:140,&quot;width&quot;:447,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!3GES!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 424w, https://substackcdn.com/image/fetch/$s_!3GES!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 848w, https://substackcdn.com/image/fetch/$s_!3GES!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 1272w, https://substackcdn.com/image/fetch/$s_!3GES!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36fd7e3b-754f-44f3-abc9-24b54d5fa992_447x140.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If we imagine that</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1d3a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1d3a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 424w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 848w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 1272w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1d3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png" width="222" height="80" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:80,&quot;width&quot;:222,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8749,&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://ethansmith2000.substack.com/i/177784000?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.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_!1d3a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 424w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 848w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 1272w, https://substackcdn.com/image/fetch/$s_!1d3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3f8ac245-fab3-4cfd-90bf-1766d873b18f_222x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Then</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!u8Jk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!u8Jk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 424w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 848w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 1272w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!u8Jk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png" width="474" height="252" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:252,&quot;width&quot;:474,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20295,&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://ethansmith2000.substack.com/i/177784000?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.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_!u8Jk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 424w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 848w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.png 1272w, https://substackcdn.com/image/fetch/$s_!u8Jk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd62b8cdf-8680-4510-b235-30df9a6f867f_474x252.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Becomes approximately</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z_t0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z_t0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 424w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 848w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 1272w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z_t0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png" width="210" height="196" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:196,&quot;width&quot;:210,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:8848,&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://ethansmith2000.substack.com/i/177784000?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.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_!z_t0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 424w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 848w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 1272w, https://substackcdn.com/image/fetch/$s_!z_t0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb9b892e7-cf90-410f-9453-de69bd39fdc9_210x196.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Allowing for the capability to assign 0 weights everywhere, entirely nullifying attention. Though this can also appear more partially where exp(x) airs around small values below one allowing us to say, have our total weights sum to arbitrarily something like 0.2.</p><p>I have yet to see this implemented anywhere, and <strong>in my opinion the missing piece to practicality is that the denominator bias should be learned rather than fixed to 1. 1 is an arbitrary choice and may ask attention weights to output around a certain range of values that may be unnatural for it. (though this too, as we&#8217;ll see might not even be sufficient due to how the denominator&#8217;s size also depends on the exact length of our sequence as well, we may prefer a learned bias that is a function of the sequence size)</strong></p><p>But why would attention want to do nothing? I paid for the layer; am I wasting my FLOPs?</p><p>Inaction is actually a good bias to have in neural networks in general. It is often a good heuristic to firstly assume the identity function, no effect, and then increase the effect from there. This is partially the principle of why we use residuals everywhere nowadays; learning the identity function directly by gradient descent is actually quite difficult. We can instead hardcode the identity function and ask that the networks learns to predict what should be added to it, the residual.</p><p>I left an * above on the remark that inaction is impossible for attention layers. Despite a lack of conventional means of choosing to do nothing, we&#8217;ll often find that nature (neural networks) finds a way anyway in a form that is equal parts clever and aggravating. What you&#8217;ll find is that tokens will often put a really large portion of their attending mass to a meaningless token like a padding, or a comma, or beginning of sequence marker. This <a href="https://arxiv.org/abs/2309.17453">paper</a> aptly referred to this phenomena as <em>&#8220;Attention Sinks.&#8221;</em> A token is forced to attend to its bretheren up until it fulfills the entirety of its attention budget or mass. Though it can choose to just dump the majority of it onto a token that confers no effect.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9fMM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9fMM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 424w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 848w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 1272w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9fMM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png" width="987" height="327" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:327,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!9fMM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 424w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 848w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.png 1272w, https://substackcdn.com/image/fetch/$s_!9fMM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c6c2cce-27a2-48ca-a251-a489bcaae649_987x327.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I found similar effects very extensively in <a href="https://www.ethansmith2000.com/post/exploring-cross-attention-maps-in-diffusion-models">text2image models</a> and a bit also in <a href="https://www.ethansmith2000.com/post/clip-vs-t5-as-a-text-encoder-for-diffusion-models">text encoding models</a>.</p><p>This shows the attention of the image to tokens of the text prompt, where y axis is the amount of attention mass and the x axis is the token index. Here we are displaying, for every text token of the prompt, what is the maximum amount of attention it has ever received from the set of all image tokens. Across different attention heads</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DLdE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DLdE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 424w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 848w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 1272w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DLdE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png" width="987" height="329" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:329,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!DLdE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 424w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 848w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.png 1272w, https://substackcdn.com/image/fetch/$s_!DLdE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97c328c2-fb79-4247-a0a0-d702fdc7c4fd_987x329.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We can see there is a massive amount of attention on the very first token of the sequence which is the BOS token. Importantly, because CLIP here encodes the text prompt with causal masking, the BOS token is <em>entirely</em> invariant to the text prompt itself. It is the same regardless of what you put in and thus confers no information about the request. So the remaining hypothesis is that similar to Attention Sinks, we are attending to &#8220;dummy token&#8221; just to reduce the weights we place on the other informative tokens, reducing the magnitude of the output, which we would probably rather have a mechanism for scaling more directly!</p><p>Incredibly interestingly, we can also look at the norms of the projected values of all the text tokens. The norm of the BOS token approaches 0 meaning it gets quite close to being a vector of all zeros. If we place the majority of weight on this vector of zeros, our resulting output is pretty close to a vector of all zeros as well!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mwVr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mwVr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 424w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 848w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 1272w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mwVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png" width="673" height="509" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f2d48410-880c-4384-83c3-5082741025f4_673x509.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:509,&quot;width&quot;:673,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Token norm after projecting through the value matrix. X axis represents token index. Y axis represents token norm&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="Token norm after projecting through the value matrix. X axis represents token index. Y axis represents token norm" title="Token norm after projecting through the value matrix. X axis represents token index. Y axis represents token norm" srcset="https://substackcdn.com/image/fetch/$s_!mwVr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 424w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 848w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.png 1272w, https://substackcdn.com/image/fetch/$s_!mwVr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff2d48410-880c-4384-83c3-5082741025f4_673x509.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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">Token norm after projecting through the value matrix. X axis represents token index. Y axis represents token norm</figcaption></figure></div><p>Though I cannot help but feel this is maladaptive in the ways this requires the value projection matrices to adapt to the BOS token vector, and that there are better ways to achieve this effect.</p><h3>Sequence-Length Dependent Temperature.</h3><p>The other paper that made me realize the importance this played was <a href="https://arxiv.org/pdf/2306.08645">Training-free Diffusion Model Adaptation for Variable-Sized Text-to-Image Synthesis</a>. And this where I begin to see a bit of a potential bug in attention.</p><p>Firstly, they reiterate our previous observations that the entropy/sharpness of attention depends on the sequence length.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mSoj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mSoj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 424w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 848w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 1272w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mSoj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png" width="877" height="195" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:195,&quot;width&quot;:877,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!mSoj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 424w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 848w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 1272w, https://substackcdn.com/image/fetch/$s_!mSoj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F808c86e6-0a5f-42f8-b2ef-30a701fbe1d1_877x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>However, if we train on only one fixed sequence length, a common practice for image models at the time, we might expect the model to adapt the norms of the Queries and Keys to account for this. But when we go to test out other resolutions, we&#8217;re now extrapolating to a domain we are ill-adapted for. Their proposal is to train on one resolution as normal, but then at inference time, rescale the temperature scaling to attempt to match the expected entropy we would have at our learned, trained resolution.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gcyu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gcyu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 424w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 848w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 1272w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gcyu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png" width="628" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:628,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!gcyu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 424w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 848w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.png 1272w, https://substackcdn.com/image/fetch/$s_!gcyu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9cf49c4-56a0-45a9-ba99-afcd94aa21f3_628x487.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>However, the need for a relative anchor makes it a bit of a band-aid approach and its common to train across multiple resolutions simultaneously. We can&#8217;t match our scaling to that of a trained length if this is a moving target. We&#8217;d really like to have this built into the attention equation itself at train time.</p><p>On the topic of handling multiple sequence lengths simultaneously, language models, which train with causal masking, zero out the logits of tokens to the right (future) for a given token.</p><p>So technically, if we&#8217;re training at a sequence length of say, 4096, attention is effectively batching queries that attend to a sequence of length 1, a sequence of length 2 ... all the way to a sequence of 4096 simultaneously.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dvv3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dvv3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 424w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 848w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 1272w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dvv3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png" width="501" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:501,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Dvv3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 424w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 848w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.png 1272w, https://substackcdn.com/image/fetch/$s_!Dvv3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b668f49-6527-4194-aa71-6cecedbd3ff0_501x484.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>As stated before, our query and key projection matrices can adapt themselves to output queries and keys that have norms allowing to achieve desired levels of entropy.</p><p><strong>But here&#8217;s the problem, the same matrices are being used for all tokens. Some sequence lengths may prefer larger norms and some smaller, but we can&#8217;t adapt in both of these directions at once over these single shared weights! </strong>This is not to say we need a set of weights for each possible length, but there may be something we can do.</p><blockquote><p>Hypothesis: This may be correlated to issues of entropy collapse and instability in attention layers seen in LLM training. The sequence of 4096 may request a gradient direction leading to lower entropy via higher Q and K norms while the sequence of 5 may request higher entropy. Conflicting update directions may guide training towards a poorly adapted and fragile compromise.</p></blockquote><p>A proposal:</p><ol><li><p>The scaling factor of attention should be a function of sequence length.</p><ol><li><p>This could be learned or scaled by an equation, leaning towards the equation approach as it seems there is a good way to understand this.</p></li></ol></li><li><p>There should be a bias in the denominator that is either a learned constant, or possibly also a function of sequence length.</p><ol><li><p>This I have less intuition on though I lean towards a learned approach as it may depend on the typical range of values the logits take on.</p></li></ol></li></ol><p>With respect to 1, <a href="https://arxiv.org/search/cs?searchtype=author&amp;query=Veli%C4%8Dkovi%C4%87,+P">Petar Veli&#269;kovi&#263;</a> had a <a href="https://arxiv.org/abs/2410.01104">paper</a> on this very matter, for how attention varies with sequence length and how we can recover sharpness through scaling.</p><p>In conclusion, while we have now detailed explanations for how attention performs after the fact, its inception was somewhat a fluke in terms of justifying some of the specifics of its design. A common and effective trend in ML, to try first and find out later.</p><p>Attention is obviously performant as is, but it appears there&#8217;s potentially some places to grow if we forego the probability framework softmax lends itself to and possibly resolving something I would even deem a bug.</p><pre><code>@misc{smith2024attndiffusion,
  author = {Smith, Ethan},
  title = {Softmax Attention is a Fluke},
  url = {<a href="https://www.ethansmith2000.com/post/softmax-attention-is-a-fluke">https://www.ethansmith2000.com/post/softmax-attention-is-a-fluke</a>},
  year = {2025}
}</code></pre>]]></content:encoded></item><item><title><![CDATA[Discrete Diffusion Sudoku and Diffusion Lore]]></title><description><![CDATA[A short attempt at a small portion of the diffusion Family Tree]]></description><link>https://ethansmith2000.substack.com/p/discrete-diffusion-sudoku-and-diffusion</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/discrete-diffusion-sudoku-and-diffusion</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Mon, 03 Mar 2025 09:58:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!KUo5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KUo5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KUo5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KUo5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg" width="535" height="524" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:524,&quot;width&quot;:535,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!KUo5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KUo5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6d08f306-751d-48ac-b44a-009f2a9b6560_535x524.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div><hr></div><p>A short attempt at a small portion of the diffusion Family Tree</p><p><a href="https://www.canva.com/design/DAGgnVB3x2s/b52Y3Kg-frWdRlPzI3_5pA/edit?utm_content=DAGgnVB3x2s&amp;utm_campaign=designshare&amp;utm_medium=link2&amp;utm_source=sharebutton">https://www.canva.com/design/DAGgnVB3x2s/b52Y3Kg-frWdRlPzI3_5pA/edit?utm_content=DAGgnVB3x2s&amp;utm_campaign=designshare&amp;utm_medium=link2&amp;utm_source=sharebutton</a></p><p>Discrete diffusion is the lesser known (but growing in popularity) sibling to the familiar Gaussian diffusion models. Despite their differences, these two both fall under the family of models defined by:</p><ul><li><p>A random iterative destruction forward process. When reversed, it allows for generation.</p></li><li><p>A model that either directly or indirectly learns the score of the distribution, the &#8220;direction&#8221; to move in to increase the probability of a sample and move to a less noisy state.</p></li></ul><p>Continuous diffusion typically looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CWOv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CWOv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 424w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 848w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 1272w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CWOv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png" width="860" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:860,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;https://cvpr2022-tutorial-diffusion-models.github.io/&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="https://cvpr2022-tutorial-diffusion-models.github.io/" title="https://cvpr2022-tutorial-diffusion-models.github.io/" srcset="https://substackcdn.com/image/fetch/$s_!CWOv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 424w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 848w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 1272w, https://substackcdn.com/image/fetch/$s_!CWOv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c9e745e-69a1-460e-942b-73db6296cb6c_860x256.png 1456w" sizes="100vw"></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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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"></figcaption></figure></div><p>https://cvpr2022-tutorial-diffusion-models.github.io/</p><p>Discrete Diffusion you can think of looking something like this (masked diffusion case, and typically this is with latent tokens passed to a decoder instead of being done in pixel space)</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S125!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S125!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 424w, https://substackcdn.com/image/fetch/$s_!S125!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 848w, https://substackcdn.com/image/fetch/$s_!S125!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 1272w, https://substackcdn.com/image/fetch/$s_!S125!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S125!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png" width="863" height="228" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:228,&quot;width&quot;:863,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;modified from: https://www.ml6.eu/blogpost/using-generative-ai-for-image-manipulation-discrete-absorbing-diffusion-models-explained&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="modified from: https://www.ml6.eu/blogpost/using-generative-ai-for-image-manipulation-discrete-absorbing-diffusion-models-explained" title="modified from: https://www.ml6.eu/blogpost/using-generative-ai-for-image-manipulation-discrete-absorbing-diffusion-models-explained" srcset="https://substackcdn.com/image/fetch/$s_!S125!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 424w, https://substackcdn.com/image/fetch/$s_!S125!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 848w, https://substackcdn.com/image/fetch/$s_!S125!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 1272w, https://substackcdn.com/image/fetch/$s_!S125!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0f045a2-b28d-49a2-aaeb-c647b4874cf8_863x228.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">modified from: <a href="https://www.ml6.eu/blogpost/using-generative-ai-for-image-manipulation-discrete-absorbing-diffusion-models-explained">https://www.ml6.eu/blogpost/using-generative-ai-for-image-manipulation-discrete-absorbing-diffusion-models-explained</a></figcaption></figure></div><p>Discrete diffusion seems to be the accepted name now for a large family of methods that involve probabilistic removal/replacement of local patches of a piece of data and using a model that predicts a categorical distribution to recover the original clean sample.</p><p>Gaussian diffusion involves globally interpolating a piece of data with Gaussian noise, such that the result is a mixture of noise and signal. At higher noise levels, noise dominates while signal is sparse, and vice versa for the lower noise cases. When we normalize both data and noise to std=1, we can measure how noisy the data becomes by its signal-to-noise ratio. We have a continuous state describing the mixture between signal and noise.</p><p>On the other hand, instead of a continuous signal, like pixels, discrete diffusion instead works with a categorical vocabulary. Let&#8217;s say, we have a vocabulary of 8192 unique tokens. We encode our data and assign patches of it to one of these tokens, by an approach like VQGAN.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sUgA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sUgA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 424w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 848w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 1272w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sUgA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png" width="824" height="321" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:824,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!sUgA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 424w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 848w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.png 1272w, https://substackcdn.com/image/fetch/$s_!sUgA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e153987-12a8-4e45-a8e9-6aaac5fdcea3_824x321.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now it doesn&#8217;t make sense to add continuous noise to integer values that simply indicate the index of a vocabulary: nearby entries in the vocabulary aren&#8217;t necessarily related.</p><p>So now, we have two options for noising. From a single token, we can either assign it to a special value that never occurs in the data, like [MASK] (absorbing end-state diffusion), or we can randomly switch it to another entry of the vocabulary (stochastic end-state diffusion?).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rUo4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rUo4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 424w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 848w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 1272w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rUo4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png" width="852" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:852,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!rUo4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 424w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 848w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.png 1272w, https://substackcdn.com/image/fetch/$s_!rUo4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e0d66a0-1c2f-429e-8978-632d28e01cf6_852x368.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>What&#8217;s interesting here is that noise is no longer a continuous spectrum but rather a binary variable: the token is either its <strong>original state</strong> or the <strong>noised state</strong> (MASK/random value) it got swapped with.</p><p>This introduces a challenge in adapting from continuous diffusion. We want to have many different noise levels to perturb and predict from. Instead, we can think of our noise level as representing a probability that an individual token gets swapped with its noise copy. So at noise level 0.5, we&#8217;d expect half the tokens to be swapped.</p><p>Notice now that the noise level is no longer consistent everywhere. With our Gaussian diffusion, the same amount of noise is applied everywhere around the data (granted, we may sample values closer to 0, so this in a way constitutes less noise). Here, however, a portion of the image may remain entirely intact while other tokens have been swapped.</p><p>An ongoing challenge of discrete diffusion is actually identifying what kind of SNR we are at. Let&#8217;s imagine, for instance, in the top right corner of every image is a special token that indicates not information about the specific patch of the image but instead classifies the image globally, like &#8220;cat, dog, horse, car...&#8221; etc. Noising this token may have a different effect from removing other tokens, so it&#8217;s hard to say what canonical noise level we are actually at. Another example of this is with diffusion language models. Removing tokens like &#8220;the&#8221; or &#8220;a&#8221; does not constitute a huge loss of information: they are easily predictable from the grammar of the sentence, and the message of the text is well preserved without them. Other words of a sentence may be much more important, and their loss would confer a more substantial loss of information. This is also a reason the MASK option is preferable to the random replacement case. If we happen to replace a word with a synonym, this may not confer too much loss of information, but a more out-of-place word could result in more significant destruction.</p><p>Once upon a time I thought I had come up with discrete diffusion when I was seeking a way we could reduce the neural network modeling load by augmenting it with wave function collapse. In particular, I was interested in ways of building 3D models from learned super-voxel tokens and having some kind of ruleset for how they should be built.</p><p>I called the approach Wave Function Collapse BERT for Images.</p><p>Wave function collapse is used for procedural generation, often for something like randomly generated dungeons in games. There is a &#8220;hard&#8221; rule set that says as one goes about placing different kinds of tiles, only certain tiles are allowed to neighbor them, thus reducing the uncertainty of what remains.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wovD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wovD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wovD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wovD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wovD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wovD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg" width="901" height="457" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:457,&quot;width&quot;:901,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!wovD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wovD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wovD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wovD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad5db621-1a57-4bee-aa37-8a2e1246e8aa_901x457.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>For instance, the image on the left shows our fresh grid. Every tile currently can assume any state because there are currently no constraints. However, once we place down, say, a tile with a barrel on it, we know that just below it needs to be a rock. On the right, we can see that the options for what we can choose have been reduced.</p><p>I was quite fascinated by the results of autoregressive image generation at the time, but it takes a criminally long time to place all of the tokens of an image (which may easily be in the 1000s) one by one. It was also strange to me the ordering we placed tokens in. Why do we start at the top left corner and place tokens in raster order? This could allow us to sample multiple tokens simultaneously, especially as the context becomes more clear, more and more tokens become &#8220;free&#8221;, similar to how we have fewer options to choose from as more of the dungeon tiles are filled out.</p><p>Pretend in these diagrams instead of sampling from words, we are sampling visual tokens.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L-3r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L-3r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 424w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 848w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 1272w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L-3r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png" width="987" height="447" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:447,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!L-3r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 424w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 848w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.png 1272w, https://substackcdn.com/image/fetch/$s_!L-3r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc18cb5dc-f5f9-4bcc-8d2f-5877500dc6a8_987x447.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!XuBC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!XuBC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 424w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 848w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 1272w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!XuBC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png" width="987" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!XuBC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 424w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 848w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.png 1272w, https://substackcdn.com/image/fetch/$s_!XuBC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F48e25790-b1f3-4a1d-8779-3dc1df3da22a_987x531.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ofug!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ofug!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 424w, https://substackcdn.com/image/fetch/$s_!ofug!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 848w, https://substackcdn.com/image/fetch/$s_!ofug!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 1272w, https://substackcdn.com/image/fetch/$s_!ofug!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ofug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png" width="987" height="457" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:457,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!ofug!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 424w, https://substackcdn.com/image/fetch/$s_!ofug!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 848w, https://substackcdn.com/image/fetch/$s_!ofug!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.png 1272w, https://substackcdn.com/image/fetch/$s_!ofug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9d3b8df-a354-4ad1-864b-1acda58a02a3_987x457.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Discrete Diffusion is kind of like wave function collapse where the rules are &#8220;soft&#8221; (meaning that which tokens are allowed to coexist with each other is based on probabilities of what occurs rather than absolute rules) and are learned by the model. Because of mechanisms like attention as well, we can have learned rules that have global awareness of the board as well.</p><p>Sudoku is an example of a problem that can be solved via wave function collapse, which made it seem like a fun thing to try with discrete diffusion. I observed that this was able to learn to predict valid sudoku boards starting from scratch with as few as 2000 training steps.</p><p><a href="https://github.com/ethansmith2000/DiffusionSudoku">https://github.com/ethansmith2000/DiffusionSudoku</a></p>]]></content:encoded></item><item><title><![CDATA[How I Like to Think About Diffusion]]></title><description><![CDATA[It&#8217;s a bit hard to see in the diagram but in addition to being convolved with a gaussian, these points are also drifting towards zero.]]></description><link>https://ethansmith2000.substack.com/p/how-i-like-to-think-about-diffusion</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/how-i-like-to-think-about-diffusion</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 26 Jan 2025 09:50:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!StwZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!StwZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!StwZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 424w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 848w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 1272w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!StwZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png" width="987" height="617" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:617,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!StwZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 424w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 848w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.png 1272w, https://substackcdn.com/image/fetch/$s_!StwZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbb527689-2a0d-44e5-83ac-637f5607ca12_987x617.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>It&#8217;s a bit hard to see in the diagram but in addition to being convolved with a gaussian, these points are also drifting towards zero.</p><p>There&#8217;s two perspectives here actually. There&#8217;s setting a point to</p><p>xt = x0 * alpha + noise * sigma</p><p>where sigma and alpha are both numbers between 0 and 1</p><p>and then there&#8217;s</p><p>xt = x0 + noise * sigma</p><p>but sigma goes towards infinity at the end of the diffusion schedule.</p><p>In both cases we can achieve a desired signal to noise ratio but one case involves reducing the image signal while the other keeps it constant and continues raising the noise&#8217;s variance to overwhelm the signal entirely. I believe these are the Variance Preserving and Variance Exploding perspectives respectively.</p><p>We go from a very high spread distribution to something narrower and narrower until it is a mixture of diracs each reflecting a single sample.</p><p>Interestingly, this process is opposite to entropy flow in nature and the arrow of time. Typically entropy, or disorder, increases. When you put a drop of coloring in water, it will slowly spread out to become a homogenous mixture. The way this moves forward in time is a stochastic process, but the end result distribution is well understood, even if we don&#8217;t know the exact end state it will end up in. In all cases the end result appears similar.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iQ3a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iQ3a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 424w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 848w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iQ3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg" width="720" height="477" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:477,&quot;width&quot;:720,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!iQ3a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 424w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 848w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!iQ3a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff622af2c-414f-4de7-8ba3-b45fbd76fb52_720x477.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now imagine if we could reverse this process. Could you guess from a totally homogenous mixture where in the glass the coloring was dropped? No. But we can guess at this. Generative diffusion is estimating that guess based on where it could have happened with greatest proability.</p><p>I put together this repo, <a href="https://github.com/ethansmith2000/boneless-flow/stargazers">Boneless Flow</a>, to explore it some more. Instead of training a model, with weights, to obtain estimates of the flow towards the manifold of clean data, we can compute the ground truth flow analytically if we have the whole dataset in memory.</p><p>A problem with this is that the ground truth score actually won&#8217;t allow for generating new samples</p><p><a href="https://arxiv.org/abs/2412.20292">https://arxiv.org/abs/2412.20292</a></p><p>Tweedie&#8217;s formula is an equation that sits at the foundation of diffusion. It describes the visual above of moving towards regions of higher probability.</p><p>I liked this <a href="https://x.com/docmilanfar/status/1901858446200410249">post</a> on it. Though I wanted to give some additional intuition.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9iJf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9iJf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9iJf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg" width="743" height="483" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:483,&quot;width&quot;:743,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!9iJf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9iJf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a580107-6842-4ff2-ad55-3b398e102b19_743x483.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Here <strong>X</strong> is a clean data point, <strong>e</strong> is noise, and we get out <strong>Y</strong> when adding that noise to <strong>X</strong>.</p><p><strong>f</strong> (denoiser) is a function that takes in <strong>Y,</strong> the noisy data point, and attempts to estimate <strong>X</strong>, what it was before being noised.</p><p><strong>f_hat</strong> is a specific instantiation of <strong>f</strong> namely, the MMSE denoiser.</p><p>It says that we can denoise <strong>Y</strong> by starting from it and <strong>moving in a direction that increases probability</strong>, similar to our original diagram, scaled by <strong>sigma</strong>, a known level of noise</p><p>We can consider an example of this without needing to consider diffusion: Linear regression</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qohW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qohW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 424w, https://substackcdn.com/image/fetch/$s_!qohW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 848w, https://substackcdn.com/image/fetch/$s_!qohW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 1272w, https://substackcdn.com/image/fetch/$s_!qohW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qohW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png" width="683" height="424" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:424,&quot;width&quot;:683,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!qohW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 424w, https://substackcdn.com/image/fetch/$s_!qohW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 848w, https://substackcdn.com/image/fetch/$s_!qohW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.png 1272w, https://substackcdn.com/image/fetch/$s_!qohW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a5b7cfb-a9e9-4f52-b16a-aa0c03e4af0d_683x424.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>In a linear regression problem we have a set of points following some kind of trend, we attempt to estimate this trend with a model, a straight line represented by <strong>Y_hat = mX + b.</strong></p><p><strong>Y_hat</strong> is the predicted value from our model.</p><p><strong>Y</strong> is the actual data points, which we can think of as clean data points from our model but with added noise. This is often a reasonable assumption due to other unaccounted for variables, which we can represent as noise.</p><p>Therefore we can think of the <strong>Y</strong>&#8216;s represented as</p><p><strong>Y = Y_hat + e</strong></p><p>or</p><p><strong>Y =</strong> <strong>mX + b</strong> <strong>+ e</strong></p><p>This noise, assuming gaussian distribution, creates a fuzzy field/distribution around our model, which we can visualize as either of these two. Where height of the distribution represents probability density, or the opaqueness</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nyJA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nyJA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 424w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 848w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 1272w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nyJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png" width="652" height="404" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:404,&quot;width&quot;:652,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!nyJA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 424w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 848w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.png 1272w, https://substackcdn.com/image/fetch/$s_!nyJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a2ff973-07cb-403f-8777-9d5887edd25e_652x404.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dZ6A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dZ6A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 424w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 848w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 1272w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dZ6A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png" width="651" height="404" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:404,&quot;width&quot;:651,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!dZ6A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 424w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 848w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.png 1272w, https://substackcdn.com/image/fetch/$s_!dZ6A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd1bec81e-888c-408e-a27f-3fbb5004ad6d_651x404.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Now like before, we can ascend the probability curve, thus denoising the real data points with respect to our model.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wtkD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wtkD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 424w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 848w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 1272w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wtkD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png" width="749" height="465" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:465,&quot;width&quot;:749,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!wtkD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 424w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 848w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.png 1272w, https://substackcdn.com/image/fetch/$s_!wtkD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd8f1637-5bd0-401a-b097-b905255e4c54_749x465.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cT72!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cT72!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 424w, https://substackcdn.com/image/fetch/$s_!cT72!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 848w, https://substackcdn.com/image/fetch/$s_!cT72!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 1272w, https://substackcdn.com/image/fetch/$s_!cT72!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cT72!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png" width="745" height="463" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:463,&quot;width&quot;:745,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!cT72!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 424w, https://substackcdn.com/image/fetch/$s_!cT72!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 848w, https://substackcdn.com/image/fetch/$s_!cT72!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.png 1272w, https://substackcdn.com/image/fetch/$s_!cT72!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F500ef670-09dd-4fb0-b749-43f4dd74ac72_745x463.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>I think this illustrates here a profound relationship between noise and blur, for which blurring can be seen as denoising.</p><p>Noise is individual random samples from a distribution.</p><p>Blurring involves taking the average of many samples, or if we know the distribution, typically pointing out its mean value.</p><p>We combat noise by blurring, like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M9Uu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M9Uu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 424w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 848w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 1272w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M9Uu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png" width="987" height="491" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/adc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:491,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!M9Uu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 424w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 848w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.png 1272w, https://substackcdn.com/image/fetch/$s_!M9Uu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fadc84cb2-1d90-4c32-90bd-2ab89adfea53_987x491.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>We don&#8217;t know what the image looks like without noise, but we can take advantage of the contiguity of images to assume that nearby points should have related values, thus smoothing out the randomness. (note this is spatial blurring, which is a bit different from the kind of blurring regression performs, but both leverage the aggregate of noisy samples to give us a denoised estimate)</p><p>Blurring gives us the best unbiased estimator of the data without noise. It yields points that have minimal distance to all the observed noisy samples. The unbiased choice is also the most conservative, safe choice: <a href="https://www.ethansmith2000.com/post/minimum-faith">it makes minimal guesses</a>.</p><p>We could also average or blur across other axes of data points. For example, instead of blurring spatially individual pixels, we can treat every picture of a face as a sample and average those together.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ou4U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ou4U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ou4U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg" width="864" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:864,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!Ou4U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ou4U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155274e0-cef1-4f1d-b199-dd5c1331e7a0_864x489.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Note, this doesn&#8217;t actually give us a real sample of a person, but its informative of common traits in appearance from a certain cluster. This is reflective of <a href="https://www.inference.vc/high-dimensional-gaussian-distributions-are-soap-bubble/">typical samples vs the mean sample</a>.</p>]]></content:encoded></item><item><title><![CDATA[Classifier-Free Guidance and Reinforcement Learning]]></title><description><![CDATA[The connection between a sampling method and a training method]]></description><link>https://ethansmith2000.substack.com/p/classifier-free-guidance-and-reinforcement</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/classifier-free-guidance-and-reinforcement</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 26 Jan 2025 09:45:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!MxvI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MxvI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MxvI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 424w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 848w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 1272w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MxvI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png" width="987" height="591" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:591,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!MxvI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 424w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 848w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.png 1272w, https://substackcdn.com/image/fetch/$s_!MxvI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe1c79ac-b676-4fe5-b2e6-93aeee19b697_987x591.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Classifier-Free-Guidance-to-Approximate-RL-9f78c02801c6434da61f37c8d843c5bf">https://sweet-hall-e72.notion.site/Classifier-Free-Guidance-to-Approximate-RL-9f78c02801c6434da61f37c8d843c5bf</a></p>]]></content:encoded></item><item><title><![CDATA[Why are Modern Neural Nets the way they are? And Hidden Hypernetworks]]></title><description><![CDATA[How did we end up here?]]></description><link>https://ethansmith2000.substack.com/p/why-are-modern-neural-nets-the-way</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/why-are-modern-neural-nets-the-way</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 06 Oct 2024 09:40:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!39Hv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a href="https://sweet-hall-e72.notion.site/Why-are-Modern-Neural-Nets-the-way-they-are-And-Hidden-Hypernetworks-6c7195709e7b4abbada921875a951c54">https://sweet-hall-e72.notion.site/Why-are-Modern-Neural-Nets-the-way-they-are-And-Hidden-Hypernetworks-6c7195709e7b4abbada921875a951c54</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_!39Hv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!39Hv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 424w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 848w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 1272w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!39Hv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png" width="987" height="553" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:553,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A diagram showcasing a family tree of generative models like VAEs, Diffusion models, and LLMs&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="A diagram showcasing a family tree of generative models like VAEs, Diffusion models, and LLMs" title="A diagram showcasing a family tree of generative models like VAEs, Diffusion models, and LLMs" srcset="https://substackcdn.com/image/fetch/$s_!39Hv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 424w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 848w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.png 1272w, https://substackcdn.com/image/fetch/$s_!39Hv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef8b0912-e2f1-4344-aa71-70e2fcfa0fb8_987x553.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>]]></content:encoded></item><item><title><![CDATA[Do Diffusion Transformers Deserve The Hype?]]></title><description><![CDATA[https://sweet-hall-e72.notion.site/Do-Diffusion-Transformers-Deserve-The-Hype-9b9ca7bead374b47aac96558714c203b]]></description><link>https://ethansmith2000.substack.com/p/do-diffusion-transformers-deserve</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/do-diffusion-transformers-deserve</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 28 Jul 2024 10:36:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!o4yG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!o4yG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o4yG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 424w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 848w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 1272w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o4yG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png" width="987" height="705" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be5e988b-4208-46ac-911f-749200989df3_987x705.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:705,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!o4yG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 424w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 848w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.png 1272w, https://substackcdn.com/image/fetch/$s_!o4yG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe5e988b-4208-46ac-911f-749200989df3_987x705.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Do-Diffusion-Transformers-Deserve-The-Hype-9b9ca7bead374b47aac96558714c203b">https://sweet-hall-e72.notion.site/Do-Diffusion-Transformers-Deserve-The-Hype-9b9ca7bead374b47aac96558714c203b</a></p>]]></content:encoded></item><item><title><![CDATA[Automated LoRA Discovery and Teaching Neural Networks to make Neural Networks]]></title><description><![CDATA[Hypernetworks for Generating LoRA Weights]]></description><link>https://ethansmith2000.substack.com/p/automated-lora-discovery-and-teaching</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/automated-lora-discovery-and-teaching</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 26 May 2024 10:33:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rIYE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rIYE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rIYE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 424w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 848w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 1272w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rIYE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png" width="987" height="705" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:705,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!rIYE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 424w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 848w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.png 1272w, https://substackcdn.com/image/fetch/$s_!rIYE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75dbe48a-cb2b-43d1-8287-faf0048893ca_987x705.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Automated-LoRA-Discovery-and-Teaching-Neural-Networks-to-make-Neural-Networks-22aa3b5ad66e4bc985ff2c93896538d2?pvs=74">https://sweet-hall-e72.notion.site/Automated-LoRA-Discovery-and-Teaching-Neural-Networks-to-make-Neural-Networks-22aa3b5ad66e4bc985ff2c93896538d2?pvs=74</a></p>]]></content:encoded></item><item><title><![CDATA[Diffusion and Autoregressive Models for Learning to Solve Mazes]]></title><description><![CDATA[Experimenting with generative models over mazes]]></description><link>https://ethansmith2000.substack.com/p/diffusion-and-autoregressive-models</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/diffusion-and-autoregressive-models</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Tue, 21 May 2024 10:28:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rlSj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rlSj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rlSj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 424w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 848w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 1272w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rlSj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png" width="585" height="585" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:585,&quot;width&quot;:585,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!rlSj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 424w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 848w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.png 1272w, https://substackcdn.com/image/fetch/$s_!rlSj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba10635c-a8a7-4352-9271-a3a81fcb33e0_585x585.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Diffusion-and-Autoregressive-Models-for-Learning-to-Solve-Mazes-c3bc4bcdfa304ecd9531ee5445a4da66">https://sweet-hall-e72.notion.site/Diffusion-and-Autoregressive-Models-for-Learning-to-Solve-Mazes-c3bc4bcdfa304ecd9531ee5445a4da66</a></p>]]></content:encoded></item><item><title><![CDATA[Traversing through CLIP Space, PCA and Latent Directions]]></title><description><![CDATA[Vector arithmetic for latent space visualization]]></description><link>https://ethansmith2000.substack.com/p/traversing-through-clip-space-pca</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/traversing-through-clip-space-pca</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Mon, 06 May 2024 10:22:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wfoY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wfoY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wfoY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 424w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 848w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 1272w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wfoY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png" width="987" height="536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:536,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!wfoY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 424w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 848w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.png 1272w, https://substackcdn.com/image/fetch/$s_!wfoY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f5f1659-d04e-40d4-8827-f4dd0bdc33b4_987x536.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Traversing-through-CLIP-Space-PCA-and-Latent-Directions-b898932e13684d58957405b4a2747a79">https://sweet-hall-e72.notion.site/Traversing-through-CLIP-Space-PCA-and-Latent-Directions-b898932e13684d58957405b4a2747a79</a></p>]]></content:encoded></item><item><title><![CDATA[Learning Space Filling Curves with Autoencoders]]></title><description><![CDATA[Attempting to Find the Hilbert Curve]]></description><link>https://ethansmith2000.substack.com/p/learning-space-filling-curves-with</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/learning-space-filling-curves-with</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sun, 14 Apr 2024 10:20:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3lou!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3lou!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3lou!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3lou!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3lou!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3lou!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3lou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg" width="987" height="696" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:696,&quot;width&quot;:987,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!3lou!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3lou!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3lou!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3lou!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37376213-f021-4515-8575-2acdd91e44ae_987x696.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Learning-Space-Filling-Curves-with-Autoencoders-e39e41ce75894c3a8fecfee0f3bbfb23?pvs=4">https://sweet-hall-e72.notion.site/Learning-Space-Filling-Curves-with-Autoencoders-e39e41ce75894c3a8fecfee0f3bbfb23?pvs=4</a></p>]]></content:encoded></item><item><title><![CDATA[Mimicking Diffusion Models by Sequencing Frequency Coefficients]]></title><description><![CDATA[Autoregressive model + 2D FFT = Absorbing State Diffusion?]]></description><link>https://ethansmith2000.substack.com/p/mimicking-diffusion-models-by-sequencing</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/mimicking-diffusion-models-by-sequencing</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Sat, 16 Mar 2024 09:16:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!sb6k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sb6k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sb6k!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 424w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 848w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 1272w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sb6k!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif" width="600" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!sb6k!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 424w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 848w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 1272w, https://substackcdn.com/image/fetch/$s_!sb6k!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F627002ed-b917-45a0-872e-0fd6af349c0b_600x600.gif 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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/Mimicking-Diffusion-Models-by-Sequencing-Frequency-Coefficients-8e5a60e876d640c390369627d55330b1">https://sweet-hall-e72.notion.site/Mimicking-Diffusion-Models-by-Sequencing-Frequency-Coefficients-8e5a60e876d640c390369627d55330b1</a></p>]]></content:encoded></item><item><title><![CDATA[ContrastiveDPO for Diffusion, Generalizing DPO to multiple items]]></title><description><![CDATA[https://sweet-hall-e72.notion.site/ContrastiveDPO-for-Diffusion-Generalizing-DPO-to-multiple-items-PART1-226b3746aa4d4ff9995d1e26b38a9674]]></description><link>https://ethansmith2000.substack.com/p/contrastivedpo-for-diffusion-generalizing</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/contrastivedpo-for-diffusion-generalizing</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Fri, 08 Mar 2024 09:10:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!quAn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!quAn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!quAn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 424w, https://substackcdn.com/image/fetch/$s_!quAn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 848w, https://substackcdn.com/image/fetch/$s_!quAn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!quAn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!quAn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg" width="632" height="605" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:605,&quot;width&quot;:632,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!quAn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 424w, https://substackcdn.com/image/fetch/$s_!quAn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 848w, https://substackcdn.com/image/fetch/$s_!quAn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!quAn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F031ecf2d-d7bf-45c6-bdb0-21c8cb071680_632x605.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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><a href="https://sweet-hall-e72.notion.site/ContrastiveDPO-for-Diffusion-Generalizing-DPO-to-multiple-items-PART1-226b3746aa4d4ff9995d1e26b38a9674">https://sweet-hall-e72.notion.site/ContrastiveDPO-for-Diffusion-Generalizing-DPO-to-multiple-items-PART1-226b3746aa4d4ff9995d1e26b38a9674</a></p>]]></content:encoded></item><item><title><![CDATA[Dipole Attention: Opposites May Be Deep Connections]]></title><description><![CDATA[Finding value in antiparallel vector alignments]]></description><link>https://ethansmith2000.substack.com/p/dipole-attention-opposites-may-be</link><guid isPermaLink="false">https://ethansmith2000.substack.com/p/dipole-attention-opposites-may-be</guid><dc:creator><![CDATA[Ethan Smith]]></dc:creator><pubDate>Tue, 05 Mar 2024 09:04:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NIBD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NIBD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NIBD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NIBD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg" width="636" height="408" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:408,&quot;width&quot;:636,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;ree&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="ree" title="ree" srcset="https://substackcdn.com/image/fetch/$s_!NIBD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NIBD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc29fc27-4680-445f-8c4c-93d60d4455af_636x408.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 aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><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>Image from: </p><p><a href="https://twitter.com/toshi2fly/status/911306344376012800">https://twitter.com/toshi2fly/status/911306344376012800</a></p><p>Post: <a href="https://sweet-hall-e72.notion.site/Dipole-Attention-Opposites-May-Be-Deep-Connections-6592f109c52c4caf97ffb5a3cd1fb45e?pvs=4">https://sweet-hall-e72.notion.site/Dipole-Attention-Opposites-May-Be-Deep-Connections-6592f109c52c4caf97ffb5a3cd1fb45e?pvs=4</a></p><p></p><p></p><p></p><p></p>]]></content:encoded></item></channel></rss>