<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arun Kumar</title>
    <description>The latest articles on DEV Community by Arun Kumar (@narotra05hp).</description>
    <link>https://dev.to/narotra05hp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4111795%2F61780aa6-3d1e-422b-84fb-a0ddb3fe9a58.png</url>
      <title>DEV Community: Arun Kumar</title>
      <link>https://dev.to/narotra05hp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/narotra05hp"/>
    <language>en</language>
    <item>
      <title>MCP doesn't replace function calling. Your MCP client still emits one.</title>
      <dc:creator>Arun Kumar</dc:creator>
      <pubDate>Thu, 24 Sep 2026 15:23:08 +0000</pubDate>
      <link>https://dev.to/narotra05hp/mcp-doesnt-replace-function-calling-your-mcp-client-still-emits-one-5dgk</link>
      <guid>https://dev.to/narotra05hp/mcp-doesnt-replace-function-calling-your-mcp-client-still-emits-one-5dgk</guid>
      <description>&lt;p&gt;"Do we still need APIs after MCP" keeps coming up, and the framing is off in a way that's worth unpicking. MCP and function calling aren't two options you choose between. They're two layers of the same request, and a system built on MCP runs function calling underneath it every single time.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two gaps
&lt;/h2&gt;

&lt;p&gt;A model can't act on its own. It reads text and predicts more text. Two separate gaps sit between it and anything useful, and each needs its own fix.&lt;/p&gt;

&lt;p&gt;The first gap is expression — the model needs a structured way to say what it wants done. Function calling fills that. It's a capability of the model provider's API, not a protocol: your application sends tool definitions with the request, and the model returns a structured call naming one of them.&lt;/p&gt;

&lt;p&gt;The part people skip: &lt;strong&gt;the model doesn't run anything.&lt;/strong&gt; It hands back a request. Your code executes the function and feeds the result into the next turn.&lt;/p&gt;

&lt;p&gt;The second gap is reach. Your application still has to find the tool, get its schema, and call it correctly — usually across a lot of tools. That's MCP's job. Client-server, JSON-RPC 2.0, discovery at runtime via &lt;code&gt;tools/list&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Function calling links the model to your app. MCP links your app to the tool server.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually happens when both are in play
&lt;/h2&gt;

&lt;p&gt;Five steps, fixed order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The MCP client calls &lt;code&gt;tools/list&lt;/code&gt; on a server and gets tool definitions back, each with a JSON Schema.&lt;/li&gt;
&lt;li&gt;Your application hands those definitions to the model through the provider's function-calling mechanism.&lt;/li&gt;
&lt;li&gt;The model emits a function call — tool name, arguments.&lt;/li&gt;
&lt;li&gt;Your application routes that call to the MCP server as &lt;code&gt;tools/call&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The server executes it, and the result goes back into the conversation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Steps 2 and 3 &lt;em&gt;are&lt;/em&gt; function calling. Adopting MCP doesn't remove them, it feeds them. Note also that the model never talks to the MCP server directly — your application sits in the middle the whole time, translating between a function call and a &lt;code&gt;tools/call&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what is MCP actually for
&lt;/h2&gt;

&lt;p&gt;Not model capability. Models could call functions long before MCP existed.&lt;/p&gt;

&lt;p&gt;It's the N×M problem. Without a shared protocol, wiring N applications to M tools means N×M integrations — three apps each needing five tools is fifteen separate pieces of work, none of which carry over. Wrap each tool once as a server, implement the client once per application, and the total becomes N+M.&lt;/p&gt;

&lt;p&gt;That's the real argument, and it's a good one. It just has nothing to do with whether a model can express a tool call.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part that gets overstated
&lt;/h2&gt;

&lt;p&gt;This is the bit I'd most want people to check themselves, because plenty of write-ups claim MCP ships approval workflows and audit logging out of the box.&lt;/p&gt;

