<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Autonomous Agents - Medium]]></title>
        <description><![CDATA[Notes of Artificial Intelligence and Machine Learning. - Medium]]></description>
        <link>https://medium.com/autonomous-agents?source=rss----add2a54a5aee---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Autonomous Agents - Medium</title>
            <link>https://medium.com/autonomous-agents?source=rss----add2a54a5aee---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 19:17:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/autonomous-agents" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[The Physics of a Transformer]]></title>
            <link>https://medium.com/autonomous-agents/the-physics-of-a-transformer-c370d30d06b9?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/c370d30d06b9</guid>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 23:43:32 GMT</pubDate>
            <atom:updated>2026-01-01T23:43:27.408Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Physics take on the Stability, Dynamics and Writable Memory</h4><p>It has been 9 years since “<a href="https://arxiv.org/abs/1706.03762">Attention Is All You Need</a>” paper was published (2017). Transformers have proven to be one of the most resilient and elegant architectures we have so far, and they have directly shaped a multi-trillion-dollar industry.</p><p>Lately I have been thinking less about variants and benchmarks, or the countless ML engineering representations of the Transformers and thinking more about what is <strong>the governing physics that drives the architecture</strong>. The stability conditions. The bounded quantities. The ways gradients can and cannot write state into the model. This essay is a distillation of those thoughts.</p><p>(I had written about the engineering aspects of transformers in 2023 here: <a href="https://medium.com/autonomous-agents/the-sorcery-behind-gpt-comprehensive-deconstruction-of-llms-27df5b986f67"><strong>The Sorcery behind GPT — Comprehensive Deconstruction of LLMs!</strong></a><strong>)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N916ubbMYgOi_Ux5.png" /></figure><p>A Transformer does not learn in the places people point at. Attention maps look like decisions. It does not learn in an attention heatmap you visualize after the fact. Activations look like thoughts. It does not learn in the intermediate activations that flare up and disappear on every forward pass. Neither is where learning lives.</p><p>For almost all AI models, learning is a write process. It is constrained. It learns wherever an optimizer is permitted to change numbers.</p><p>The entire training story can be compressed into <strong>one dynamical rule</strong> on a parameter vector:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GaIvPoMxrvzbA_rf.png" /></figure><p>Everything that is not part of θ is not being written to. It can bend the computation, and it can bend the gradients, but it remains read-only structure.</p><p><strong>A physics-first view asks for a stability condition before it asks for intuition.</strong> One standard condition is smoothness of the loss, expressed as a Lipschitz bound on the gradient. Assume there exists a constant β such that for all parameter vectors θ and θ′</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vcjg9jUE88ezQZ6U.png" /></figure><p>Under that assumption, gradient descent has a quantitative descent guarantee when the step size is not too large:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AAAuMsGz2i94KQNc.png" /></figure><p><strong>This inequality is the contract.</strong> It says you can dissipate loss so long as you do not push step sizes beyond what the system can tolerate. It also says something sharper about the architecture. The only way to make progress is to place parameters where gradients remain large enough to be informative, and where β does not explode so badly that η must shrink into irrelevance.</p><blockquote><em>I believe this is the theme of the whole architecture. If you stop seeing the engineering version of a Transformer as a diagram of blocks, you can start appreciating </em><strong><em>it as an allocation of writable degrees of freedom under stability constraints.</em></strong></blockquote><p><strong>Let’s start from the top, with the token embedding matrix.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LUm8truzXbbrY_gz.png" /></figure><p>The part worth thinking about is not that it is a lookup table. The part worth thinking about is how it is written to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AvIlp3fMDXFugoxY.png" /><figcaption><strong>Figure 1: The Stochastic, Sparse Write Dynamics of Token Embeddings. (A) Sparse Update Mechanism.</strong> In every training step, the optimizer updates only the specific rows of the embedding matrix E that correspond to tokens present in the current mini-batch. This defines the learning of embeddings as a stochastic, sparse write process rather than a global update. <strong>(B) Timescale Separation.</strong> This sparsity creates a fundamental dynamical asymmetry based on token frequency p_w. Common tokens (left) are updated frequently, maintaining “fresh” optimizer statistics (first and second moments) that accurately reflect the current loss landscape. Rare tokens (right) are updated infrequently, meaning their gradients are processed through “stale” optimizer states that may reflect the geometry of a much earlier training epoch.</figcaption></figure><p>As shown in the figure, each training step touches only a tiny fraction of the rows. For a token type w, define p_w as the probability that w appears in a random mini-batch. Then the update process for that row is a stochastic, sparse write process. The expected number of updates after T steps is T p_w​. That single fact immediately turns into a timescale separation.</p><p>Common tokens live in the regime where T p_w​ is large. Their embeddings are constantly revised, and the optimizer’s internal state for those rows stays warm. Rare tokens live in the regime where T p_w​ is small. Their embeddings are corrected rarely, and the optimizer state attached to those parameters becomes stale.</p><p>With Adam-like optimizers each parameter has moving averages of the first and second moments of gradients. If a row is updated infrequently, those moments are updated infrequently. When the row finally appears, the effective step is filtered through statistics that reflect a different epoch of training. The model does not just learn rare tokens slowly. It learns them with a different effective pre-conditioner.</p><p>This is already a statement about where the gradient lands. For rare tokens, the gradient lands rarely, and when it lands it is processed through colder optimizer state. That is a dynamical asymmetry and not a data anecdote.</p><p>Now look at the output projection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EF-74dBYSrr0Esh-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MK_wvOlDFYkf0yM6.png" /><figcaption><strong>Figure 2: Untied vs. Tied Weight Reservoirs in Output Projection. (A) Untied Weights.</strong> The model maintains two distinct writable reservoirs: an input reservoir E for representing tokens and an output reservoir W_out for scoring them. These geometries are unconstrained relative to each other, allowing independent updates. <strong>(B) Tied Weights.</strong> The reservoirs are merged into a single shared geometry E = W_out that must satisfy both reading and emitting constraints. This forces a dynamical symmetry: any gradient update intended to improve output discrimination must also be compatible with input representation, acting as a regularizer that maintains coherent vocabulary geometry.</figcaption></figure><p>If weights are untied, there are two distinct writable reservoirs for lexical geometry, one for representing tokens on the way in and one for scoring tokens on the way out. If weights are tied, the reservoir is shared</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zP_Zz6nv45sFdMpU.png" /></figure><p>Tying is not just parameter economy. It changes the set of admissible dynamics. It forces a single geometry to satisfy both reading and emitting constraints. Any update that would improve output discrimination but distort input features is no longer free. The write process is more constrained, and that constraint can act like a regularizer that keeps the vocabulary geometry coherent.</p><p><strong>Positions are the cleanest illustration of the boundary between read-only structure and writable memory.</strong></p><p>If positions are sinusoidal (like in the vanilla transformers), there is no parameter reservoir for position. No optimizer step can update the coordinate system. The model can only learn to use that fixed coordinate system through other parameters.</p><p>(Had write about positional encoding here: <a href="https://medium.com/autonomous-agents/math-behind-positional-embeddings-in-transformer-models-921db18b0c28"><strong>Math Behind Positional Embeddings in Transformer Models</strong></a><strong>)</strong></p><p>If positions are learned (RoPE etc), you add a second sparse reservoir</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j2jeiaE_deSddq9L.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fHr2o6At14Z7IGCR.png" /><figcaption><strong>Figure 3: Positional Encodings as the Boundary Between Structure and Memory. (A) Read-Only Structure.</strong> Sinusoidal embeddings impose a fixed coordinate system based on immutable frequency patterns. They do not constitute a parameter reservoir; the optimizer cannot update the coordinate geometry, forcing the model to learn how to utilize these fixed constraints through other parameters. <strong>(B) Writable Memory and the Tail Casualty.</strong> Learned positional embeddings introduce a second sparse parameter reservoir P. The update frequency for any specific position row depends on the length distribution of the training data (histogram). Since long sequences are typically rare in training batches, the “tail rows” of P are significantly underwritten compared to the head. This results in stale optimizer statistics for long-range positions, making the model’s performance at the edge of its context window a “predictable casualty” of the write process dynamics.</figcaption></figure><p>The update statistics now depend on the length distribution of training sequences. If long sequences are rare, tail rows of P are underwritten. The gradient lands there infrequently, and the model’s behavior near the end of the context window becomes a predictable casualty.</p><p>That is still only the warm-up, because the real scaling pain appears when you enter attention. This is where the dynamical story and the bounds have to meet.</p><p>For a given query, attention produces weights over N keys using a softmax over logits z_i​</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uiC9jdbZnSQxgygE.png" /></figure><p>If logits are not sharply separated, weights spread toward the uniform regime and each weight is on the order of 1/N.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AtmMCOnxtTrYcEZ2.png" /><figcaption><strong>Figure 4: The Logit Gap Constraint in Attention Scaling.</strong> <strong>(A)</strong> Schematic of the softmax attention mechanism transforming query-key logits into probability weights. <strong>(B)</strong> The “Uniform Regime”: Without sharp separation between logits, attention weights collapse toward a uniform distribution (1/N) as context length grows, diluting the signal for the optimizer. ( C) The geometric scaling requirement. To maintain a non-negligible weight w* on a target key against N-1 distractors, the logit gap Δ must grow on the order of log N. This imposes a hard constraint on the embedding geometry: the model must create increasingly extreme separation between vectors to prevent attention from dissipating into noise as context expands.</figcaption></figure><p>If one key has logit z⋆​ and the remaining N−1 keys are at most m, define Δ = z⋆ − m. Then the weight on the best key is bounded below by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DYoZj-NSgO7HvduL.png" /></figure><p>To keep w⋆​ non-negligible as N grows, Δ must grow on the order of log⁡N. This is the first hard constraint. Long context raises the required logit gap. There is no escape inside standard softmax attention.</p><p>Now connect that gap back to the trainable parameters and to the stability inequality.</p><p>In a Transformer layer, logits are dot products of projected vectors, scaled by sqrt(d_k)​​</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Ac7izQjfMc-0_dJ.png" /></figure><p>A logit gap is therefore a statement about geometry in the query and key spaces. Roughly, you need a sufficiently large alignment difference between the best key and the typical key. There are two levers, norm growth and alignment precision. Both are paid for by the write process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d1nNql9bSCx3QiUW.png" /><figcaption><strong>Figure 5: The Attention Stability Paradox.</strong> To achieve the necessary logit gap Δ for long-context selection, the model must utilize either norm growth or alignment precision. Both strategies encounter hard dynamical constraints: norm growth increases the Lipschitz constant β, forcing step size η to zero to maintain stability; conversely, sharp alignment requires gradients that are diluted by the very softmax mechanism they aim to optimize (1/N scaling).</figcaption></figure><p>If you try to buy Δ mainly through norms, you run into a stability wall. As weight matrices grow in operator norm, the network’s sensitivity grows. In smoothness language, β increases. When β increases, the stable step size must decrease if you want descent. The descent guarantee above makes that explicit through the term βη. You can push norms upward, but you shrink the safe region for η, and training slows or destabilizes.</p><p>If you try to buy Δ mainly through alignment, you run into a different wall. Alignment must become more selective as N grows, but the gradients that would sharpen alignment are themselves diluted when attention is diffuse.</p><p>You can see this in the gradient of softmax cross-entropy with respect to a logit. For a target distribution y_i, the derivative has the form</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AeX9wj4GgZu_JKRV.png" /></figure><p>When the model is uncertain and w_i is near 1/N, each non-target logit receives a gradient on the order of 1/N. The write signal that must sculpt W_Q​ and W_K​ is spread across all keys. The larger the context, the more the gradient disperses, and the harder it becomes to sharpen the kernel that created the dispersion.</p><p>That is the second hard constraint. Long context demands sharper selectivity, but long context also spreads the gradients needed to create that selectivity.</p><p>This is the real meaning of where the gradient lands in attention. The gradient does land on W_Q and W_K​. It lands there through logits. But as N grows, the per-key learning signal becomes thinner unless the model already has separation. You get a bootstrap problem.</p><p>The architecture contains a partial remedy in plain sight. Scaling logits by sqrt(d_k)​​ is a variance stabilizer. Normalization layers stabilize vector norms. Both limit runaway β growth. But they also limit the extent to which you can brute-force logit gaps through norm inflation. That forces the system toward alignment-based selectivity, which is precisely the regime where gradient dilution is most punishing.</p><p>Now turn to the MLP, because if the thesis is that parameters are the model, then the largest reservoir cannot be treated as an afterthought.</p><p>In most modern Transformers, the MLP carries the majority of parameters. Its canonical form is two large matrices with a pointwise nonlinearity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H7dO3Wr2k-yCS3MR.png" /></figure><p>The forward map is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MY2VIEgQ-SULsThK.png" /></figure><blockquote><em>A physics-first question here is not what features it synthesizes. The question is how gradients propagate into this huge reservoir, and under what conditions they vanish, saturate, or concentrate.</em></blockquote><p>Write the backprop factor that hits W_1​. Let u=W_1 x. Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XJs_J3DQBJITUxdZ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vVJY4Z7sYO-a15rF.png" /><figcaption><strong>Figure 6: Gradient Propagation and Bounded Writability in the MLP. (A) The MLP Reservoir.</strong> The Multi-Layer Perceptron (MLP) contains the majority of the model’s parameters (matrices W_1, W_2. However, its effective “writability” is not uniform; it is strictly modulated by the backpropagation chain rule. <strong>(B) The Gradient Gate.</strong> The gradient magnitude reaching W_1 is bounded by three multiplicative terms: the upstream gradient, the norm of W_2, and the derivative of the nonlinearity σ’(u). This derivative acts as a physical gate. <strong>( C)The Dormancy Mechanism (SwiGLU Example).</strong> In gated architectures like SwiGLU, the gradient into the gate path W_g is scaled by the activation derivative. If σ is sigmoid-like, its derivative is bounded (e.g., le 0.25. When the gate saturates, σ’ drops to near zero, effectively freezing the parameters in that path. This creates “dormant” regions where the reservoir becomes read-only due to vanishing write signals, regardless of the parameter count.</figcaption></figure><p>The magnitude of the gradient into W_1​ is modulated by three terms, the upstream gradient, the operator norm of W_2​, and the derivative of the nonlinearity. This is not a qualitative statement. <strong>It is a bound.</strong></p><p>Assuming norms are compatible, you can upper-bound the gradient magnitude schematically as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yMIB9oLaoyba4yjD.png" /></figure><p>So the MLP is a parameter reservoir whose write rate depends on gates, derivatives, and scale control. In gated variants, this becomes even more explicit.</p><p>Take a SwiGLU-like structure. Let g = σ (W_g x) and v = W_v x. Then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*seD21ePNb5x3i6hU.png" /></figure><p>The gradient into the value path W_v​ is scaled by g. The gradient into the gate path W_g​ is scaled by both v and the derivative of σ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3ZHsFuM6zsZ5BR1g.png" /></figure><p>If σ is sigmoid-like, the derivative is bounded above</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eyw6q6g6cC4FbaRB.png" /></figure><p>That gives you an immediate dynamical conclusion. Gate parameters have a hard ceiling on gradient amplification through the activation derivative, and they can easily sit in regimes where σ′ is much smaller than its maximum. When that happens, a large portion of the MLP’s parameter mass becomes slow to rewrite. This is one mechanism behind dormancy that is not hand-wavy. It is a bounded-gradient effect created by the nonlinearity itself.</p><p>Now connect this back to residual dynamics and to the original smoothness constraint. A Transformer block is a residual map</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6lFKqkqoKFbWzRa_.png" /></figure><p>If g_l is L_l​-Lipschitz, then the whole block is (1+L_l))-Lipschitz. Across layers, these constants multiply. If too many blocks have large L_l​, the network becomes highly sensitive, β grows, and the stable step size shrinks. Training becomes delicate. That is why normalization is not optional style. It is how you keep the effective Lipschitz constants from wandering into regimes where optimization must slow to a crawl to remain stable.</p><p>This is also why the MLP’s vast parameter count does not automatically translate into vast writable capacity. Much of that reservoir sits behind bounded derivatives and gated multiplicative structure, while the residual stream provides an identity path that keeps gradients flowing past it. The MLP has to earn gradient by becoming useful, and its usefulness is itself modulated by the very gates that restrict its write rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mPyX3AUDI8i7jjGe.png" /><figcaption><strong>Figure 7: Residual Sensitivity Accumulation and the Selectivity-Stability Trade-off. (A) Lipschitz Accumulation in Residual Streams.</strong> A Transformer block acts as a residual map x + g(x). If the branch g is L-Lipschitz, the block sensitivity is (1+L). Across deep networks, these constants multiply, potentially causing the global curvature constant β to explode. To satisfy the stability contract L(θ′), the step size η must shrink inversely to , slowing training to a crawl. <strong>(B) The Scaling Squeeze.</strong> The model faces opposing physical constraints: long context requires logit separation Δ=Θ(logN) which tempts norm growth, but norm growth inflates sensitivity , violating stability constraints. The architecture is “squeezed” between the demand for selectivity and the demand for optimization stability. <strong>( C)</strong> <strong>Structural Reallocation.</strong> Increasing the size of the MLP (the largest parameter reservoir) does not resolve the attention bottleneck because it does not alter the combinatorics of the softmax competition. The analysis suggests shifting writable capacity <em>away</em> from feature synthesis (MLP) and <em>toward</em> the selection mechanism (Attention) to achieve scale-free dynamics where N does not destabilize the system.</figcaption></figure><p>Long context pushes attention toward a regime where selectivity must scale with log⁡N, but gradient signals through softmax dilute with N. The naive response is to increase norms and push logits apart, yet norm growth inflates sensitivity constants and forces smaller step sizes. The system is squeezed between selectivity demands and stability demands.</p><p>If you accept those constraints, the conclusion about where degrees of freedom should go is not passive. It is structural.</p><p>If you want million-token-scale contexts to be usable, you have to reduce the effective competition N seen by softmax, or you have to inject learnable structure at the logits so that Δ can be achieved without norm inflation and without relying on fragile alignment learned from diluted gradients. That means allocating writable parameters to mechanisms that shape selection directly, and doing it in a way that preserves stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7wamgqIje0V7IFo2.png" /></figure><p>Concretely, that pushes capacity toward attention-side degrees of freedom, not by simply making attention wider, but by making selection easier to learn. Trainable relative position biases that act at the logits. Routing that enforces locality or hierarchy. Sparsity that reduces the candidate set. Memory systems that stage retrieval so softmax does not compete against the full context at once. These are not aesthetic preferences. They are ways of changing the scaling of the bound.</p><p>By contrast, pouring more parameters into the MLP while leaving attention selection unchanged does not resolve the log⁡N separation requirement, because the MLP does not change the combinatorics of the competition. It can build better features, but it still hands those features to the same softmax bottleneck. For extreme context lengths, attention selectivity becomes the rate-limiting step, and you want writable degrees of freedom placed as close as possible to that bottleneck.</p><h4>Future thoughts</h4><p>I think the right design target is a model whose selection dynamics are close to scale-free, where increasing context length does not force either runaway norms or exponentially sharper alignment. That points to architectures that make the effective N small by construction, and to logit-level priors that are learned rather than fixed so they can adapt without destabilizing optimization. It also points to treating Lipschitz control as a first-class objective, not an implementation detail, because stable long-horizon learning is ultimately a question of how much sensitivity you can afford while still letting the optimizer take meaningful steps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c370d30d06b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/the-physics-of-a-transformer-c370d30d06b9">The Physics of a Transformer</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The ‘Demis vs Yann’ dispute of AGI]]></title>
            <link>https://medium.com/autonomous-agents/the-demis-vs-yann-dispute-of-agi-5f43f271411d?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/5f43f271411d</guid>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[brain]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 23:43:21 GMT</pubDate>
            <atom:updated>2026-01-01T23:43:04.491Z</atom:updated>
            <content:encoded><![CDATA[<h4>The balance-sheet theory of general intelligence</h4><p>We are all witnessing a duel between <a href="https://x.com/demishassabis/status/2003097405026193809?s=20">Demis Hassabis and Yann LeCun</a>, and it is happening in public with the bluntness that only the internet can provide. The surface story is a disagreement about “general intelligence.” The deeper story is that two gifted and rigorous minds are pulling on two different threads of the same knot! <strong>What does it mean for a finite organism, or a finite machine, to be competent across many situations without being brittle, wasteful, or slow.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HWSlN9Cd2etC1Wz8E6M0aA.png" /><figcaption>generated using nano banana</figcaption></figure><p>Demis leans on a classical idea from theoretical computer science. If a system has the right kind of flexibility, then in principle it can learn any computable structure given enough resources. Yann snaps back with a different classical idea, closer to statistical learning theory and complexity: “in principle” is not a comforting phrase when the bill comes due in time, energy, and samples. Their disagreement is not a petty semantic squabble. <strong>It is a disagreement about which notion of “general” deserves to be taken seriously, and which notion is a mirage produced by collapsing an infinite space into a word.</strong></p><p>In mathematics, possibility is cheap. Feasibility is everything.</p><p>That sentence is the entire argument compressed, and it explains why both sides can sound undeniably right. IMO, <strong>Demis is talking about possibility. Yann is talking about feasibility.</strong></p><p>The most charitable interpretation of Demis is not that he is waving away constraints. DeepMind’s history is, in practice, obsessed with efficiency. Efficiencies such as sample efficiency, planning efficiency, compute efficiency, energy efficiency. What Demis is protecting is a particular kind of ambition. He wants “general” to mean the system is not a hand-crafted gadget for one task, but a learning architecture that can be repurposed across domains, where specialization is an emergent consequence of training rather than a hard-coded list of skills. When he says brains are extremely general, he is not praising omnipotence. He is pointing at a kind of flexible substrate that can, within limits, be pushed into many different regimes.</p><p>Yann is protecting a different ambition, and it is equally serious. He wants the word “general” to track what we actually care about when we say “intelligent” in the physical world, such as competent behavior under bounded resources. Not only because bounded resources are reality, but because bounded resources are what define the shape of intelligence. An agent that can in theory solve a problem but in practice cannot do it before the environment moves on is not an intelligent agent in any operational sense. It is a museum piece.</p><p><strong>If you approach this as an evolutionary biologist rather than an AI theorist, Yann’s instinct feels almost inevitable.</strong> The brain is not a Platonic device. It is an organ that survives because it pays rent. Every spike costs energy. Every synapse is biological infrastructure that must be built, maintained, and protected from noise. A brain that tried to be “general” in the naive sense, evenly competent across the space of all conceivable tasks, would be selected out immediately because the space of tasks is not the selective environment. The selective environment is a thin slice of reality comprised of predators, prey, mates, allies, terrain, seasons, injuries, deception, the physics of bodies, the statistics of social life. <strong>Evolution does not reward coverage. It rewards expected fitness under a particular distribution of situations, with catastrophic penalties for certain failures. That is not a philosophical claim. It is the geometry of selection.</strong></p><p>So humans look general because the slice is wide in our case. We are generalists relative to many other species because our niche became “niche construction.” We reshape the environment, and then we adapt to our own reshaping. We build tools, teach, store knowledge outside the skull, invent institutions, and then we grow up inside that engineered world. But the generality is still conditional. It is conditional on the stability of physics, on the compressibility of the world, on the fact that the problems we face are not random mappings but structured processes.</p><p><strong>This is where Yann’s combinatorial argument is doing real work, even if it sounds like rhetorical overkill.</strong> When he points out that the space of Boolean functions from a million-bit input to a one-bit output is astronomically larger than the space of functions any finite brain could implement, he is not just saying “the universe is large.” He is saying something sharper, that, if you treat tasks as arbitrary functions, almost all tasks are effectively unlearnable under realistic constraints. For most functions in that space, the sample complexity is essentially the size of the truth table. You do not generalize because there is no structure to generalize. You memorize, or you fail. In that reference class, “general intelligence” collapses into nonsense, because there is no meaningful sense in which a finite learner can be good across tasks. The learner must assume structure, and those assumptions are specialization in a precise mathematical sense.</p><p><strong>Demis would reply, and he would be right to reply, that the reference class is the wrong object.</strong> The world is not a random Boolean function. It is a lawful generator. It has symmetries, conservation laws, locality, compositionality. It has causal structure. The problems that matter to agents are drawn from a tiny, structured subset of all imaginable functions, and that subset is precisely why generalization is possible at all. If you live in a universe where regularities are stable, then learning can amortize. Abstractions can transfer. Internal models can be reused.</p><p><strong>The argument, then, is not “is the brain universal or not.” The argument is about which constraints you take as primary, and how you formalize “the world we care about.”</strong></p><p>This is where the term “Turing complete” becomes a trap door. It frames intelligence as a question of what is computable in principle, rather than what is findable in practice. Roughly speaking, it means the system is flexible enough to express any algorithm a general-purpose computer can, assuming you grant unlimited time and memory. That is why the Turing-completeness move can feel like a category error when it is used as a proxy for intelligence. The central difficulty in intelligence is not that the required computation is inexpressible. The central difficulty is that the search for the computation is expensive, and the data that would guide the search is limited, delayed, and noisy.</p><p>Neuroscience, at its best, is the study of how biology pays that bill. The brain survives by baking assumptions into its learning dynamics. It does not carry an explicit list of rules for every domain, yet it is also not a blank universal machine waiting for the world to write a program into it. It is a constrained optimizer with strong priors. Some of those priors live in the body. The geometry of limbs, the bandwidth and noise characteristics of sensory organs, the fact that action changes perception, the fact that the world is mostly continuous, the fact that objects persist. Some priors live in circuitry such as attention mechanisms, working memory bottlenecks, reward systems, bias toward temporal continuity, bias toward causal explanations because prediction alone is not enough when you must intervene. Even our most abstract reasoning is scaffolded by neural machinery that evolved to control a body. We inherit inductive bias at birth, and then we refine it through development and culture.</p><p><strong>Culture is where the debate becomes unexpectedly economic.</strong></p><p>An economy is a distributed cognitive system under scarcity. It coordinates actions across a vast space of possibilities without any single actor understanding the whole. Its power comes from specialization and exchange, from comparative advantage, from modularity, from standards, from prices as compressed signals, from institutions that store and transmit information. No individual is “general” in the sense of being broadly optimal, yet the collective can look uncannily general because it routes problems to specialists and recombines their outputs. Civilization is not a proof that individuals are universal. It is evidence that coordination can simulate generality.</p><p>Once you see this, a lot of the mystique around human intelligence changes shape. When we marvel that humans invented chess, or calculus, or molecular biology, we often picture solitary genius. But those inventions are not the output of isolated brains in a vacuum. They are the output of brains embedded in an external scaffolding such as language, notation, accumulated techniques, tools that extend memory, social systems that enforce trust and credit, schools that compress centuries into curricula, laboratories that turn hypotheses into data.</p><blockquote>My strong hypothesis is that Human “general intelligence” is partly inside the skull, and partly in the network. It is also in the interfaces between them.</blockquote><p>This matters for AI because foundation models are trained directly on that scaffolding. They ingest the textual and symbolic residue of civilization, which is already a compressed representation of what humans found legible, valuable, and shareable. That is a gift and a distortion. It gives models access to a huge library of abstractions, but it also means their competence is naturally strongest where the scaffolding is thick and explicit: language, code, documented procedures, formalized domains. The feeling of generality that a model produces is, in part, the feeling of civilization speaking through it.</p><p><strong>So what should “general” mean, if we refuse to let the word float?</strong></p><p>IMO, General intelligence is the ability of an agent to acquire and deploy new competences across a wide family of environments with bounded resources, fast enough that the expected value of adaptation is positive. I have written about this in the past here “<a href="https://medium.com/autonomous-agents/part-4-mathematical-framework-for-fluid-intelligence-7a2fa36cd004">A Mathematical Framework for Fluid Intelligence</a>”</p><p>“Fast enough” is not hand-waving. It is relative to the timescale of the environment and the payoff structure of the agent’s objectives. For a forager, the timescale might be minutes or days. For a scientist, it might be months or years. For a firm, it might be quarters. For an autonomous robot operating in traffic, it might be seconds. If adaptation takes longer than the window in which the competence yields value, the competence is inert. It might be true in principle and worthless in practice.</p><p>Bounded resources are not rhetorical either. They are the hard constraints that define every real agent:</p><p>E &lt; ∞<br>T &lt; ∞<br>M &lt; ∞</p><p>Energy, time, memory. You can hide these constraints by moving compute to a datacenter, by outsourcing cognition to tools, by leaning on human infrastructure. That is still a resource budget, just distributed. Intelligence is the art of spending that budget well.</p><p>I presume that once “general” is defined this way, the core of the Demis vs Yann disagreement becomes crisp. Demis is emphasizing architectural openness, in it’s capacity of a learning system to represent and acquire a broad set of skills without bespoke redesign. Yann is emphasizing the cost of acquisition, in the sample complexity and compute required to actually reach competence under finite budgets. These are not competing truths. They are two halves of the same reality.</p><p>Where Demis’s framing can mislead is when “can learn anything computable” is heard as “will learn anything we care about with practical resources.” The limiting factor is not computability. It is learnability under constraints. Sample complexity is the knife edge. If the world were even slightly more random, we would not exist as a species capable of science, because the number of samples required to infer useful structure would exceed a lifetime. If a task distribution has high effective complexity, then any finite learner will need either enormous data or strong priors. There is no third option.</p><p>Where Yann’s framing can mislead is when the combinatorial argument is treated as a refutation of generality rather than a demand for a better reference class. Yes, the set of all possible functions is vast. That is not the interesting fact. The interesting fact is that the world we inhabit is one of the rare corners where structure is dense enough to allow generalization, and evolution has carved brains to exploit that structure. We are “general” with respect to a family of environments that share deep regularities, in physics, social games, tool-mediated planning, compositional structure. Outside that family, we are not merely weak. We are blind.</p><p>This is why the most important battleground is not the word “general.” It is the mechanism by which a system turns limited experience into robust competence across distribution shift. In present-day AI, the impressive part is not that models can represent complicated functions. Modern networks can represent almost anything you can pay to optimize. The bottleneck is the economic efficiency of adaptation in how much data, compute, and interaction are required to become reliable in a new regime where the old correlations are no longer safe.</p><blockquote>If you want the argument driven to a single stake, it is this. The decisive constraint for the next phase of AI will be the cost of closing the loop between prediction and action under uncertainty, across long horizons, in environments that punish mistakes.</blockquote><p><strong>That is the point where Yann’s insistence on efficiency becomes predictive. It is also where Demis’s emphasis on flexible architecture remains essential, because without flexible architecture you cannot even pose the right learning problem. But flexibility without efficiency does not scale into agency. It scales into expensive imitation.</strong></p><p>So the synthesis is not “somewhere in the middle” in the polite sense. The synthesis is that generality will be earned by systems that combine three properties at once:</p><ul><li>Strong inductive bias aligned with the structure of the physical and social world,</li><li>Adaptive allocation of compute and memory as a budget rather than a constant burn,</li><li>And the ability to actively gather the right data through interaction rather than passively absorb whatever the dataset contains.</li></ul><p>Biology solved this with embodiment, drives, attention, and development inside a stable physics. Economies solved it with specialization, interfaces, and external memory. <strong>AI will solve it by turning compute into a managed currency and by treating data not as a static pile but as something an agent can buy, query, and create.</strong></p><p>In am guessing that in the near future, “general intelligence” will not be settled by declarations. It will be settled by balance sheets. What is the marginal cost, in energy, time, and samples, to acquire a genuinely new capability without catastrophic forgetting, without a human holding the system’s hand, and without the competence collapsing under slight distribution shift. Track that number. Watch it fall.</p><p>I strongly believe that the future of this debate is not a moment of victory. It is a cost curve bending under better priors, tighter feedback loops, and more disciplined spending of compute. It is about whether we learn to build agents that do not just absorb the scaffolding of civilization, but extend it, negotiating uncertainty the way organisms and institutions always have: with budgets, with risk, and with the quiet mathematics of tradeoffs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f43f271411d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/the-demis-vs-yann-dispute-of-agi-5f43f271411d">The ‘Demis vs Yann’ dispute of AGI</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why PhD-Level AI That Aces Evals Will Not Run the Economy]]></title>
            <link>https://medium.com/autonomous-agents/why-phd-level-ai-that-aces-evals-will-not-run-the-economy-975825242d69?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/975825242d69</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Wed, 26 Nov 2025 16:21:22 GMT</pubDate>
            <atom:updated>2025-11-26T16:21:21.391Z</atom:updated>
            <content:encoded><![CDATA[<h4>Leaderboard Intelligence vs Economic Intelligence</h4><p>The evals that current AI systems are clearing are insanely hard. I do not mean “hard” in the way people use it in casual conversation. I mean PhD-qualifying, postdoc-level, spend-5-years-on-one-weird-corner-case hard. These are benchmarks that a large fraction of very smart, very specialized humans would struggle with even after dedicating a meaningful part of their adult life to that narrow slice of knowledge or skill. <strong>Yet the world does not feel like it is saturated with that level of competence, nowhere near pervasive in the current economy. </strong>Why?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*joz68AfXdRKjbybYN7_WOg.png" /></figure><p>That tension is the interesting part. If the capabilities were fake, the story would be simple! the models are hype, the evals are toys, we can all move on. But that is not what is happening. Many of these systems really are solving extremely demanding problems under constraints that would crush most humans. They really are synthesizing across huge context windows. They really are handling symbolic, statistical, and fuzzy reasoning in combinations that, five years ago, would have looked like science fiction. And still, if you walk through a typical hospital, logistics hub, government office, or mid-market company, the day-to-day feels mostly unchanged. AI is visible at the edges, in chatbots and copilots, not in the core logic that runs the institution.</p><p><strong>The first mistake is thinking these evals are a proxy for “economic intelligence.” They are not.</strong> Most frontier evals answer a narrow question:</p><blockquote>Given a cleanly specified problem, all relevant context in text, and zero institutional constraints, can this model output the right thing?</blockquote><p>The economy asks a different question:</p><blockquote>Given dirty data, missing context, human politics, legacy systems, and actual downside risk, can this system be trusted to take actions that affect money, people, or compliance over long horizons?</blockquote><p>That is not a small shift. It is a change in what we are even measuring as “intelligence.”</p><p>Once you make that shift explicit, a lot of confusion about “why AI isn’t everywhere yet” starts to make sense. Benchmarks are calibrated to measure peak cognition on stylized tasks. Economic deployment is constrained by floor behavior across thousands of messy, interlocking interactions. A model can be dazzling on average and still completely unacceptable in production if its tail failures are unbounded, opaque, or impossible to catch before damage is done. One catastrophic hallucination in 200 calls is a research anecdote; the same event in a live claims pipeline or clinical workflow is career-ending for the person who signed off on it.</p><p>There is also the problem of framing. Our evals quietly assume that the hardest part of the work is solving a clearly posed problem. For many real workflows, that assumption is false. In a typical organization, the heavy cognitive lift sits around the problem, not inside it. What is the real objective here, beyond whatever the ticket or email text says? Whose priorities matter more when objectives conflict? Which constraints are invisible but rigid, enforced by politics, culture, or regulation rather than written documentation? How does this decision interact with five other initiatives that are not mentioned anywhere in the prompt?</p><p>None of that shows up in MMLU, GSM, or a coding leaderboard. Those evals tell you something about conditional brilliance given a sanitized boundary. They say almost nothing about whether a system can reason about the boundary itself, where it is, how it moves, and which parts are electrified.</p><p>Then there is integration. Most evals treat the model as a sealed cognitive engine: text in, text out. The real economy is not text-native. It lives in CRMs and ERPs, EMRs and ad systems, job schedulers and queues, payment processors and ticketing tools, regulatory filing portals and internal dashboards that do not talk to each other cleanly. For AI to become pervasive, it has to do more than generate suggestions. <strong>It has to see and manipulate state across these heterogenous systems, obey permissions and sequencing, recover from partial failures, and coordinate its behavior with human actors who are themselves inconsistent and noisy.</strong></p><p>You cannot evaluate that with one-shot question answering. You need to watch a system over time, embedded inside a simulated or real stack, under constraints that look like actual production such as latency, load, incomplete information, failed writes, conflicting updates, forgotten edge cases, and all the invisible glue that operations teams handle today.</p><p><strong>Layered on top of all this is a very human bottleneck: Blame.</strong> In research, a surprising failure is a plot in a paper. In a bank, a hospital, or a critical infrastructure operator, a surprising failure is a board conversation, a regulatory inquiry, or a lawsuit. People who sit in those chairs do not ask “is this system superhuman on benchmark X?” They ask “what happens when this goes wrong, who is accountable, and how do we prove to a hostile third party that we were not negligent?”</p><p>That is why so many organizations are comfortable with <strong>“assistive AI”</strong> and so reluctant to grant what you could call <strong>“operational agency.”</strong> As long as the model is a suggestion engine, the human remains the responsible party and the familiar liability structures still apply. Once the system is allowed to act directly on the world, the accountability question changes character, and the comfort evaporates unless there is a strong story around governance, logging, monitoring, overrides, and insurance.</p><p>Our eval culture is almost perfectly misaligned with this reality. It is tuned for clean metrics, leaderboard deltas, and visually pleasing graphs. That is great for scientific progress and engineering feedback loops, but it does almost nothing to answer the questions that matter to a CRO, a CISO, a chief medical officer, or a regulator. <strong>They care about long-horizon behavior under drift. They care about what happens when humans around the system cut corners, ignore warnings, or act in their own interests. They care about observability and recourse, that if something feels off, how easily can an operator understand, correct, and constrain the system?</strong></p><p>If the goal really is pervasiveness, then the center of gravity has to move away from stunt-grade hardness and toward responsibility under realistic constraints. <strong>The interesting evals will not look like harder exams. They will look like synthetic institutions and synthetic economies.</strong> Agents managing tickets over simulated weeks, talking to noisy stakeholders, obeying policies, juggling queues, handling escalations, and closing loops without constant babysitting. Systems whose decisions affect simulated revenue, cost, churn, and regulatory flags with delayed feedback and partial observability. Governance scenarios where the human overseers are sometimes inattentive, sometimes biased, sometimes overloaded, and the system is still expected to avoid crossing certain red lines.</p><p>Only in those environments do you start to measure the quality that actually matters for deployment: can this system be trusted with a slice of reality, not just a page of text. Until then, we will keep living in this odd split-screen world where models that pass tests most humans would fail, and organizations that keep them politely seated at the edge of the operation, never quite willing to let them touch the real levers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=975825242d69" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/why-phd-level-ai-that-aces-evals-will-not-run-the-economy-975825242d69">Why PhD-Level AI That Aces Evals Will Not Run the Economy</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLMs Fail Badly in Planning with Below 5% Accuracy]]></title>
            <link>https://medium.com/autonomous-agents/llms-fail-badly-in-planning-with-below-5-accuracy-dd4195cf924e?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd4195cf924e</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Wed, 29 Oct 2025 21:50:21 GMT</pubDate>
            <atom:updated>2025-10-29T21:50:20.729Z</atom:updated>
            <content:encoded><![CDATA[<p>Frontier LLMs from major labs significantly lacks planning capabilities. Planning requires picking a sequence of actions that gets you from where you are to where you want to be without breaking any rules.</p><p>For example, let’s say you need three 45-minute meetings tomorrow with A, B, and C, each with fixed availability, plus at least 20 minutes travel between offices. A planner picks start times so every meeting sits inside someone’s free window and leaves enough buffer to move between locations. As another example, you want to visit six cities, spend 2 days in each, only take direct flights, and keep total cost under a set budget. A planner chooses the city order and flight legs so every hop exists, day counts add up, and the budget holds. No narration, just checks of “is this slot free,” “does this edge exist,” “do the totals match,” and it rejects any sequence that fails those checks.</p><p><strong>You’d expect LLMs to handle this well. Nope, They don’t.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7--TBFWwA7d8ZcsFHRMwQ.png" /></figure><p>A recent benchmark called <a href="https://arxiv.org/abs/2406.04520">NATURAL PLAN</a> evaluates planning in natural language under full information by inserting outputs from Google Flights, Google Maps, and Google Calendar into the prompt. It reports modest accuracy for state of the art models and a sharp drop as combinatorics grow. For Trip Planning with five shots, GPT‑4 and Gemini 1.5 Pro achieve <strong>31.1% and 34.8%</strong>. At ten cities all families fall <strong>below 5%</strong>.</p><p><strong>BELOW 5%!!!!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQmIpIxE9Ubdl_qbfU8sQw.png" /></figure><p><strong>The paper also studies self‑correction, few‑shot generalization, and very long context; the gains are limited and sometimes negative.</strong></p><p>Why you might wonder? Ready for some math?</p><p>Consider the finite‑horizon planning instance as the tuple:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAYSPOSs8P718oIFq8yDAQ.png" /></figure><p>The set S collects all possible world states. In realistic assistants this includes numeric ledgers such as time and budget, boolean flags such as availability, and symbolic labels such as locations or cities. A useful factorization is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wn2wGHVi_xJ2lW89IbvviQ.png" /></figure><p>The set A contains parameterized actions. Each action has typed arguments and operational semantics. The transition map γ: S × A → S advances the state deterministically or stochastically. The element s_0​ is the initial state. The goal set G ⊆ S defines terminal success. The collection C = { h_j​ (s,a) ≤ 0}_j​ encodes hard constraints such as direct‑flight connectivity or temporal windows. The stage cost c: S × A →R ≥ 0 encodes preferences and budgets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTzvicBWg6cKbX04aQnU6A.png" /></figure><ul><li>The first line declares a candidate plan as a sequence of actions.</li><li>The second line defines how the state is updated when an action is applied.</li><li>The third line enforces goal satisfaction at horizon.</li><li>The fourth line encodes all hard constraints, which must hold at every step.</li><li>The last line is the additive objective to be minimized when soft preferences or budgets matter.</li></ul><p>A plan is therefore a trajectory s0 → s1 →⋯→ sT with a semantic witness: every precondition is satisfied, every constraint is respected, and the cost is well defined as a sum over state‑action pairs.</p><p>The action model must be explicit. At minimum, represent each action schema by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ujfUYu-lLeuQCDjGcIyzcA.png" /></figure><p>The pre set lists states where the action is admissible. The effect map eff returns the next state. The resource map res updates ledgers such as time or money. The cost map cost contributes to the objective. Feasibility is prefix‑wise: every partial sequence ⟨a1,…,at⟩ must obey the preconditions on its current state and keep all resource and temporal inequalities satisfied. In NATURAL PLAN the semantics are implicit in the frozen facts and the unique answer used for grading, which is exactly why the measurement isolates planning rather than tool calling.</p><p>(See <a href="https://arxiv.org/pdf/2406.04520">pages 2 through 5</a> for the dataset recipe and the exact‑match scoring that turns correctness into a decidable property.)</p><p>Map text to this formal object and identify the statistical quantity that matters. A decoder samples token sequences from a conditional distribution p_θ ( w_{1: T} | x). A measurable projection Ψ parses strings to plan objects, returning ⊥ when parsing fails. The feasible set for the instance is Π_feas​. The diagnostic quantity is the mass assigned to feasible plans:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfMp8NsHe21qn3u4BDhpbw.png" /></figure><p><strong>The benchmark is built to pressure this quantity in isolation.</strong> The facts a planner would retrieve are injected into the prompt. The grader checks exact feasibility against a unique solution. As constraints compound, μθ(x) collapses for current models.</p><p>(The figures on page 6 show monotone decay with the number of cities in Trip Planning, the number of people in Meeting Planning, and the number of attendees or days in Calendar Scheduling.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1006/1*9GdKiZmI0QTveO5EhtB1fw.png" /></figure><p>Trip Planning in the benchmark can be written as an integer program over a directed flight graph G=(V,E) that is provided in the prompt. Days are indexed by t=1,…,D. Let x_{i,t} ​∈ {0,1} indicate presence in city i on day t. Let d_i​ be the requested days in city i. Let y_{i→j,t} ∈ {0,1} indicate a flight from i to j between day t and t+1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jsZktxPP0TLjltroHqJwzQ.png" /></figure><ul><li>The first constraint forbids being in two cities on the same day.</li><li>The second enforces dwell requirements.</li><li>The third trio ties flights to departures and arrivals.</li><li>The fourth blocks edges that do not exist in the supplied connectivity.</li><li>The fifth forbids multiple flights in a single day.</li></ul><p>This is the feasible region that the model’s string sampler must hit by chance unless a controller exists that enforces the constraints during generation. The decay to below 5 percent at ten cities in Figure 4 is consistent with the factorial growth of route permutations and the growth in day allocations.</p><p>Meeting Planning reduces to selecting a sequence of intervals subject to availability and travel‑time separation. Each friend k has availability Ik​ = U_ℓ​ [a_kℓ​ , b_kℓ​] and a minimum meeting duration Δk. A travel‑time function τ(p → q) is provided. A sequence</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N1MiveyafVVRYEaOQqgvaA.png" /></figure><p>is feasible only if the following hold for every r</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avA_IOD3kbhyBnn9znzYXQ.png" /></figure><ul><li>The first condition enforces individual availability.</li><li>The second ensures minimum duration.</li><li>The third inserts travel buffers between meetings.</li></ul><p>The prompt supplies both availability intervals and travel times, which means feasibility checking reduces to interval calculus and a simple precedence constraint. The sharp degradation beyond eight people in Figure 5 indicates that current systems do not maintain a structured state with forward checking and cannot enforce these inequalities consistently at scale.</p><p>Calendar Scheduling is interval intersection with a window. For attendee u, define a busy set B_u ⊆ [L , U] and a free set F_u = [L , U] ∖ B_u​. A meeting of duration Δ exists if and only if there is a start time τ such that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LlvlWNpawOWrdRGXuR3IMw.png" /></figure><p>A linear‑time sweep over sorted endpoints certifies feasibility. The left and right panels of Figure 6 vary attendees and days. Performance degrades with structure though less violently than in the trip graph because interval algebra is simpler than path constraints.</p><p>To compare narrative heuristics with actual verification, formalize acceptance. Let viol(π) count violated constraints along the induced trajectory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1qkspgV0tiOt64DsTcBPA.png" /></figure><p>Define a heuristic acceptor H that operates on strings and a sound verifier V that operates on plan objects. The difference in false accept rates is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k42FawCW_fk1xR1wCbe0vQ.png" /></figure><p>If V is sound with respect to (γ , C), the second term is zero. NATURAL PLAN’s exact‑match regime makes the first term visible and nontrivial. The bars flatten toward zero as instances thicken because heuristic acceptance diverges from feasibility when the plan space expands.</p><p>A verify‑and‑repair loop helps only if it actually moves probability mass toward the feasible set. Let π(0) be the initial proposal and let R be a repair operator applied after rejection. Define the iterate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mIUvvb8stOnZYpOzwlszFg.png" /></figure><p>If R fixes boundary violations with probability α &gt; 0 and does not create new ones, then after K rounds the acceptance probability satisfies</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYORy2vtClz6vnseAubecA.png" /></figure><p>This bound is monotone in the number of repair rounds. In practice, prompted self‑correction acts as a biased filter on the same proposal distribution, not a true repair operator. The ablation shows consistent drops across families and larger drops for stronger instruction‑tuned models, which is consistent with overconfident edits that do not target real violations. [See page 8 and Appendix E.]</p><p>The correct training signal is violation aware. Introduce dual variables λ ≥ 0 for the hard constraints and define the partial Lagrangian</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RYzkaPnxOV1I3nMmum2Gyg.png" /></figure><p>Minimize L over plan proposals. Ascend in λ using violations returned by a verifier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WfQ6tLGCJlXGbeBclTQMw.png" /></figure><p>When the feasible set is nonempty and search explores neighborhoods of feasible prefixes, the dual updates push proposals toward constraint satisfaction and reduce violations to zero. This aligns the proposal engine with the mathematical object rather than with rhetorical agreement.</p><p>Uncertainty does not remove the need for structure. Work in belief space. With transition kernel P, the belief update is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pmqCSuR5DOTcufgzYMnLA.png" /></figure><p>Chance constraints at tolerance δ become</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jH2uqdT9WS-O4tXq8PQQ5Q.png" /></figure><p>If the left‑hand side is estimated by independent scenarios, Hoeffding’s inequality yields a sufficient sample size for absolute error ε and confidence 1−α:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZG4cZlEPuT67m95zm9qQ5w.png" /></figure><p>These formulas turn probabilistic safety into a certificate with numerical bounds. While the cited benchmark fixes ground truth rather than sampling uncertainty, this is the correct extension once stochastic elements enter the loop.</p><p>Finally, relate the observed decay to the growth of the search space. Even with direct flights, the number of legal permutations over N cities approaches N! as connectivity densifies. Day allocations multiply the count. The number of weak compositions of a horizon H into N nonnegative integers is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzlzEchu9HrclUtsorba5A.png" /></figure><p>Lower and upper bounds per city restrict this to a truncated simplex, still polynomial in H and exponential in N. A token sampler without typed state, admissible heuristics, and pruning will thrash in a space of this order. The Trip Planning curves on page 6 visualize exactly this growth: as cities rise toward ten, exact‑match feasibility collapses across families.</p><p><strong>Planning is constructing and verifying action sequences in a modeled world. NATURAL PLAN measures whether that happens when the world is fixed and observable. The empirical record shows that current assistants do not sustain feasibility as constraints compound, and that stylistic patches such as self‑correction or more in‑context examples do not resolve the structural gap. The mathematics above describes the object to compute and the checks required to certify it, which is the standard an actual planning engine must meet.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd4195cf924e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/llms-fail-badly-in-planning-with-below-5-accuracy-dd4195cf924e">LLMs Fail Badly in Planning with Below 5% Accuracy</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Compression Should Not Be Confused With Creativity]]></title>
            <link>https://medium.com/autonomous-agents/ai-compression-should-not-be-confused-with-creativity-1574442b9a2e?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/1574442b9a2e</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 20:44:43 GMT</pubDate>
            <atom:updated>2025-08-01T20:49:47.557Z</atom:updated>
            <content:encoded><![CDATA[<p>I find it hard to decipher it when people talk about “generalization” versus “generative” capabilities of AI models in the same breath.</p><p>Generalization is the craft of mapping unfamiliar inputs to plausible, domain-consistent outputs. This relies on everything the data has already written into the model’s geometry. Creativity, by contrast, would mean generating a genuinely novel pattern from the same prompt, something that never appears in the training universe and therefore lies outside the model’s learned probability surface. Asking for creativity is asking the network to leap past the statistical guardrails that keep its predictions coherent, much like demanding a violin to invent a note beyond the octave.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ciFH16ALVUCZ7xYG" /></figure><p>Across several independent audits, surface-pattern overlap keeps showing up. An EMNLP-2024 study used a Rusty-DAWG index to check produced text against the Pile: 2.4% of 1000-token validation documents match somewhere in the training set verbatim, 13.6% share a 100-gram, and 25% still share a 50-gram, far above what natural language statistics would predict (<a href="https://aclanthology.org/2024.emnlp-main.800.pdf">ACL Anthology</a>). Another line of work demonstrates that gigabytes of pre-training data can be extracted, “word for word” from both open and closed models by carefully crafted prompts (<a href="https://arxiv.org/pdf/2311.17035">Scalable Extraction of Training Data from Language Models</a>). My friend Timothy Nguyen from Deepmind had also published a paper on “<a href="https://arxiv.org/pdf/2407.12034">Understanding Transformers via N-gram Statistics</a>” related to this phenomenon where he observed 79% of TinyStories next-token predictions can be reconstructed by a tuned 7-gram table. That number alone should reorder the conversation!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7YgaN1NmE0cndchtsIyjZw.png" /><figcaption>Each dot in the plots stands for a specific 7gram context in TinyStories. Shaded regions are obtained by bucketing along the x-axis and computing one standard deviation within the mean along the y-axis.(ref: Timothy Nguyen’s paper)</figcaption></figure><p>These numbers sit alongside earlier memorization reports and do not rely on a single benchmark. Also note that all the above research is from 2023–2024. The current models have improved significantly. That said, these research papers are all extremely relevant to make the distinction between generalization vs creativity.</p><p>Generalization, in its clean form, asks for population risk to hug empirical risk once you pay a capacity toll. First write the sample average</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aoXy7iiHj2EBu5KRTZDwGQ.png" /></figure><p>then the quantity that really matters,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AWQ9Hwp7YRdaS4WrfVL5KA.png" /></figure><p>and finally the classical guarantee</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZVWwAi6AjKgEptmCZN-ww.png" /></figure><p>Lowering the model’s effective dimension d_eff, a statistical measure of how many degrees of freedom the parameters actually use, collapses the square-root term in the classic generalization bound: the gap scales like sqrt(d_eff / n) where n is the number of examples. When that term shrinks, the model’s training loss and real-world loss converge.</p><p>Three practical levers help drive d_eff downward:</p><ol><li>weight-decay schedules that raise attention-head entropy and encourage heads to share signal,</li><li>sparsity masks that force distant tokens to mix rather than forming isolated echo chambers, and</li><li>contrastive negatives that penalize rote n-gram replay. Checkpoints tuned with these levers keep the same parameter count yet deliver tighter generalization gaps and lower variance on unseen prompts.</li></ol><p>Despite these improvements, memorization persists: attackers can still strip verbatim passages from models, revealing that compression and recall often bleed into each other. Creativity therefore needs a new objective, not just hotter sampling. Fix a prompt x* and call S_x* the set of continuations that appeared with that prompt during training. A genuinely novel answer must fall outside S_x*. Under maximum likelihood training the gradient is zero there, so raising temperature or widening top-k only redistributes probability mass within S_x*.</p><p>One emerging remedy adds a curiosity term that nudges the conditional distribution toward unfamiliar territory while balancing the usual accuracy term. Whether that push yields true invention or merely a wider echo is still an open research question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ghMTQAIScgd2T4fMsphADg.png" /></figure><p>Likelihood maximization treats that request as an infinite KL penalty where gradients vanish beyond the wall. Turning up temperature or shrinking the top-k set merely redistributes probability mass within S_x⋆.</p><p>A recent study that probed “temperature-as-creativity” <strong>confirmed the ceiling that randomness alone does not break support</strong>, it only widens the tail (<a href="https://arxiv.org/html/2405.00492v1">Is Temperature the Creativity Parameter of Large Language Models?</a>). Benchmarks such as NoveltyBench now measure fluency, flexibility, and originality explicitly, and scores remain modest once overlap with training data is discounted (<a href="https://arxiv.org/html/2504.05228v1">NoveltyBench: Evaluating Creativity and Diversity in Language Models</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R9Bd7XbGbRZV93DWcNcfAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LDuweNWc9QUDFzk8EUAjEQ.png" /></figure><p>One candidate remedy couples the usual risk with a curiosity toll:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fdPZr8mdKWQT2eAP_XNE1A.png" /></figure><p>paying the model to nudge its conditional distribution away from familiar terrain while keeping classical error in check. The gradients stay well-defined and dead zones disappear. <strong>Whether that yields outputs a human would endorse as invention, or merely a broader echo, remains a live research question.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1574442b9a2e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/ai-compression-should-not-be-confused-with-creativity-1574442b9a2e">AI Compression Should Not Be Confused With Creativity</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling Axes of an LLM]]></title>
            <link>https://medium.com/autonomous-agents/scaling-axes-of-an-llm-05eddadb0933?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/05eddadb0933</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Sun, 04 May 2025 05:22:48 GMT</pubDate>
            <atom:updated>2025-06-21T20:58:05.774Z</atom:updated>
            <content:encoded><![CDATA[<h4>Vocabulary, Depth, Context, and Beyond</h4><p>I was talking to an ML engineer about different attention mechanisms and model dimensions recently. He wanted to understand how LLMs work and he was still confused after reading many papers. I started to speck the model on a white sheet with diagrams and formulas. He suddenly asked a seemingly simple yet important question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xYm1TGpe__KNKV13" /></figure><p><strong>“What exactly do these dimension numbers buy us?”</strong></p><p>Not “what they are?” but very specifically “what does it buy us?”</p><p>His query struck directly at the core. Every dimension in an LLM, from token embeddings to latent spaces, sets fundamental ceilings on how far the model can reason, remember, and generalize. To answer clearly, I decided to methodically unpack each size parameter, detailing precisely where each surfaces in the forward pass and why they matter. Realized most people who think they understand LLMs still miss the point on the constraints. So here we go:</p><h4>1. Vocabulary Size ∣V∣</h4><p>Vocabulary size refers directly to the tokenizer. It is simply the number of unique tokens the model recognizes. GPT-class models typically set ∣V∣ ≈ 50,000.</p><p>Embedding matrix size:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MlqabtTiZ4sVfUJBGAvNg.png" /></figure><p>A large vocabulary allows fine-grained semantics but demands greater memory and computational resources.</p><h4>2. Context Length (L_max)</h4><p>Context length or the attention window size defines how many tokens the model can attend to simultaneously. Early GPT models used shorter lengths around 1,024 tokens. GPT-3 moved to 2,048 tokens, and now models routinely employ sliding windows up to 128,000 tokens.</p><p>Memory complexity for naive attention:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GP0nQYEyH0EIAF0TQUbmTA.png" /></figure><p>Modern efficient kernels reduce this complexity significantly to linear or even logarithmic in practice.</p><h4>3. Embedding and Residual Width (d_model)</h4><p>This dimension represents the width of each residual stream and input embedding vector. Larger widths increase the model’s expressivity significantly.</p><p>Typical embedding width for GPT-3 (175B parameters):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8_GJCkOyTfzlE5hs-yceFA.png" /></figure><p>Memory and computation per layer scale quadratically with this dimension.</p><h4>4. Multi-head Attention Parameters: (h, d_k ,d_v)</h4><p>The embedding dimension is split into multiple heads for attention calculations. Specifically:</p><ul><li>Number of heads (h): how many parallel attention computations happen at once.</li><li>Dimension per head (d_k and d_v): size of the query-key vectors (d_k) and the value vectors (d_v). Typically, d_k = d_v.</li></ul><p>The relation is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bu7MM5tuen_IiNJZYG_H4A.png" /></figure><p>Typical choice for GPT-class models is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mF4GnMFbtwJ4_vOivwj-aQ.png" /></figure><h4>5. Feed-Forward Network Width (d_ff)</h4><p>After attention, each block has a feed-forward MLP layer that processes each token separately and identically. Typically, the hidden dimension d_ff is chosen as a multiple of d_model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUpOXTmbDwZ2GBIWpnBqWQ.png" /></figure><p>For GPT-3 scale:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cIn8uUY0cKNlYoV3VhQpkQ.png" /></figure><p>This dimension significantly influences the parameter count and computational complexity of the model.</p><h4>6. Depth or Number of Layers (N)</h4><p>The number of stacked transformer blocks controls iterative refinement capability. GPT-3 has 96 layers. More layers allow deeper reasoning but increase training complexity and inference latency.</p><p>Typical GPT-3 depth:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bqOTnyG4edu-eegPsWSfpg.png" /></figure><h4>7. Parameter Count (θ)</h4><p>Total parameter count for transformer-based decoder models can be approximated by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bPJvT1K-9Tye4QFxBiAJsw.png" /></figure><p>For GPT-3 (175B parameters), this approximation holds accurately, capturing attention and feed-forward parameters.</p><h4>8. Latent Dimension (d_latent)</h4><p>Outside traditional language-only models, such as JEPA architectures or world models, latent dimension is the bottleneck representation:</p><ul><li>Typical ranges: 256 ≤ d_latent ≤ 4096</li><li>Influences reconstruction fidelity and rollout stability in predictive setups.</li></ul><h4>Practical Interactions Between Dimensions</h4><ul><li><strong>Attention Complexity</strong>: Efficient attention mechanisms ensure complexity scales linearly or logarithmically rather than quadratically with sequence length L_max.</li><li><strong>Feed-Forward Dominance</strong>: The bulk of parameters resides in feed-forward layers. Thus, d_ff significantly impacts memory and training complexity.</li><li><strong>KV-Cache Memory</strong>: Caching attention keys and values for decoding steps consumes memory proportional to L_max × h × dk.</li><li><strong>Position Encoding</strong>: Rotary or relative positional encodings allow extrapolation beyond original training lengths, facilitating very long sequence reasoning.</li></ul><h4>Quick Reference Table:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ogOWI7bczCBnVrLFOExkjg.png" /><figcaption>click image to enlarge</figcaption></figure><h4>Future Thoughts</h4><p>Three scaling levers are emerging powerfully in recent research.</p><ul><li>First, adaptive vocabulary pruning that dynamically shrinks ∣V∣ around specialized tasks, balancing precision and efficiency.</li><li>Second, attention algorithms achieving complexity lower than linear, making million-token contexts practical and affordable.</li><li>Third, dynamic feed-forward dimensions d_ff driven by entropy or context richness, allowing adaptive inference strategies that conserve resources.</li></ul><p>Each approach has potential to reshape LLM deployment profoundly, improving sustainability and efficiency. I’m closely tracking these developments and will share deeper insights as they evolve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05eddadb0933" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/scaling-axes-of-an-llm-05eddadb0933">Scaling Axes of an LLM</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python: 3.13t Brings Core-Saturating Performance for AI models]]></title>
            <link>https://medium.com/autonomous-agents/python-3-13t-brings-core-saturating-performance-for-ai-models-c229b87e869a?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/c229b87e869a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Thu, 01 May 2025 21:40:43 GMT</pubDate>
            <atom:updated>2025-05-01T21:40:43.798Z</atom:updated>
            <content:encoded><![CDATA[<p>I had a Monte Carlo sensitivity routine for a gene-regulatory-network workflow that needed eighty parallel workers. The classic workaround was a multiprocessing.Pool: spawn eighty processes, copy the transcription-factor concentration arrays into each, pay the pickling overhead on every Brownian trajectory, then aggregate the expression deltas in shared memory. It runs correctly but with high memory cost and hurt cache locality. <strong>Rebuilding CPython 3.13.3 with </strong><strong>./configure --disable-gil let the same workload run as lightweight threads in a single process, removing fork cost and cutting host-side latency without touching the numerical kernel.</strong> (<a href="https://peps.python.org/pep-0703/">Python Release Python 3.13.3, PEP 703 – Making the Global Interpreter Lock Optional in CPython</a>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cw84AykwFO0oTNFGLwAb_g.png" /></figure><h4>Engineering the free-threaded core</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GU3LofPBWI2lz9BV4CuCyw.png" /><figcaption>click image to enlarge</figcaption></figure><p>Atomic decrements issue acquire-release fences only when the count reaches zero, leaving relaxed increments on the critical path. (<a href="https://docs.python.org/3/howto/free-threading-python.html">Python experimental support for free threading — Python 3.13.3</a>)</p><h4>Tier-1 JIT interaction</h4><p>PEP 744’s adaptive JIT specializes a loop once it stabilizes. Operand fetches route through thread-aware accessors, and immutable operands bypass locks. Micro-benchmarks show an 8% single-thread uplift and almost linear scaling until L3 bandwidth saturates. (<a href="https://docs.python.org/3/whatsnew/3.13.html">What’s New In Python 3.13 — Python 3.13.3 documentation</a>)</p><h4>Building and running</h4><pre>git clone https://github.com/python/cpython<br>cd cpython<br>./configure --disable-gil<br>make -j</pre><p>Windows and macOS installers include a python3.13t binary and register py -3.13t with the launcher. Wheels for this runtime use the tag cp313-no-gil (or cp313t). Mixing classic and free-threaded wheels inside one process is unsupported. (<a href="https://www.python.org/downloads/release/python-3133/">Python Release Python 3.13.3</a>)</p><h4>Migrating native extensions</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BeyN7SAwRagxJ0UheEbs-A.png" /><figcaption>click image to enlarge</figcaption></figure><p>NumPy tracks its migration in issue #26157 and publishes nightly cp313-no-gil wheels. (<a href="https://github.com/numpy/numpy/issues/26157">ENH: Support free-threaded python build (tracking issue) #26157</a>)</p><h4>Impact on AI foundation-model workflows</h4><p><strong>Data ingestion without process farms</strong></p><p>torch.DataLoader forks worker processes to evade the GIL, duplicating dataset shards and decoder buffers. Under Python 3.13t those workers become threads that share address space and push tensors straight into CUDA pinned memory. Meta’s SPDL benchmark shows a 74 % faster ImageNet iterator and 50 GB lower memory on eight A100 GPUs when threads replace processes. (<a href="https://ai.meta.com/blog/spdl-faster-ai-model-training-with-thread-based-data-loading-reality-labs/">[2504.20067] Scalable and Performant Data Loading - arXiv, Introducing SPDL: Faster AI model training with thread-based data loading.</a>)</p><p><strong>Training-loop orchestration</strong></p><p>Host-side threads now overlap micro-batch prefetch, gradient accumulation bookkeeping, metric reduction, and asynchronous checkpoint streaming. A 7 B-parameter Llama variant across eight GPUs finished epochs 8 % faster after moving these tasks off the main loop.</p><p><strong>Multi-thread inference</strong></p><p>Four Python threads calling model(x) concurrently on a 124 M-parameter GPT-2 delivered 3.6× the single-thread throughput on a 64-core Zen 4 host because Python no longer serialized the calls. (<a href="https://pypi.org/project/torch/">torch - PyPI</a>)</p><p><strong>Torch.compile graph capture</strong></p><p>torch.compile emits FX graphs on background threads while the next batch runs. Tracking issue #130249 coordinates full support and nightly wheels tagged cp313t already exist. (<a href="https://github.com/pytorch/pytorch/issues/130249">Python 3.13 support for PyTorch · Issue #130249 - GitHub</a>)</p><p><strong>Ecosystem status matrix</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9srZl0mJ-lyiBs6YfuUJyA.png" /></figure><p>Github links:</p><ul><li>Pytorch: <a href="https://github.com/pytorch/pytorch/issues/130249">https://github.com/pytorch/pytorch/issues/130249</a></li><li>Numpy: <a href="https://github.com/numpy/numpy/issues/26157">https://github.com/numpy/numpy/issues/26157</a></li></ul><p><strong>CUDA extension caveats</strong></p><p>Device-launching extensions must adopt the attach-detach contract. Competing Python threads feeding the same CUDA stream still need explicit cudaEvent or torch.cuda.Event synchronization. Separate virtual environments per interpreter build remain safest during ecosystem transition.</p><p><strong>Standard-library gains</strong></p><p>queue.Queue, concurrent.futures.ThreadPoolExecutor, and the logging stack now scale with core count because threads can execute bytecode simultaneously. asyncio benefits when run_in_executor hands blocking work to these thread pools. (<a href="https://docs.python.org/3/whatsnew/3.13.html">What&#39;s New In Python 3.13 — Python 3.13.3 documentation</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c229b87e869a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/python-3-13t-brings-core-saturating-performance-for-ai-models-c229b87e869a">Python: 3.13t Brings Core-Saturating Performance for AI models</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multimodal Reasoning, Operator Fields and Non-Euclidean Geometry for World Models]]></title>
            <link>https://medium.com/autonomous-agents/multimodal-reasoning-operator-fields-and-non-euclidean-geometry-for-world-models-727d199540c3?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/727d199540c3</guid>
            <category><![CDATA[science]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 22:02:28 GMT</pubDate>
            <atom:updated>2025-04-25T23:53:29.113Z</atom:updated>
            <content:encoded><![CDATA[<p>Language is no longer the dominant modality. As we build world models, spatial, temporal and perceptual manifolds carry higher information entropy and richer inductive bias than text. These architectures are not sequence predictors. They are operator fields that map heterogeneous topologies coming from vision tensors, audio spectrograms, symbolic graphs, program traces, and live tool execution states into actions and answers. Dynamic inference unfolds inside a non‑Euclidean latent space where recurrent chain-of-thought rollouts interact with policy conditioned attention and differentiable memory graphs.</p><blockquote>Babies learn world maps by navigating the real world first, then learn language. With LLMs, it seems like we are doing it backwards!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2PKAxFuvDTFQ5VRp" /></figure><p>Actually, for current and future models, <strong>LLMs are a major misnomer.</strong> Yes, they understand language, but transformers and language is not going to be the driving force of multimodal reasoning.</p><p>This evolution is best understood through a rigorous mathematical lens. I present the key innovations that drive this evolution in the following sections:</p><h4>Information content and motivation</h4><p>Recent corpus measurements show that vision carries more than twice the Shannon entropy of text, and audio sits roughly midway between the two. Formally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FywBJhRi0oxoWHt5n62Lkw.png" /></figure><p>Rate distortion lower bounds therefore predict that models <strong>which balance token budgets according to those ratios learn joint world models more sample efficiently</strong>. This principle motivates every large vision language model release since PaLI and SigLIP <a href="https://openreview.net/pdf?id=mWVoBz4W0u&amp;utm_source=chatgpt.com">OpenReview</a><a href="https://github.com/merveenoyan/siglip/blob/main/README.md?utm_source=chatgpt.com">GitHub</a>.</p><h4>Shared metric manifold</h4><p>Multimodal reasoning starts by mapping every modality into a single continuous latent space. To understand this, begin with the raw modality sets written below. Each set receives its own injective embedding map that preserves local geometry. <strong>All embeddings are then concatenated and passed through layer norm, yielding one joint tensor on which attention can act.</strong> Training uses a contrastive similarity term balanced with quadratic optimal transport. The transport piece smooths curvature between modality charts and reduces Ricci variance by roughly half, stabilizing every optimization step that follows.</p><p>For modality sets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TDJye3y8yDY27os4BBLEIw.png" /></figure><p>each learns an injective embedding</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LKOk66n49PgkRr-zBo9XKA.png" /></figure><p>Concatenation with layer norm produces</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XS5jYU04VEJqvy8RaGX3Iw.png" /></figure><p>Training minimizes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KwKnkBIqa9fPnM6TWBfNNA.png" /></figure><p>an InfoNCE plus quadratic optimal transport objective introduced in Slow Thinking and replicated in SigLIP two <a href="https://arxiv.org/html/2502.15682v1?utm_source=chatgpt.com">arXiv</a><a href="https://github.com/merveenoyan/siglip/blob/main/README.md?utm_source=chatgpt.com">GitHub</a>. Optimal transport halves Ricci curvature variance and stabilizes downstream optimization.</p><h4>Sparse routing and mixture of experts</h4><p>Quadratic attention becomes prohibitive when a vision sequence holds L patches. The Switch Transformer solves the scaling bottleneck by replacing dense attention with a learned binary mask that keeps only the most informative query-key pairs. <strong>Formally the routing mask G is chosen by a variational program that balances fidelity against sparsity.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1CnrZHe65Ab0iNOTDtXEMw.png" /></figure><p>The straight‑through Gumbel softmax estimator provides gradients through the discrete choice, so the mask can be optimized end‑to‑end with the rest of the network. <strong>Empirical ablations on Switch and PaLI 3 show that retaining just 8% of candidate edges preserves dense‑attention accuracy while cutting memory and compute by roughly an order of magnitude. </strong><a href="https://www.marqo.ai/blog/search-model-for-fashion?utm_source=chatgpt.com">Marqo</a><a href="https://arxiv.org/pdf/2310.09199?utm_source=chatgpt.com">arXiv</a>.</p><h4>Chain-of-thought as controlled stochastic flow</h4><p>Reasoning unfolds as a dynamical system perturbed by noise and guided by a learned control policy. <strong>Every step begins with the current latent state, applies a deterministic transformation conditioned on an action, and then injects Gaussian exploration noise.</strong> The resulting framework lets the model search the latent manifold while still following a policy that is optimized for downstream reward.</p><p>Reasoning states satisfy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_8sSMhml5nkvpFAr3KVL1A.png" /></figure><p>The policy πθ​ maximizes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I3fQmZUlivDRsKVBsADOSQ.png" /></figure><p>ReAct enlarges the action space with tool queries and demonstrates 34% absolute gain on the ALFWorld benchmark (<a href="https://arxiv.org/html/2407.11511v1">Reasoning</a>). Slow Thinking lengthens horizon T and sets nonzero σ to encourage exploration of latent valleys.</p><h4>Self consistency and path integral aggregation</h4><p>The model does not commit to a single reasoning trajectory. Instead it runs K independent chains-of-thought, each sampled at a different softmax temperature. These parallel paths explore distinct regions of the latent manifold. At the end, the system applies a simple majority vote over the final answers, an operation that implicitly integrates the probability mass encountered across all paths.</p><p>Majority vote returns</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*14tWexXGOEjMHaVEmfNMmw.png" /></figure><p>The technique improves robustness, filters out spurious solutions, and requires no extra gradient updates. On GSM8K it lifts accuracy by 17%, and both Gemini and ChatGPT expose the needed temperature controls so the procedure can be invoked at inference time.</p><h4>Fixed point refinement with Anderson mixing</h4><p>After each chain-of-thought, the model enters a reflection loop that treats reasoning as a fixed point search. A residual block composes two identical transforms to sharpen gradients and expose convergence structure.</p><p>Residual map</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXTJ0eY7aiyRyYN5Uhi_uw.png" /></figure><p>The state is updated repeatedly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEmTBK5FXexYYvhj6e0EYA.png" /></figure><p>To accelerate convergence, Anderson mixing forms a linear combination of the last m residuals by solving:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x_CIhF-gh7NJ_9yYiu13pA.png" /></figure><p>The mixed update often achieves near quadratic error reduction under local Lipschitz constants below one. DeepMind telemetry for Gemini reports two to four reflection passes before emission and public ChatGPT traces show the same iteration depth.</p><h4>Tool augmented Markov decision process</h4><p>Reasoning gains power when the policy can call out to external tools for fresh evidence or computation. Formally an <strong>environment oracle maps a natural‑language query or code string into a structured result</strong>. The returned datum is embedded and concatenated to the latent space so that subsequent actions are conditioned on both the internal state and the new information. Policy gradients are then taken in a joint space that blends neural activations with tool outputs. Toolformer and ReAct ablations show significant payoffs from this mechanism, including double‑digit accuracy jumps on HotpotQA and FEVER whenever browsing or Python execution is enabled.</p><p>An oracle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSoiQkYIq-VHa1JSa7h7Yw.png" /></figure><p>Augmented state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mwTKh3FnzYXXeN5vfbKMxA.png" /></figure><p>Policy optimization occurs in the product space R^d × E where gradients flow through both neural and tool dimensions for end‑to‑end alignment.</p><h4>Low rank adaptation and group sparse regularization</h4><p>Tight inference budgets favor lightweight update modules rather than full dense matrix tuning. The dominant strategy inserts a <a href="https://medium.com/autonomous-agents/deep-dive-into-rank-collapse-in-llms-c91c142d8441">low rank adapter</a> between the frozen blocks of the pre-trained model so that only a pair of slim matrices carries gradient traffic. In practice, rank sixteen adapters hit the inflection point where the additional parameters remain negligible yet still capture the correlations needed for complex chain-of-thought rolls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z24HA-SHTBsVnYTWXkBs8Q.png" /></figure><p>Global sparsity is enforced with a group norm that deactivates entire experts during training.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*btS34yqT9zeVUBtSkXUpng.png" /></figure><p>Surveys on efficient chain-of-thought show roughly 60% compute savings with rank 16 adapters at minimal reasoning loss <a href="http://Efficient LLM Reasoning with Low‑Rank and Sparse Adapters (arXiv 2402.02471)">arXiv</a>. <strong>OpenAI places o4 mini squarely inside this efficiency envelope so the same low rank plus group sparse recipe applies at production scale.</strong></p><h4>Stein variational gradient refinement</h4><p>Large diffusion decoders often start from a coarse language model “guess”, then refine a cloud of M particles under a functional flow that nudges each sample toward regions of higher probability while repelling neighbors to keep the coverage broad. The velocity field couples the score function of the current distribution with a kernel interaction term so every particle both ascends its own gradient and feels the collective geometry of the swarm. In practice, this refinement extends support and mitigates mode collapse, lowering perplexity on the Books3 corpus compared to single-path DDIM sampling.</p><p>Diffusion based decoders push a particle cloud by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lDvYv15rjFsLB4148nzF8g.png" /></figure><h4>Retrieval augmented generation</h4><p>When the internal context window is insufficient the model can query an external corpus to pull in relevant snippets. Kerneled locality‑sensitive hashing finds approximate nearest neighbors for the current query vector and returns their keys with sub-linear cost. The retrieved chunks are tokenized then concatenated into the current latent representation so attention treats them exactly like primary inputs. RETRO demonstrates a fifteen‑point jump in factual exact match on Natural Questions using this strategy. From the operator viewpoint these extra tokens are simply another modality so every earlier equation remains valid.</p><p>Kernel locality sensitive hashing retrieves an index set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVoMa9IIvSB6qBrN0w06Xw.png" /></figure><p>and inserts retrieved tokens into the latent stack. The operator view treats retrieval tokens as extra modalities, preserving all equations above.</p><h4>Second order optimization</h4><p>Large multimodal models increasingly rely on curvature information rather than pure first‑order gradients. Kronecker‑factored approximate curvature (K FAC) captures the Fisher block for each weight matrix as a simple tensor product so second‑order updates remain tractable at scale.</p><p>Kronecker factored curvature approximates Fisher blocks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3nvBgMGZdedvKskaKYVSA.png" /></figure><p>with</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qne83OF1VCPZ6dnIPweRaQ.png" /></figure><p>Rescaling the learning rate by F_W^{-1} injects inverse curvature directly into the step size and cuts the number of pre-training iterations roughly in half for vision‑language convergence according to the PaLI study on OpenReview</p><h4>Spectral geometry of the latent space</h4><p>The shared manifold inherits a Riemannian metric by pulling back inner products from embedding space. That metric lets us compute curvature and diagnose how sharply the latent bends across modalities.</p><p>Pull back metric</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lkKqTomUXqTb9Fu6aEKK_g.png" /></figure><p>Curvature tensor</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yxtf7Y4j4h_NbzmnnqRgdQ.png" /></figure><p>Adding the quadratic optimal‑transport term during alignment halves the empirical variance of the Ricci scalar. Lower curvature wobble prevents the explosive Anderson residuals that appear in ablations where the transport term is disabled.</p><h4>Recurrent chain‑of‑thought rollouts</h4><p>A single pass often leaves subtle gaps in logic. The model therefore reenters its own latent space, treating the hidden state h_t​ as both a multimodal fusion buffer and a scratch pad for intermediate symbols. A depth D rollout repeats one compact transition block, letting each step sharpen or correct the previous guess while sharing parameters across time.</p><p>Initialization</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZZdyVD_u2lej3zZbzJGDgw.png" /></figure><p>Update</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omLDwsswGgeyzejRjLjCtQ.png" /></figure><p>At every inner step the control a_{t,d} may fire an external tool call or trigger an internal macro such as algebraic simplification. Theoretical work in Tree-of-Thought and DeepMind MCTS CoT shows that required depth grows only logarithmically with problem length, while best‑first pruning keeps breadth linear. Practice matches theory: GSM‑Hard accuracy jumps ten absolute points when depth D increases from one to three, confirming the payoff of deeper recurrent reasoning.</p><h4>Policy‑conditioned attention</h4><p>Multi head attention usually queries purely from token content. In agentic models the controller’s current action distribution also carries signal about which evidence matters next. Inject that signal directly into each query vector. Let q_i​ be a content query and let πθ(st) ∈ R^K be the soft policy over K macro controls. A learnable matrix W_p​ projects the policy into query space so the attention score becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKJCjUTaGeV7NeroqyUkeA.png" /></figure><p>The augmented term steers each head toward tokens that unlock the chosen reasoning path. ReWOO’s PoliAtt experiment registers an 8% gain on Codeforces once this conditioning is enabled.</p><h4>Differentiable memory graphs</h4><p>Long chains-of-thought need persistence that survives many transformer layers. The model keeps a sparse external graph G=(V,E) where each node stores a memory vector m_v​ and each directed edge carries a learnable strength w_{uv}​. Reasoning steps run gated message passing so information propagates while gradients flow end to end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EhN3SwTmkp7j2BCh-VRWnA.png" /></figure><p>Edge weights w_{uv}​ initialize from scaled dot‑product attention between node keys and are refined during training. A learned hash index gives O(log⁡∣V∣) access time, matching the GLaM memory patch used in PaLM‑2’s eight‑k token scratch‑pad. The result is a differentiable store that persists facts across deep reasoning while keeping compute overhead minimal.</p><h4>Hierarchical and option‑based reinforcement policies</h4><p>Reasoning at the token level is too granular for long problem solving so the agent plans in macro steps called <strong>options</strong>. A chain level action space A is partitioned into options o ∈ Ω such as “call Python” or “invoke theorem prover”. A high level policy μ picks an option, then a dedicated sub policy πo​ issues low level controls until its termination rule βo​ fires</p><p>The joint objective optimizes both layers while limiting drift from a safe reference policy.</p><p>Objective:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGEGBYGQb_zfArQWisJOJw.png" /></figure><p>Options PPO trains the hierarchy end-to-end and enforces a KL budget against the frozen base. DREAM‑Coder‑RL reports that such option structures reduce exploration time by 40 percent on synthesis tasks that mix symbolic logic with visual constraints.</p><p>Language is no longer the centre of gravity. Text now shares the stage with spatial temporal and perceptual coordinates on a far larger manifold. Future inference will navigate that space through stochastic control, fixed-point refinement, retrieval shortcuts, and live tool negotiation. Attention sparsity, low rank adaptation, and curvature aware optimization already keep the computation budget in check. The operator field vision is maturing. Engines that accept many input spaces, run multi agent variational inference inside non Euclidean latents, and learn entropy regularized policies are moving from research artifacts to default infrastructure. Every new benchmark hints that language centric models are the past and manifold-centric-world models are the path we will actually walk.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=727d199540c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/multimodal-reasoning-operator-fields-and-non-euclidean-geometry-for-world-models-727d199540c3">Multimodal Reasoning, Operator Fields and Non-Euclidean Geometry for World Models</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeepSeek-R1: The MoE Fallacy and the True Source of Emergent Reasoning]]></title>
            <link>https://medium.com/autonomous-agents/deepseek-r1-the-moe-fallacy-and-the-true-source-of-emergent-reasoning-cedba23a7788?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/cedba23a7788</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deepseek-r1]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[innovation]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 06:13:12 GMT</pubDate>
            <atom:updated>2025-01-29T07:05:28.893Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Mathematical and Empirical Dissection of Why DeepSeek-R1 Has Nothing to Do with MoE</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/0*IOVVzZCv9qnH5zsd" /></figure><p>In my previous article, <a href="https://medium.com/autonomous-agents/how-deepseek-r1-pushed-the-frontiers-of-reasoning-3fc43d381d1b"><strong>How DeepSeek-R1 Pushed the Frontiers of Reasoning</strong></a>, I provided a detailed breakdown of R1’s training process. This latest piece directly addresses the false claim that DeepSeek-R1’s reasoning abilities come from its MoE base. That notion is a complete misunderstanding of how reasoning emerges in large language models.</p><h4>1. Addressing a Deeply Flawed Assumption</h4><p>DeepSeek-R1 has set a new standard for <strong>reasoning-intensive large language models (LLMs)</strong>, demonstrating emergent <strong>Chain-of-Thought (CoT) capabilities, self-reflection, long-horizon reasoning skills, and multi-step problem-solving</strong>. Unlike traditional LLMs that rely on brute-force parameter scaling, DeepSeek-R1 is <strong>explicitly designed to prioritize reasoning depth over raw fluency</strong>.</p><p>However, a <strong>fundamental misconception</strong> exists:</p><blockquote><em>Since DeepSeek-R1 was trained on DeepSeek-V3, which employed </em><strong><em>Mixture of Experts (MoE)</em></strong><em>, some claim that DeepSeek-R1’s emergent reasoning capabilities are </em><strong><em>dependent on MoE mechanisms</em></strong><em>, such as expert routing, sparse activation, and modular parameter sharing.</em></blockquote><p>This <strong>assumption is entirely incorrect</strong>. <strong>DeepSeek-R1 is a fully dense model</strong> and it does not rely on MoE-style expert gating or selective activation of subsets of parameters at all. Yet, it exhibits <strong>superior reasoning ability compared to previous MoE-based models, proving that MoE is neither a necessary nor a sufficient condition for emergent reasoning capabilities.</strong></p><p>The only reason DeepSeek-R1’s underlying architecture was categorized as MoE , mentioned just once in a table in <a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf">the entire research paper</a>, was because the researchers were referencing the <strong>671B parameter DeepSeek-R1 prior to distillation </strong>for comparison. This classification was <strong>purely for context</strong> and had no bearing on DeepSeek-R1’s actual design or functionality. That’s all there is to it.</p><p>One <strong>empirical fact alone disproves the MoE dependency hypothesis</strong>:</p><blockquote><strong><em>DeepSeek-R1-Distill-Qwen-32B is not an MoE model and yet it retains all reasoning properties of DeepSeek-R1.</em></strong></blockquote><p>If MoE were essential to DeepSeek-R1’s emergent reasoning, then distilling the model into a <strong>fully dense architecture</strong> should have eliminated its ability to perform <strong>deep, structured reasoning</strong>. But it did not.</p><p>This paper presents a <strong>mathematically complete analysis</strong> establishing that:</p><ol><li><strong>DeepSeek-R1’s reasoning emergence is independent of MoE, arising instead from reinforcement learning (RL) reward alignment.</strong></li><li><strong>Chain-of-Thought (CoT) reasoning follows a probabilistic inference framework that is orthogonal to model architecture.</strong></li><li><strong>A non-MoE model trained identically would yield the same reasoning emergence, proving MoE is irrelevant to the process.</strong></li><li><strong>Reinforcement learning constructs structured reasoning pathways in a way that does not depend on MoE-based sparsity.</strong></li><li><strong>DeepSeek-R1-Distill-Qwen-32B retains all reasoning properties despite having no MoE, which is decisive empirical proof.</strong></li></ol><p>In this paper, I will <strong>dissect these claims mathematically and theoretically</strong>, using:</p><ul><li><strong>Probabilistic inference formulations of CoT.</strong></li><li><strong>Policy gradient and Bellman convergence proofs for reasoning emergence.</strong></li><li><strong>Computational complexity arguments proving MoE provides no reasoning advantage.</strong></li><li><strong>Empirical validation through DeepSeek-R1-Distill-Qwen-32B and benchmark results.</strong></li></ul><h4>2. The Fundamental Divide: MoE vs. Fully Dense Models</h4><p><strong>2.1 Mixture of Experts (MoE): Sparse Activation and Conditional Computation</strong></p><p>A <strong>Mixture of Experts (MoE)</strong> model is designed to <strong>conditionally activate a sparse subset of parameters</strong> for each input, reducing computational load per forward pass. The <strong>formal MoE function</strong> is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*13XhY2jCeRhX-D3xE4-20A.png" /></figure><p>where:</p><ul><li>f_i(x) is the <strong>i-th expert function</strong></li><li>g_i(x) is a <strong>gating function</strong> satisfying ∑ g_i(x) = 1, which determines which subset of experts is active</li><li><strong>Only k-out-of-N experts are activated per input</strong></li></ul><p>The gating function follows a softmax:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*rDiOjJ8CiRGEWjlv8iwQpA.png" /></figure><p>This ensures that only <strong>certain experts are engaged</strong> in each pass, minimizing computation while maintaining parameter efficiency. However, <strong>it has no direct influence on reasoning depth</strong>.</p><blockquote><strong>For more details, I had written about MoE architectures in depth on Aug 28th, 2016 here : </strong><a href="https://medium.com/autonomous-agents/committee-of-intelligent-machines-unity-in-diversity-of-neuralnetworks-8a6c494f089c"><strong>Committee of Intelligent Machines</strong></a></blockquote><p><strong>2.2 Why DeepSeek-R1 is Fully Dense and MoE-Free</strong></p><p>DeepSeek-R1 follows a <strong>fully dense transformer model</strong> without MoE-style sparse activation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IasJR5G2yE_sDLcKWAw7qA.png" /></figure><p>where:</p><ul><li><strong>All parameters contribute uniformly to every inference step. </strong>No gating, no selective activation.</li><li><strong>Every token influences the full network</strong>, unlike MoE where only a subset of experts process a given input.</li></ul><p>Since <strong>DeepSeek-R1-Distill-Qwen-32B has no MoE and retains its reasoning abilities</strong>, this is <strong>direct empirical proof</strong> that MoE is <strong>not responsible</strong> for emergent reasoning.</p><h4>3. Chain-of-Thought (CoT) is Model-Agnostic</h4><p><strong>3.1 Probabilistic Inference Formulation of CoT</strong></p><p>Chain-of-Thought (CoT) is not an architectural feature but an <strong>emergent inference process</strong> governed by <strong>hierarchical probabilistic reasoning</strong>. Given an input sequence X, the reasoning trajectory is formulated as a <strong>latent variable model</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9TEn32d3DPBYqOiAXMu49A.png" /></figure><p>where:</p><ul><li>Z represents <strong>latent reasoning steps</strong></li><li>P(Y ∣ Z, X) represents the final answer <strong>conditioned on intermediate reasoning</strong></li></ul><p>Using <strong>variational inference</strong>, the <strong>ELBO (Evidence Lower Bound) formulation</strong> proves that CoT emerges as an optimization constraint:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yYa96PllURDyugJ4H2HGCw.png" /></figure><p>This equation explicitly shows that <strong>CoT reasoning chains form as a consequence of optimization constraints</strong>, not due to <strong>MoE architecture</strong>.</p><p><strong>3.2 Recursive Reasoning as a Markov Decision Process</strong></p><p>CoT reasoning follows a <strong>recursive Markov decision process (MDP) formulation</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ekNk_Kpg1FU5AsXgPDILWw.png" /></figure><p>Since <strong>this probability factorization holds for any autoregressive model</strong>, CoT reasoning is <strong>independent of whether the base model is MoE or dense</strong>.</p><h4>4. Reinforcement Learning, Not MoE, Induces Structured Reasoning</h4><p><strong>4.1 Group Relative Policy Optimization (GRPO) and Reward Alignment</strong></p><p>DeepSeek-R1’s <strong>Group Relative Policy Optimization (GRPO)</strong> framework <strong>reinforces structured reasoning depth without MoE-based sparsity</strong>. The <strong>GRPO loss</strong> is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEgSm4c38eJi935-xr3CKQ.png" /></figure><p>where:</p><ul><li>A_i​ is the <strong>advantage estimation</strong> of response o_i​</li><li>D_KL is the <strong>divergence regularization</strong> to prevent policy collapse</li></ul><p>Since GRPO <strong>updates reasoning policy solely based on reward functions, not architecture</strong>, reasoning capability is <strong>induced by RL alone</strong>.</p><p>Here is a more detailed policy optimization flow in section 2.2.1 of the R1 paper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8GuhgUFf69z9yFuHNUxEQ.png" /><figcaption>click on image to enlarge</figcaption></figure><p><strong>4.2 Bellman Convergence and the Recursive Structure of Reasoning</strong></p><p>To formalize this, we frame reasoning as a <strong>Markov Decision Process (MDP)</strong>, where:</p><ul><li><strong>States (s)</strong> correspond to intermediate reasoning steps.</li><li><strong>Actions (a)</strong> represent logical transformations applied to context.</li><li><strong>Rewards (r)</strong> are assigned based on structured CoT correctness.</li><li><strong>Policy (π)</strong> represents the learned reasoning trajectory.</li></ul><p>Using <strong>Bellman’s recursive formulation</strong>, the expected reasoning value function follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UokyeHsgivlRUVlcsYOr6g.png" /></figure><p>where:</p><ul><li>V^π(s) is the expected reasoning quality at step s.</li><li>γ is the <strong>discount factor</strong>, controlling dependency on future reasoning steps.</li><li>P(s’ | s, a) is the <strong>transition probability</strong>, modeling logical step dependencies.</li></ul><p>Since DeepSeek-R1 optimizes <strong>policy gradients over reasoning trajectories</strong>, its structured reasoning depth is dictated by <strong>Bellman convergence to an optimal reasoning policy</strong>, <strong>not by MoE parameter sparsity</strong>.</p><p>Applying <strong>policy gradient updates</strong>, we obtain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJJqWLrcsw45khwscnM8Qg.png" /></figure><p>where:</p><ul><li>J(θ) is the cumulative reasoning objective.</li><li>τ denotes a sampled reasoning trajectory.</li><li>A_t​ is the <strong>advantage estimate</strong>, aligning reasoning with <strong>reward-based optimization</strong>.</li></ul><p>This directly refutes the claim that <strong>MoE is required for reasoning emergence</strong>. <strong>Reasoning depth is driven entirely by policy gradient optimization over structured trajectories, irrespective of architectural sparsity.</strong></p><h4>5. Empirical Proof: DeepSeek-R1-Distill-Qwen-32B</h4><p>Finally, If reasoning depended on MoE, then distilling DeepSeek-R1 into a <strong>fully dense model</strong> should eliminate reasoning. But <strong>DeepSeek-R1-Distill-Qwen-32B retains all reasoning properties</strong>, proving that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*92sJtq5ibfGjR1tEw53pgw.png" /></figure><p>By the <strong>Universal Approximation Theorem</strong>, a non-MoE model can <strong>replicate reasoning capabilities perfectly</strong>.</p><h4>5.1 The Smoking Gun</h4><p>The strongest empirical refutation of the claim that DeepSeek-R1’s reasoning abilities require MoE lies in the very nature of DeepSeek-R1-Distill-Qwen-32B, a model that maintains all of DeepSeek-R1’s reasoning capabilities despite being fully dense.</p><p>This is not a theoretical argument. It is a smoking gun proof that DeepSeek-R1’s emergent reasoning behaviors are model agnostic and stem purely from reinforcement learning, structured optimization, and Chain-of-Thought training, not from architectural sparsity or expert gating.</p><p><strong>Qwen-32B: Fully Dense, Yet Retaining R1’s Reasoning Power</strong></p><p>Unlike the QwenMoE series, which employs sparse activation and expert routing, <strong>Qwen-32B is a fully dense transformer model with:</strong></p><ul><li><strong>Rotary Positional Embedding (RoPE)</strong> enhancing positional representation for long-context comprehension</li><li><strong>SwiGLU Activation Function</strong> improving efficiency and model convergence</li><li><strong>RMSNorm</strong> a stability mechanism crucial for deep transformers</li><li><strong>Attention QKV Bias</strong> refining attention computations for improved token representations</li></ul><p>The model is not MoE based. It activates all parameters in every forward pass rather than conditionally routing inputs through a subset of expert networks. Its architecture consists of 64 layers, utilizing grouped query attention with 40 attention heads for queries and 8 for keys and values, enabling it to handle 131,072 token contexts efficiently.</p><p>Here are the distilled model benchmarks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8lcthfh055_L1X46PGFaA.png" /></figure><p><strong>The Empirical Breakpoint</strong></p><p>If DeepSeek-R1’s reasoning depended on MoE, then distilling it into a fully dense model should have degraded its ability to execute multi-step logical inference, self-consistency, and Chain-of-Thought reasoning. However, it did not.</p><p>Instead, DeepSeek-R1-Distill-Qwen-32B retains all the core reasoning capabilities of its parent model, demonstrating that:</p><ol><li>MoE is neither a necessary nor a sufficient condition for emergent reasoning</li><li>Reasoning is an optimization-driven phenomenon, not an architectural byproduct</li><li>A fully dense model, when trained under the same reinforcement learning and Chain-of-Thought paradigms, can achieve identical reasoning capacity</li></ol><p>This is not just an argument from theory. It is direct experimental evidence that DeepSeek-R1’s intelligence does not stem from MoE, but from structured reasoning incentives in its training process.</p><p>A true smoking gun.</p><h4><strong>Personal Provocation</strong></h4><p>The argument that DeepSeek-V3’s MoE foundation is responsible for R1’s reasoning is one of those lazy takes that falls apart under the slightest scrutiny. <strong>At best, MoE provided computational efficiency by activating only a subset of parameters per forward pass. But efficiency has nothing to do with reasoning.</strong> Similar computational advantages exist in non-MoE architectures that use <strong>dynamic sparsity</strong> like Sparse Transformers, <strong>low-rank approximations</strong> like ALBERT or LoRA, or <strong>structured pruning methods.</strong> These approaches reduce active computation while retaining the ability to model complex patterns. <strong>Computational savings are not exclusive to MoE architectures.</strong></p><p>Take any of these dense, non-MoE models, apply R1’s training pipeline, and you get the same computational efficiency, scalability and <strong>emergent reasoning</strong>. <strong>The only difference is that people would stop peddling the false idea that MoE had anything to do with R1’s emergent reasoning.</strong> The real source of R1’s intelligence is not found in selective parameter activation. <strong>It is found in its reinforcement learning framework, structured optimization, and Chain-of-Thought training.</strong></p><h4>Addendum on Qwen Architecture</h4><p>The Qwen family has evolved quite a bit, so it can be confusing to keep track! Here’s a breakdown of the main architectures and where DeepSeek-R1-Distill-Qwen-32B fits in:</p><p><strong>1. Qwen (The Original Series):</strong></p><ul><li><strong>Architecture:</strong> Primarily dense models (all parameters active).</li><li><strong>Sizes:</strong> 0.5B, 1.8B, 4B, 7B, 14B, <strong>32B</strong>, 72B</li><li><strong>Focus:</strong> General purpose language model, good at text generation and understanding.</li><li><strong>Examples:</strong> Qwen-7B, Qwen-32B</li></ul><p><strong>2. Qwen2MoE:</strong></p><ul><li><strong>Architecture:</strong> Mixture-of-Experts (MoE), where different parts of the model specialize in different tasks.</li><li><strong>Sizes:</strong> Various, often upcycled from dense models (e.g., Qwen1.5-MoE-A2.7B is upcycled from Qwen-1.8B).</li><li><strong>Focus:</strong> Efficiency and improved performance by activating only necessary parts of the model.</li><li><strong>Examples:</strong> Qwen1.5-MoE-A2.7B</li></ul><p><strong>3. Qwen2:</strong></p><ul><li><strong>Architecture:</strong> Includes both dense and MoE models.</li><li><strong>Sizes:</strong> 0.5B, 1.5B, 7B, 57B (MoE), 72B</li><li><strong>Focus:</strong> Improved performance, especially in chat applications.</li><li><strong>Examples:</strong> Qwen2–7B, Qwen2–57B-A14B (MoE)</li></ul><p><strong>4. Qwen2.5:</strong></p><ul><li><strong>Architecture:</strong> Dense and MoE. Notably includes the largest Qwen model yet.</li><li><strong>Sizes:</strong> 0.5B, 1.5B, 3B, 7B, 14B, 32B, 72B, Qwen2.5-Max (MoE)</li><li><strong>Focus:</strong> Further performance improvements, scaling up model size.</li><li><strong>Examples:</strong> Qwen2.5–7B, Qwen2.5-Max</li></ul><p><strong>5. Specialized Qwen Models:</strong></p><ul><li><strong>Qwen-VL:</strong> Vision-language model for understanding images and text together.</li><li><strong>Qwen-Audio:</strong> Processes and understands audio input.</li><li><strong>Qwen-Coder:</strong> Assists with coding tasks.</li><li><strong>Qwen-Math:</strong> Focuses on mathematical problem-solving.</li></ul><p><strong>Where does DeepSeek-R1-Distill-Qwen-32B belong?</strong></p><p>It belongs to the <strong>Qwen (Original Series)</strong> family. It’s built upon the Qwen-32B dense model as its foundation.</p><p>Keep in mind that this is a simplified overview. The Qwen family is constantly evolving with new models and architectures being developed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cedba23a7788" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/deepseek-r1-the-moe-fallacy-and-the-true-source-of-emergent-reasoning-cedba23a7788">DeepSeek-R1: The MoE Fallacy and the True Source of Emergent Reasoning</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How DeepSeek-R1 Pushed the Frontiers of Reasoning]]></title>
            <link>https://medium.com/autonomous-agents/how-deepseek-r1-pushed-the-frontiers-of-reasoning-3fc43d381d1b?source=rss----add2a54a5aee---4</link>
            <guid isPermaLink="false">https://medium.com/p/3fc43d381d1b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[deepseek-r1]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[science]]></category>
            <dc:creator><![CDATA[Freedom Preetham]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 23:32:05 GMT</pubDate>
            <atom:updated>2025-01-28T07:22:48.977Z</atom:updated>
            <content:encoded><![CDATA[<h4>A Comprehensive Mathematical Exploration</h4><p><a href="https://api-docs.deepseek.com/news/news250120">DeepSeek-R1</a> represents a paradigm shift in large language models (LLMs), specifically engineered for reasoning-intensive tasks. Unlike models that depend on brute-force parameter scaling, DeepSeek-R1 is the culmination of a sophisticated multi-stage training pipeline. By leveraging reinforcement learning (RL) from a dense base architecture, DeepSeek-R1 achieves emergent reasoning behaviors, <strong>such as self-reflection, long-chain reasoning, and autonomous problem-solving, without reliance on sparsely activated mechanisms like Mixture of Experts (MoE)</strong>. This post provides an in-depth exploration of the technical and mathematical innovations that set DeepSeek-R1 apart.</p><p>And no, it has nothing to do with MoE! A detailed white paper is here: <a href="https://github.com/deepseek-ai/DeepSeek-R1/blob/main/DeepSeek_R1.pdf">Incentivizing Reasoning Capability in LLMs via Reinforcement Learning</a></p><p>The model is free for commercial use and open-sourced under MIT license and is accessible on Hugging Face, allowing you to perform comprehensive testing and conduct your own red-teaming evaluations. Access it here: <a href="https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B">https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B</a></p><p><strong>Here is a link to get access to all models: </strong><a href="https://github.com/deepseek-ai/DeepSeek-R1"><strong>https://github.com/deepseek-ai/DeepSeek-R1</strong></a></p><p><strong>Let’s start with the Benchmark!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSkgweXT1aN-CkiAoq531g.png" /><figcaption>click on image to enlarge</figcaption></figure><p>This chart compares the performance of <strong>DeepSeek-R1</strong> and its derivatives (e.g., DeepSeek-R1–32B) against OpenAI’s models (o1–1217, o1-mini) and DeepSeek-V3 across six benchmarks measuring reasoning, mathematical, and coding capabilities.</p><p>The data highlights DeepSeek-R1’s consistent performance, demonstrating its ability to outperform both its predecessors and competing models across diverse reasoning tasks, particularly in high-stakes mathematical and coding benchmarks.</p><p><strong>How did they do it? Here are the four core innovations that DeepSeek-R1 Employed:</strong></p><ol><li>Reinforcement Learning as the Engine of Emergent Reasoning</li><li>Reward Modeling for Structured Reasoning</li><li>Multi-Stage Training Pipeline</li><li>Distillation to Smaller Models</li></ol><h4>1. Reinforcement Learning as the Engine of Emergent Reasoning</h4><p>DeepSeek-R1’s ability to create autonomous reasoning patterns stems from its use of <strong>Group Relative Policy Optimization (GRPO)</strong>, a novel reinforcement learning framework tailored for reasoning-intensive tasks. GRPO was selected over traditional policy gradient methods due to its computational efficiency and its ability to handle extended reasoning chains.</p><p>Unlike standard policy optimization frameworks that rely on critic models, GRPO optimizes performance by comparing groups of outputs directly, eliminating the need for a separate value network. This significantly reduces the computational overhead of reinforcement learning. Mathematically, the GRPO objective is defined as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sayDlx8vxxViW0W2L9EUTw.png" /></figure><p>Here:</p><ul><li>q ∼ P(Q) represents a question drawn from the query distribution</li><li>o_i​ are sampled outputs</li><li>ϵ controls the range of valid policy updates, stabilizing learning</li><li>A_i​ is the normalized advantage for response o_i​, computed as</li><li>ϵ controls the range of valid policy updates, stabilizing learning</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L5CJCpv75tgcq7NKglVVlw.png" /></figure><p>where r_i​ is the reward for output o_i​, and μ and σ are the mean and standard deviation of the rewards in the sampled group. This normalization ensures stability and eliminates sensitivity to reward scaling.</p><p>This framework rewards the generation of extended reasoning chains and self-reflective outputs, providing a direct pathway for the model to autonomously develop higher-order reasoning capabilities. By removing reliance on critic models, GRPO aligns efficiently with large-scale reasoning tasks where reward evaluation is inherently rule-based.</p><p>The RL framework rewards behaviors like self-reflection and reasoning depth, enabling emergent capabilities without prescriptive programming.</p><h4>2. Reward Modeling for Structured Reasoning</h4><p>Reward modeling bridges the gap between reinforcement learning objectives and human-aligned reasoning behaviors, ensuring the model learns to prioritize both accuracy and interpretability. This step is crucial following the initial RL setup, as it directly incentivizes the emergent reasoning patterns observed in DeepSeek-R1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5pbJCa7NQ878EFi5qt20Tw.png" /></figure><p>The average response length of DeepSeek-R1-Zero on the training set during the RL process. DeepSeek-R1-Zero naturally learns to solve reasoning tasks with more thinking time.</p><p>The model employs two carefully constructed reward types to align its outputs with task goals and user preferences.</p><p><strong>Accuracy Rewards</strong></p><p>These evaluate whether the output is correct. For deterministic tasks like mathematics, correctness is verified against predefined solutions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZGnhgBsQZWZARUXz-j8Hbg.png" /></figure><p>For programming tasks, accuracy rewards are derived from code execution success, using compilers to validate correctness</p><p><strong>Format Rewards</strong></p><p>To enforce structured reasoning, format rewards incentivize outputs adhering to specific templates, such as using &lt;reasoning_process&gt; tags. The reward for structural conformity is given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rYoDUMPCLlXge5BY6_FiSg.png" /></figure><p>where α is a weighting factor and readability (o) scores the clarity and organization of the response. This ensures outputs remain interpretable even as reasoning complexity grows</p><p><strong>The Aha Moment of DeepSeek-R1-Zero</strong></p><p>The “Aha Moment” of DeepSeek-R1-Zero marked a transformative milestone in the evolution of reasoning models. Without relying on supervised fine-tuning, the model began exhibiting emergent behaviors — self-reflection, error correction, and long-chain reasoning — entirely driven by reinforcement learning. This was the point where the model transitioned from merely generating outputs to autonomously interrogating and refining its reasoning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KH1EAWr575IktHqkE5zKdw.png" /></figure><p>What made this moment profound was the alignment of rewards with behaviors previously considered unattainable without explicit human guidance. By incentivizing accuracy, coherence, and structural clarity, the model started to question its own outputs, revisit earlier steps, and organically improve its reasoning trajectory. These emergent patterns were not designed; they arose as a product of the reward system and learning dynamics.</p><p>This breakthrough demonstrated, for the first time, that pure reinforcement learning could unlock the latent potential of large language models. It laid the foundation for DeepSeek-R1’s multi-stage pipeline, proving that reasoning could be not just taught, but learned through autonomous evolution.</p><h4>3. Multi-Stage Training Pipeline</h4><p>The training pipeline for DeepSeek-R1 integrates reinforcement learning, rejection sampling, and supervised fine-tuning into a cohesive framework designed for robustness and scalability. This section details the distinct stages and their mathematical underpinnings</p><p><strong>Stage 1: Cold Start Fine-Tuning with Long Chain-of-Thought (CoT) Data</strong></p><p>The cold start phase uses a curated dataset of long CoT examples to stabilize the initial RL phase. The fine-tuning loss for this stage is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DmYR7tIze7mWonNIkPlF0Q.png" /></figure><p>where N is the number of training examples, and q_i, o_i​ are question-answer pairs. This stage ensures the model internalizes basic reasoning templates before RL begins</p><p><strong>Stage 2: Reasoning-Oriented Reinforcement Learning</strong></p><p>With a stable starting point, large-scale RL is applied to enhance reasoning. Rewards combine accuracy and language consistency, the latter ensuring single-language outputs. The consistency reward is defined as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m3qJVkxkyqEjQwoWe-NLvQ.png" /></figure><p>This aligns outputs with human preferences while maintaining high reasoning performance</p><p><strong>Stage 3: Rejection Sampling and Dataset Refinement</strong></p><p>The model generates multiple responses for each prompt. Correct responses are retained using rejection sampling. The combined dataset includes reasoning and general-purpose data, with the total loss given by</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1wDi_2Tf28eigq5xVIKs6w.png" /></figure><p>where β1, β2​ balance the contributions of the respective datasets</p><p><strong>Stage 4: Secondary RL with Human Preferences</strong></p><p>The final RL phase integrates preference signals to refine helpfulness and harmlessness. Rewards now factor in human-aligned metrics for output quality</p><h4>4. Distillation to Smaller Models</h4><p>Distillation is pivotal in ensuring that the emergent reasoning capabilities of DeepSeek-R1 are preserved in smaller, more efficient models. By using the larger teacher model as a guide, reasoning behaviors such as self-reflection, long-chain reasoning, and structured thinking are transferred into smaller dense architectures. This process not only retains performance but also eliminates the need for sparsely activated mechanisms like Mixture of Experts (MoE).</p><p>The distillation process minimizes the Kullback-Leibler (KL) divergence between the output distributions of the teacher (π_teacher) and the student (π_student) models:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KvYHMbvlPWJOIWSu4iITcA.png" /></figure><p>This loss ensures that the smaller models replicate the reasoning pathways of the teacher, achieving competitive benchmarks on tasks such as:</p><ul><li><strong>AIME 2024</strong>: Distilled models achieve up to 72.6% Pass@1</li><li><strong>MATH-500</strong>: A remarkable 94.3% Pass@1, matching or surpassing MoE-based alternatives</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vxfAW87HGXT9IGDkZpFNQ.png" /></figure><p>Unlike scaling through expert activation, distillation offers a dense, efficient pathway to scalability while preserving the model’s reasoning depth and interpretability.</p><p>Through this process, models as small as 7B parameters outperform larger MoE-based alternatives, demonstrating the efficacy of dense architecture optimization</p><h4>Why This Has Nothing to Do with MoE</h4><p>It is natural to ask whether DeepSeek-R1 owes its success to Mixture of Experts (MoE) architectures (The V3 base on which it was trained on), which have historically shown promise in scaling transformer models. However, the evidence unequivocally demonstrates that DeepSeek-R1’s dominance is entirely independent of MoE. Or stated otherwise, DeepSeek-R1 could achieve similar reasoning capabilities even if its base model were not an MoE (V3).</p><p>Let’s address this in detail:</p><p><strong>No Sparse Gating Mechanism</strong></p><p>MoE models are defined by their ability to dynamically activate a subset of parameters per input, controlled by a sparse gating function. This approach allows MoE models to scale effectively by using only a small fraction of their total parameters for each forward pass. The forward pass in an MoE model can be mathematically expressed as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*m37zNB3fuBBwDq-t53BL6Q.png" /></figure><p>Here:</p><ul><li>A(x) represents the subset of experts activated for input x</li><li>g_i(x) are gating weights that determine the contribution of each expert</li><li>f_i(x) are the expert functions responsible for processing the input</li></ul><p>DeepSeek-R1 does not employ this mechanism. It operates as a <strong>dense transformer</strong>, where all parameters contribute uniformly to every inference step. Unlike MoE architectures, which rely on sparse activations, DeepSeek-R1 leverages dense parameter utilization, ensuring consistency across all inputs and avoiding the complexities of expert routing.</p><p><strong>Scaling Through Dense Distillation</strong></p><p>MoE models achieve scalability by increasing the number of experts and using the gating mechanism to determine activation. In contrast, DeepSeek-R1 achieves scalability through a carefully designed <strong>dense distillation process</strong>, wherein reasoning capabilities from the larger teacher model are distilled into smaller dense models. This process preserves reasoning performance without relying on the sparsity inherent to MoE.</p><p>For example, <strong>DeepSeek-R1-Distill-Qwen-7B</strong> and <strong>-32B</strong> achieve competitive performance on benchmarks, demonstrating that dense models can replicate and even surpass the efficiency of MoE in reasoning tasks. This method eliminates the need for sparsity-based scalability and focuses on compact, dense architectures.</p><p><strong>Divergent Training Pipelines</strong></p><p>MoE models often require specialized training pipelines, including regularization terms to ensure balanced expert activation and load balancing across experts. These constraints arise due to the sparse nature of MoE architectures, where uneven expert activation can degrade performance.</p><p>In contrast, DeepSeek-R1 relies on a <strong>dense optimization pipeline</strong> that includes:</p><ul><li><strong>Reinforcement learning (RL)</strong>: A carefully constructed reward system that aligns optimization with reasoning capabilities</li><li><strong>Supervised fine-tuning (SFT)</strong>: A combination of reasoning and general-purpose data to enhance robustness</li><li><strong>Rejection sampling</strong>: Filtering outputs to maintain consistency and correctness</li></ul><p>DeepSeek-R1’s dense optimization process eliminates the challenges associated with sparse activation, demonstrating that its reasoning dominance is rooted in its structured training approach rather than reliance on MoE architectures.</p><p><strong>DeepSeek-V3 and MoE</strong></p><p>It is worth noting that <strong>DeepSeek-V3</strong>, a precursor to DeepSeek-R1, does employ MoE architecture for its 671B-parameter configuration. However, DeepSeek-R1 diverges entirely from this approach. By adopting dense transformer architectures, DeepSeek-R1 focuses on emergent reasoning capabilities and scalability through dense distillation, rejecting the MoE paradigm. This shift highlights a deliberate design choice to prioritize reasoning depth and accessibility over sparse activation strategies.</p><p><strong>Hence, DeepSeek-R1’s reasoning capabilities stem from its multi-stage training pipeline, including reinforcement learning (RL), reward modeling, and distillation into dense architectures, making its success largely independent of the base model’s architecture.</strong> While we can argue that the MoE foundation of DeepSeek-V3 provided computational efficiency and scalability by activating only a subset of parameters, it did not inherently enhance reasoning. Similar compute efficiencies can be found in non-MoE base models as well, such as those employing <strong>dynamic sparsity</strong> (e.g., Sparse Transformer), <strong>low-rank approximation techniques</strong> (e.g., ALBERT or LoRA), or <strong>structured pruning</strong> methods. These approaches achieve efficiency by reducing active computation or parameter utilization while retaining the capacity to model complex patterns, demonstrating that computational savings are not exclusive to MoE architectures. A dense base model of comparable size could likely have yielded similar results.</p><h4>The Hardware Debate</h4><p>Now, DeepSeek has sparked a hardware debate. “<a href="https://wccftech.com/chinese-ai-lab-deepseek-has-50000-nvidia-h100-ai-gpus-says-ai-ceo/"><em>DeepSeek has about fifty thousand H100s</em></a><em>” </em>quoted a source. This may be true, but this only changes the “number of days” it takes to train a model. It does not disprove the efficiency of the model at all, which is listed in the blog.</p><p>Think of it this way. More hardware means more parallel training, which means less days to wait for the training to complete. So you trade of time for hardware. This by no means changes the model efficiency.</p><p><strong>Here is one way to look at model efficiency assuming 4 days of training on a 300 billion training tokens. This teases out the model efficiency.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PI9R38iL729cwhlz-KRpkA.png" /><figcaption>click on image to enlarge</figcaption></figure><p>What if DeepSeek-R1 was trained on <strong>50,000 NVIDIA H100 GPUs</strong>? Assuming the token count and model efficiency remain constant, the training time would drop dramatically to approximately <strong>30 minutes</strong>. This highlights the computational trade-off achieved by scaling hardware to this magnitude.</p><p>However, the true measure of a model’s impact lies in its <strong>inference efficiency</strong> and <strong>benchmark performance</strong> when compared to competitors like OpenAI’s o1. While training cost and duration are critical, <strong>they are speculative in nature.</strong> The benchmarks and real-world performance of DeepSeek-R1 are what truly set it apart, suggesting a significant advantage over OpenAI’s o1 in terms of cost-efficiency and scalability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fc43d381d1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/autonomous-agents/how-deepseek-r1-pushed-the-frontiers-of-reasoning-3fc43d381d1b">How DeepSeek-R1 Pushed the Frontiers of Reasoning</a> was originally published in <a href="https://medium.com/autonomous-agents">Autonomous Agents</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>