&lt;p&gt;Here's the specification text:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the protocol itself does not mandate any specific user interaction model. For trust &amp;amp; safety and security, there SHOULD always be a human in the loop with the ability to deny tool invocations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;SHOULD. The spec states up front that its key words are to be read per RFC 2119, so that's a recommendation aimed at client implementers, not something the protocol enforces. Nothing in MCP stops a client skipping the check.&lt;/p&gt;

&lt;p&gt;What you do get is a &lt;strong&gt;seam&lt;/strong&gt;. Tools sit behind a server boundary, which is a natural place to put authentication, logging and policy. That part is real and genuinely useful. But you build it yourself. And the boundary means trusting a new party — the server is now part of your threat model, which isn't a free win.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I'd leave it
&lt;/h2&gt;

&lt;p&gt;Reach for function calling whenever a model needs to act. That's every agentic flow, MCP or not.&lt;/p&gt;

&lt;p&gt;Reach for MCP once tools need reuse across applications, or once they live behind a server you don't control. A single script calling one local function probably doesn't need it.&lt;/p&gt;

&lt;p&gt;Most production systems end up running both, because they're solving different problems. "Do we still need APIs after MCP" has the same answer as "do we still need function calling after MCP" — yes, underneath, every time.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Longer version with the full comparison table at &lt;a href="https://diffstudy.com/mcp-vs-function-calling/" rel="noopener noreferrer"&gt;diffstudy.com&lt;/a&gt;. Spec quote from the &lt;a href="https://modelcontextprotocol.io/specification/2025-06-18/server/tools" rel="noopener noreferrer"&gt;MCP specification, 2025-06-18, Server/Tools&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>llm</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>GRPO doesn't remove the reward model. It removes the critic.</title>
      <dc:creator>Arun Kumar</dc:creator>
      <pubDate>Fri, 18 Sep 2026 04:00:00 +0000</pubDate>
      <link>https://dev.to/narotra05hp/grpo-doesnt-remove-the-reward-model-it-removes-the-critic-2pnp</link>
      <guid>https://dev.to/narotra05hp/grpo-doesnt-remove-the-reward-model-it-removes-the-critic-2pnp</guid>
      <description>&lt;p&gt;Every time GRPO comes up I see the same slip — someone says it "gets rid of the reward model". It doesn't. It gets rid of the &lt;em&gt;value&lt;/em&gt; model. Those are two different networks doing unrelated jobs, and telling them apart is most of understanding the algorithm.&lt;/p&gt;

&lt;p&gt;Worth going back to what the DeepSeekMath paper actually claims, because it's more modest than the version that travels.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's a variant, not a successor
&lt;/h2&gt;

&lt;p&gt;Shao and colleagues introduce GRPO as "a variant of Proximal Policy Optimization (PPO)". Not a replacement. A variant. It keeps PPO's clipped ratio, and it keeps the reference model. Three things change: the critic goes, the baseline becomes group-relative, and the KL term moves.&lt;/p&gt;

&lt;p&gt;That's narrower than "GRPO replaces PPO", which is how I usually see it written up.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the critic was costing
&lt;/h2&gt;

&lt;p&gt;PPO is actor-critic, so the critic gets trained alongside the policy. The paper is blunt about the bill. That value function is "typically another model of comparable size as the policy model", and so "it brings a substantial memory and computational burden".&lt;/p&gt;

&lt;p&gt;You're training two large models to ship one.&lt;/p&gt;

&lt;p&gt;There's a second complaint I found more interesting than the memory one. In language-model RL, "usually only the last token is assigned a reward score by the reward model". A signal that sparse "may complicate the training of a value function that is accurate at each token". So the critic is expensive &lt;em&gt;and&lt;/em&gt; hard to fit well. Both halves matter, and only the first one usually gets mentioned.&lt;/p&gt;

&lt;h2&gt;
  
  
  What replaces it
&lt;/h2&gt;

&lt;p&gt;Sampling. For each question GRPO samples a group of outputs, scores every one with a reward model — still present, still doing its job — and uses the group's average as the baseline. Those rewards get "normalized by subtracting the group average and dividing by the group standard deviation".&lt;/p&gt;

&lt;p&gt;So an output's advantage answers a relative question: was this better or worse than its siblings? The paper argues that suits how reward models are built in the first place, since they're trained on comparisons between outputs for the same question.&lt;/p&gt;

&lt;p&gt;Model count goes four to three:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PPO:&lt;/strong&gt; policy, reference, reward, value&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GRPO:&lt;/strong&gt; policy, reference, reward&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The reward model is right there in the second list. It never left.&lt;/p&gt;

&lt;h2&gt;
  
  
  The trade that isn't in the headline
&lt;/h2&gt;

&lt;p&gt;None of this is free. You now need several generations per question instead of one. DeepSeek-R1-Zero sampled 16 outputs per question.&lt;/p&gt;

&lt;p&gt;GRPO trades memory for generation. Memory-bound, that's a good deal. Throughput-bound, maybe not.&lt;/p&gt;

&lt;h2&gt;
  
  
  The KL term moved, it didn't vanish
&lt;/h2&gt;

&lt;p&gt;Second thing I see stated wrong: that GRPO drops KL regularisation. PPO adds "a per-token KL penalty from a reference model in the reward at each token". GRPO works "instead of adding KL penalty in the reward" and "regularizes by directly adding the KL divergence" to the loss.&lt;/p&gt;

&lt;p&gt;Same idea, different address. GRPO also uses an unbiased estimator "which is guaranteed to be positive".&lt;/p&gt;

&lt;h2&gt;
  
  
  The finding I didn't expect
&lt;/h2&gt;

&lt;p&gt;This one rarely survives into summaries, and it's the part I'd most want people to take away.&lt;/p&gt;

&lt;p&gt;The DeepSeekMath authors measured Pass@K and Maj@K before and after RL. The result was asymmetric: "RL enhances Maj@K's performance but not Pass@K".&lt;/p&gt;

&lt;p&gt;Read that slowly. The model got better at reliably surfacing an answer it could already produce. It did not start producing answers that were previously out of reach. The authors draw the conclusion themselves — the gain is "attributed to boosting the correct response from TopK rather than the enhancement of fundamental capabilities".&lt;/p&gt;

&lt;p&gt;That is a considerably narrower claim than the one usually made for RL fine-tuning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two things worth keeping straight
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The value model went, the reward model stayed.&lt;/strong&gt; If someone says GRPO removed the reward model, they've merged two different networks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;R1's rule-based rewards were a separate decision.&lt;/strong&gt; DeepSeek-R1 did drop neural reward models for reasoning tasks, but for another reason entirely: "neural reward models are susceptible to reward hacking during large-scale reinforcement learning". That's a robustness call, not a memory one, and it applied to reasoning tasks specifically. It gets folded into the GRPO story where it doesn't belong.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Longer version with every quote sourced at &lt;a href="https://diffstudy.com/grpo-vs-ppo/" rel="noopener noreferrer"&gt;diffstudy.com&lt;/a&gt;. Sources: &lt;a href="https://arxiv.org/abs/2402.03300" rel="noopener noreferrer"&gt;arXiv 2402.03300&lt;/a&gt; (DeepSeekMath), &lt;a href="https://arxiv.org/abs/2501.12948" rel="noopener noreferrer"&gt;arXiv 2501.12948&lt;/a&gt; (DeepSeek-R1), &lt;a href="https://arxiv.org/abs/1707.06347" rel="noopener noreferrer"&gt;arXiv 1707.06347&lt;/a&gt; (PPO).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>llm</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Muon doesn't replace AdamW. Every Muon run still has AdamW in it.</title>
      <dc:creator>Arun Kumar</dc:creator>
      <pubDate>Mon, 14 Sep 2026 04:00:00 +0000</pubDate>
      <link>https://dev.to/narotra05hp/muon-doesnt-replace-adamw-every-muon-run-still-has-adamw-in-it-1205</link>
      <guid>https://dev.to/narotra05hp/muon-doesnt-replace-adamw-every-muon-run-still-has-adamw-in-it-1205</guid>
      <description>&lt;p&gt;Muon gets written up as the optimizer that finally beats AdamW. Reading Keller Jordan's original post, that framing falls apart in the first section — and what's actually going on is more interesting.&lt;/p&gt;

&lt;h2&gt;
  
  
  It was never meant to cover the whole model
&lt;/h2&gt;

&lt;p&gt;Here's the definition, from the post that introduced it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Muon is an optimizer for 2D parameters of neural network hidden layers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hidden layers. 2D. That's the scope, stated up front. What about everything else?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When training a neural network with Muon, scalar and vector parameters of the network, as well as the input and output layers, should be optimized by a standard method such as AdamW.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So your biases, your LayerNorm gains, your scalars — AdamW. And the input and output layers too, which is the part I found genuinely surprising:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Empirically, we find that it is also important to optimize input and output parameters using AdamW, even though these are typically 2D.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read that again. The embedding matrix and the classifier head &lt;em&gt;are&lt;/em&gt; 2D. They fit Muon's stated scope perfectly. And you should still use AdamW on them, because it works better. Jordan is explicit that for transformers, AdamW "should be used for the embedding and final classifier head layers in order to attain the best performance".&lt;/p&gt;

&lt;p&gt;A transformer's embedding and unembedding are a serious fraction of its parameters. So "we switched from AdamW to Muon" almost always means "we run both, and Muon takes the middle."&lt;/p&gt;

&lt;h2&gt;
  
  
  Then it borrowed AdamW's defining feature
&lt;/h2&gt;

&lt;p&gt;This is the part that made me laugh.&lt;/p&gt;

&lt;p&gt;AdamW exists because of one idea: decouple weight decay from the gradient update. That's the whole paper — it's in the title, &lt;em&gt;Decoupled Weight Decay Regularization&lt;/em&gt;. Take that away and you have Adam.&lt;/p&gt;

&lt;p&gt;Now here's Moonshot AI's paper on scaling Muon to real model sizes. Their two contributions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We identify two crucial techniques for scaling up Muon: (1) adding weight decay and (2) carefully adjusting the per-parameter update scale.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Contribution number one is weight decay. Muon needed AdamW's signature idea bolted on before it would scale.&lt;/p&gt;

&lt;p&gt;That isn't a criticism of Muon — it's how optimizer research works, and the result is good. But it does make "Muon replaces AdamW" a strange thing to say about an optimizer that runs alongside AdamW and adopted its main contribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it actually buys you
&lt;/h2&gt;

&lt;p&gt;The numbers are real and worth knowing precisely, because they get inflated in the retelling.&lt;/p&gt;

&lt;p&gt;From Jordan's results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CIFAR-10 to 94% accuracy: speed record improved &lt;strong&gt;from 3.3 to 2.6 A100-seconds&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;NanoGPT speedrunning to 3.28 val loss: faster &lt;strong&gt;by a factor of 1.35x&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;A 1.5B transformer to GPT-2 XL level on HellaSwag: &lt;strong&gt;10 8xH100-hours, against 13.3 for AdamW&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And from Moonshot at larger scale, with scaling-law experiments behind it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Muon achieves ∼ 2× computational efficiency compared to AdamW with compute optimal training&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;They trained Moonlight, a 3B/16B MoE, on 5.7T tokens with it. So this isn't a toy-scale result any more.&lt;/p&gt;

&lt;p&gt;But notice the spread: 1.35x on NanoGPT, roughly 1.33x on the 1.5B run, around 2x in Moonshot's scaling-law setting. "2x faster than AdamW" is the number that travels, and it's the top of the range, from one paper's specific setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  The mechanism, briefly
&lt;/h2&gt;

&lt;p&gt;AdamW keeps two running averages per parameter and rescales each weight individually. Every parameter is treated as its own little scalar problem.&lt;/p&gt;

&lt;p&gt;Muon treats a weight matrix as a matrix. It takes the momentum update and orthogonalises it using a Newton-Schulz iteration, so the update doesn't collapse toward a few dominant directions. That's why it only makes sense for 2D hidden layers — the whole idea depends on there being a meaningful matrix structure to condition.&lt;/p&gt;

&lt;p&gt;Which also explains the embedding exception. An embedding table is 2D in shape, but it isn't doing matrix-multiply work in the same sense, and empirically it prefers AdamW.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd take away
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Muon is a hidden-layer optimizer, not a whole-model one.&lt;/strong&gt; If someone says they replaced AdamW, ask what's optimizing their embeddings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The headline number is a range, not a constant.&lt;/strong&gt; 1.35x on speedrunning, around 2x in Moonshot's scaling-law experiments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's additive, not a replacement.&lt;/strong&gt; The current best setup is Muon on 2D hidden layers plus AdamW on everything else — which is exactly what the original post recommends.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Longer version with every quote sourced at &lt;a href="https://diffstudy.com/muon-vs-adamw/" rel="noopener noreferrer"&gt;diffstudy.com&lt;/a&gt;. Sources: &lt;a href="https://kellerjordan.github.io/posts/muon/" rel="noopener noreferrer"&gt;Keller Jordan's Muon post&lt;/a&gt;, &lt;a href="https://arxiv.org/abs/2502.16982" rel="noopener noreferrer"&gt;arXiv 2502.16982&lt;/a&gt; (Moonshot AI), &lt;a href="https://arxiv.org/abs/1711.05101" rel="noopener noreferrer"&gt;arXiv 1711.05101&lt;/a&gt; (AdamW).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>"RoPE extrapolates to longer contexts" — someone finally measured it, and it doesn't</title>
      <dc:creator>Arun Kumar</dc:creator>
      <pubDate>Thu, 10 Sep 2026 04:00:00 +0000</pubDate>
      <link>https://dev.to/narotra05hp/rope-extrapolates-to-longer-contexts-someone-finally-measured-it-and-it-doesnt-5dnk</link>
      <guid>https://dev.to/narotra05hp/rope-extrapolates-to-longer-contexts-someone-finally-measured-it-and-it-doesnt-5dnk</guid>
      <description>&lt;p&gt;You've read this sentence, or something close to it: &lt;em&gt;RoPE handles longer sequences than absolute positional encoding because rotations are periodic.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I believed it too. Then I went looking for where it was measured, and found the opposite.&lt;/p&gt;

&lt;p&gt;The claim has a four-paper history, and following it in order is more interesting than the claim itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  2017: a hedge
&lt;/h2&gt;

&lt;p&gt;The original Transformer paper picks sinusoidal encodings over learned ones, and gives a reason:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We chose the sinusoidal version because it may allow the model to extrapolate to sequence lengths longer than the ones encountered during training.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;May.&lt;/em&gt; Vaswani and colleagues were careful. It's a hypothesis, offered as a tiebreaker between two options that — by their own testing — "produced nearly identical results".&lt;/p&gt;

&lt;p&gt;That word survives almost nowhere downstream. It got quoted into oblivion as a property.&lt;/p&gt;

&lt;h2&gt;
  
  
  2021: RoPE arrives
&lt;/h2&gt;

&lt;p&gt;Su and colleagues introduce rotary embeddings and list "the flexibility of sequence length" among its properties.&lt;/p&gt;

&lt;p&gt;Nothing wrong with that. It's a design claim about the mechanism, made before anyone had measured the ceiling. But between 2017's &lt;em&gt;may&lt;/em&gt; and 2021's property list, "might extrapolate" quietly became "extrapolates".&lt;/p&gt;

&lt;h2&gt;
  
  
  2022: someone measures it
&lt;/h2&gt;

&lt;p&gt;This is the paper that should have ended the folklore, and mostly didn't.&lt;/p&gt;

&lt;p&gt;The ALiBi paper (Press, Smith and Lewis, ICLR 2022) exists to test length extrapolation, and it tests the incumbents first. On sinusoidal encodings — the thing the 2017 paper hoped would extrapolate — the verdict is that it "in practice has very limited extrapolation capabilities".&lt;/p&gt;

&lt;p&gt;On rotary:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Though the rotary position method improves over the sinusoidal one, it still does not achieve satisfying results.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Better than sinusoids. Still not good. And they put numbers on it: a model trained at length 512 keeps improving perplexity for about &lt;strong&gt;200 extra tokens&lt;/strong&gt;. At length 1024, about &lt;strong&gt;100&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Two hundred tokens. Not 2x, not 10x. And the paper notes that even this "comes at the cost of slower training and inference".&lt;/p&gt;

&lt;h2&gt;
  
  
  2023: the patch that proves the point
&lt;/h2&gt;

&lt;p&gt;If RoPE extrapolated, Position Interpolation wouldn't need to exist.&lt;/p&gt;

&lt;p&gt;Chen and colleagues open by naming the problem directly — many pre-trained LLMs, LLaMA included, "use positional encodings that have weak extrapolation properties" — and RoPE is the example they name. Their fix doesn't extrapolate at all. It &lt;strong&gt;interpolates&lt;/strong&gt;: squeeze the position indices down into the range the model already saw.&lt;/p&gt;

&lt;p&gt;Why not just push past the trained length? Because doing so "may lead to catastrophically high attention scores that completely ruin the self-attention mechanism".&lt;/p&gt;

&lt;p&gt;That's the strongest evidence available. A whole technique exists because the free-extrapolation story isn't true.&lt;/p&gt;

&lt;h2&gt;
  
  
  The other thing everyone gets backwards
&lt;/h2&gt;

&lt;p&gt;While I was in the RoFormer paper I hit a second surprise. People describe RoPE as &lt;em&gt;relative&lt;/em&gt; positional encoding, in contrast to &lt;em&gt;absolute&lt;/em&gt;. Here's the abstract:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the proposed RoPE encodes the absolute position with a rotation matrix and meanwhile incorporates the explicit relative position dependency in self-attention formulation&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's both. Simultaneously. And once you see the mechanism it's obvious why: each vector rotates by an angle set by its own &lt;strong&gt;absolute&lt;/strong&gt; index, and when you take the dot product of a rotated query and a rotated key, the absolute angles cancel and only the &lt;strong&gt;offset&lt;/strong&gt; survives.&lt;/p&gt;

&lt;p&gt;Absolute goes in. Relative comes out. One operation.&lt;/p&gt;

&lt;p&gt;The 2017 side wasn't purely absolute either, incidentally — the sinusoidal choice was motivated by the hope the model would "easily learn to attend by relative positions". The clean absolute/relative split was never real.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd actually keep
&lt;/h2&gt;

&lt;p&gt;None of this makes RoPE a bad choice. It dominates modern stacks for good reasons — it composes with the KV cache, it never touches the value vector, and it has a provable long-term decay property that sinusoids never claimed.&lt;/p&gt;

&lt;p&gt;But three corrections stuck with me:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It doesn't extrapolate for free.&lt;/strong&gt; Measured at ~200 extra tokens past a 512 training length. If you need a longer window you need Position Interpolation, or YaRN, or retraining. The encoding alone doesn't give it to you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It isn't "relative instead of absolute".&lt;/strong&gt; It's both, by construction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The 2017 authors weren't wrong.&lt;/strong&gt; They wrote &lt;em&gt;may&lt;/em&gt;, and hedged correctly. The folklore is downstream of people dropping the hedge.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Longer version with every quote sourced at &lt;a href="https://diffstudy.com/rope-vs-absolute-positional-encoding/" rel="noopener noreferrer"&gt;diffstudy.com&lt;/a&gt;. Papers: &lt;a href="https://arxiv.org/abs/1706.03762" rel="noopener noreferrer"&gt;1706.03762&lt;/a&gt; (Transformer), &lt;a href="https://arxiv.org/abs/2104.09864" rel="noopener noreferrer"&gt;2104.09864&lt;/a&gt; (RoFormer), &lt;a href="https://arxiv.org/abs/2108.12409" rel="noopener noreferrer"&gt;2108.12409&lt;/a&gt; (ALiBi), &lt;a href="https://arxiv.org/abs/2306.15595" rel="noopener noreferrer"&gt;2306.15595&lt;/a&gt; (Position Interpolation).&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>llm</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Speculative decoding won't change your model's distribution. It might still change your output.</title>
      <dc:creator>Arun Kumar</dc:creator>
      <pubDate>Sun, 06 Sep 2026 05:35:06 +0000</pubDate>
      <link>https://dev.to/narotra05hp/speculative-decoding-wont-change-your-models-distribution-it-might-still-change-your-output-3de8</link>
      <guid>https://dev.to/narotra05hp/speculative-decoding-wont-change-your-models-distribution-it-might-still-change-your-output-3de8</guid>
      <description>&lt;p&gt;There's a thread on the DeepSeek-R1 model page that's been sitting unresolved since March last year, and it bothered me enough to go read the papers.&lt;/p&gt;

&lt;p&gt;Someone had tried speculative decoding and reported that the output got worse — "very low quality words for the given context, words it would never generate by itself". Someone else replied that this is impossible, because the main model verifies and corrects everything the draft model proposes. Neither budged.&lt;/p&gt;

&lt;p&gt;They're both right. That took me a while to see.&lt;/p&gt;

&lt;h2&gt;
  
  
  The guarantee is real
&lt;/h2&gt;

&lt;p&gt;The claim that speculative decoding can't hurt quality isn't marketing. It's proven, twice, independently.&lt;/p&gt;

&lt;p&gt;Leviathan and colleagues at Google introduced the technique in 2022 and state it flatly: "A strong property of Algorithm 1 is that the output distribution is guaranteed to remain unchanged". Chen and colleagues at DeepMind arrived at the same place a few months later through a different proof — theirs is "a novel modified rejection sampling scheme which preserves the distribution of the target model within hardware numerics".&lt;/p&gt;

&lt;p&gt;So the person insisting it cannot degrade quality has the papers behind them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The guarantee is also narrower than it sounds
&lt;/h2&gt;

&lt;p&gt;Here's the part almost every explainer skips, and it's sitting right there in the DeepMind paper:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;because the different computation graphs lead to different numerics, we cannot not expect identical outputs&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;(The doubled "not" is theirs. I left it.)&lt;/p&gt;

&lt;p&gt;Read that against the guarantee and the argument dissolves. The &lt;strong&gt;distribution&lt;/strong&gt; is preserved. The &lt;strong&gt;sample&lt;/strong&gt; is not the same sample. You're drawing from the same distribution through a different computation graph, with different floating-point behaviour in the batched verification pass than in a plain decode.&lt;/p&gt;

&lt;p&gt;So on any single prompt, you can absolutely get different text. Sometimes worse-looking text. That isn't the method failing — it's what same-distribution-but-different-draw means in practice.&lt;/p&gt;

&lt;p&gt;Which is exactly what the person reporting bad output experienced. And exactly why the person quoting the theory couldn't reproduce it.&lt;/p&gt;

&lt;p&gt;Worth noting: Leviathan's own abstract does claim "identical outputs" for their T5X experiments. That's true for their setup — argmax sampling, one implementation. It's a property of that configuration, not a law.&lt;/p&gt;

&lt;h2&gt;
  
  
  It does more work, not less
&lt;/h2&gt;

&lt;p&gt;This is the bit that genuinely surprised me.&lt;/p&gt;

&lt;p&gt;I'd absorbed the idea that speculative decoding is a clever way to do less computation. It's the opposite. Leviathan has an entire section titled &lt;em&gt;Number of Arithmetic Operations&lt;/em&gt;, and it says the number of concurrent arithmetic operations "grows by a factor of" gamma plus one. Every rejected draft token is compute you spent and threw away.&lt;/p&gt;

&lt;p&gt;Total FLOPs go &lt;strong&gt;up&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's faster anyway, because arithmetic was never what you were waiting on. From the same paper: inference from large models is "often not bottlenecked on arithmetic operations, but rather on memory bandwidth and communication". Chen puts it in five words — "Transformer sampling is typically memory bandwidth bound".&lt;/p&gt;

&lt;p&gt;Your accelerator is sitting idle waiting on memory. Speculative decoding spends that idle compute to avoid serial steps. It's a trade, and it only pays because one side of the ledger was free.&lt;/p&gt;

&lt;p&gt;That reframing changed how I think about the whole category. Same shape as FlashAttention, incidentally — a technique everyone describes as making attention cheaper, when it is really about memory movement.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the numbers actually look like
&lt;/h2&gt;

&lt;p&gt;Chen's Table 1, Chinchilla 70B, batch size 1, K=4:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;th&gt;Time per token&lt;/th&gt;
&lt;th&gt;Speedup&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Autoregressive, XSum&lt;/td&gt;
&lt;td&gt;0.112&lt;/td&gt;
&lt;td&gt;14.1 ms&lt;/td&gt;
&lt;td&gt;1x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speculative, XSum&lt;/td&gt;
&lt;td&gt;0.114&lt;/td&gt;
&lt;td&gt;7.52 ms&lt;/td&gt;
&lt;td&gt;1.92x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Autoregressive, HumanEval&lt;/td&gt;
&lt;td&gt;45.1%&lt;/td&gt;
&lt;td&gt;14.1 ms&lt;/td&gt;
&lt;td&gt;1x&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speculative, HumanEval&lt;/td&gt;
&lt;td&gt;47.0%&lt;/td&gt;
&lt;td&gt;5.73 ms&lt;/td&gt;
&lt;td&gt;2.46x&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Time per token roughly halves. Now look at the quality column — HumanEval goes &lt;em&gt;up&lt;/em&gt;, 45.1 to 47.0.&lt;/p&gt;

&lt;p&gt;Don't read that as an improvement. Elsewhere in the same table, XSum's greedy ROUGE-2 goes down, 0.157 to 0.156. Small movements in both directions across metrics is precisely what a distribution-preserving method should produce. If speculative decoding reliably improved scores, the theory would be wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the speedup goes away
&lt;/h2&gt;

&lt;p&gt;Both papers are more careful than the blog posts about them.&lt;/p&gt;

&lt;p&gt;You need spare compute — Leviathan is explicit that the algorithm assumes "we have enough compute resources to support the increased concurrency". No headroom, no win.&lt;/p&gt;

&lt;p&gt;You need a high acceptance rate. Every rejected token is wasted work.&lt;/p&gt;

&lt;p&gt;And the draft model has to be genuinely cheap. This is the counterintuitive one: against an 11B target, Leviathan found T5-small (77M) beat both T5-base (250M) and T5-large (800M). The best draft model was the smallest one tested, not the most accurate.&lt;/p&gt;

&lt;p&gt;One more caveat that gets dropped constantly: &lt;strong&gt;both papers measured at batch size 1.&lt;/strong&gt; That's a latency benchmark. Chen notes that other techniques are the ones aimed at throughput "(at larger batch sizes)". If you're serving large batches, don't expect these numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  So who was right in that thread?
&lt;/h2&gt;

&lt;p&gt;Both, and the disagreement was never really about speculative decoding.&lt;/p&gt;

&lt;p&gt;The theory says your distribution is untouched. Your eyes say the text came out different. Both statements are true simultaneously, and the papers are clear about why, and nobody in the thread had read that far.&lt;/p&gt;

&lt;p&gt;If your output is &lt;em&gt;reproducibly&lt;/em&gt; worse across many prompts, that's an implementation problem — there's a 2025 paper showing some engines break the distribution guarantee outright once batch size exceeds one. If it's one bad generation, that's just a different draw.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I went through both papers line by line for a longer write-up at &lt;a href="https://diffstudy.com/speculative-decoding-vs-autoregressive-decoding/" rel="noopener noreferrer"&gt;diffstudy.com&lt;/a&gt;, with every quote sourced. Papers are &lt;a href="https://arxiv.org/abs/2211.17192" rel="noopener noreferrer"&gt;arXiv 2211.17192&lt;/a&gt; (Leviathan et al.) and &lt;a href="https://arxiv.org/abs/2302.01318" rel="noopener noreferrer"&gt;arXiv 2302.01318&lt;/a&gt; (Chen et al.) if you'd rather go straight to them.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
