<?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: Orkas</title>
    <description>The latest articles on DEV Community by Orkas (@cxw_orkas).</description>
    <link>https://dev.to/cxw_orkas</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%2F4013342%2F5650c45d-f01e-40e9-929c-88af4e53a4f3.png</url>
      <title>DEV Community: Orkas</title>
      <link>https://dev.to/cxw_orkas</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cxw_orkas"/>
    <language>en</language>
    <item>
      <title>Your Moat Is Someone Else's API</title>
      <dc:creator>Orkas</dc:creator>
      <pubDate>Wed, 12 Aug 2026 10:17:29 +0000</pubDate>
      <link>https://dev.to/cxw_orkas/your-moat-is-someone-elses-api-1pb9</link>
      <guid>https://dev.to/cxw_orkas/your-moat-is-someone-elses-api-1pb9</guid>
      <description>&lt;p&gt;You built an AI product. People use it. The numbers go up.&lt;/p&gt;

&lt;p&gt;Then someone asks: &lt;em&gt;how is this different from just using the model directly?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And you don't have a good answer.&lt;/p&gt;

&lt;p&gt;Not because you didn't build anything. You built prompts, workflows, context management, eval harnesses, a UI people actually like. But none of that lives in the &lt;strong&gt;intelligence&lt;/strong&gt; layer.&lt;/p&gt;

&lt;p&gt;And the intelligence layer is rented.&lt;/p&gt;




&lt;h2&gt;
  
  
  What the business actually is
&lt;/h2&gt;

&lt;p&gt;Strip the narrative away and most consumer AI startups today are doing the same thing: &lt;strong&gt;buying intelligence by the token and reselling it by the month.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You buy capability from a model vendor at metered rates, wrap it in a product, and charge a subscription. The spread is the business.&lt;/p&gt;

&lt;p&gt;That's not an insult, it's a description. Plenty of good businesses are built on resale. But it has one structural property worth being honest about: &lt;strong&gt;the thing your product is actually made of doesn't belong to you.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What that costs you
&lt;/h2&gt;

&lt;p&gt;Four consequences follow, and they compound.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prices move, and your margin moves with them.&lt;/strong&gt; Your unit economics are set by someone else's pricing page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Behavior changes, and your product changes with it.&lt;/strong&gt; A model update ships, your outputs shift, and you usually find out from users rather than from a changelog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your scenario can get absorbed.&lt;/strong&gt; If what you do is valuable and general enough, there's a real chance the vendor ships it natively. At that point you're not competing on product, you're competing on still being necessary.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your layer thins as the base model improves.&lt;/strong&gt; This one is slower and easier to miss. A meaningful share of your prompt engineering, retry logic, format coercion, and orchestration scaffolding exists &lt;em&gt;because the model can't do it reliably yet&lt;/em&gt;. Each generation absorbs some of it.&lt;/p&gt;

&lt;p&gt;The "it's just a wrapper" criticism stings not because it's rude, but because it names something true:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How much value you hold is a function of what the model hasn't done yet.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  "But we have user data"
&lt;/h2&gt;

&lt;p&gt;The standard answer to the moat question is the data flywheel: more users → more data → better product → more users.&lt;/p&gt;

&lt;p&gt;Under the constraint that you don't own a model, that flywheel mostly doesn't spin. It jams in three places.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. You can't use the data
&lt;/h3&gt;

&lt;p&gt;User data carries privacy obligations. Whether it can be used for training, how it gets de-identified, what your consent language actually covers — each is a real gate. Plenty of teams have the logs and can't get past legal.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Even if you can use it, there's nowhere to put it
&lt;/h3&gt;

&lt;p&gt;You don't own a model. The data can go into prompts, into retrieval, into a thin adapter. It cannot go into the intelligence itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The quality isn't there
&lt;/h3&gt;

&lt;p&gt;What actually improves a model is labeled, outcome-verified, feedback-carrying samples. What most applications accumulate is logs. Logs are excellent for analytics. They are not training data.&lt;/p&gt;

&lt;p&gt;So for most application companies, "data flywheel" has been a story rather than a mechanism.&lt;/p&gt;




&lt;h2&gt;
  
  
  So why not train your own?
&lt;/h2&gt;

&lt;p&gt;Two years ago this was a bad idea, for two solid reasons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open models were meaningfully behind.&lt;/strong&gt; Building on one meant starting from a lower ceiling. You'd invest months and still ship something worse than a direct API call.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The base models were improving fast.&lt;/strong&gt; Any domain advantage you spent six months building could be erased by the next general release. The ROI didn't close.&lt;/p&gt;

&lt;p&gt;So "the application layer shouldn't touch models" became close to consensus. &lt;strong&gt;And at the time, that consensus was correct.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;p&gt;Two things, roughly at once.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Open models crossed into trillion-parameter territory&lt;/strong&gt;, with substantially stronger coding and agentic capability. They handle genuinely complex long-horizon tasks now. On general capability the gap to the closed frontier has narrowed considerably.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain-targeted post-training became a real lever.&lt;/strong&gt; In a specific domain, with the right data, there is now &lt;em&gt;a chance&lt;/em&gt; of beating the closed SOTA model &lt;em&gt;in that domain&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Read that carefully: &lt;strong&gt;a chance, not a certainty.&lt;/strong&gt; I'm not claiming you will. I'm claiming it moved from "essentially impossible" to "possible" — and that shift is large enough to change a decision that was previously automatic.&lt;/p&gt;




&lt;h2&gt;
  
  
  "Owning" is a spectrum, not a binary
&lt;/h2&gt;

&lt;p&gt;Worth being precise here, because "own your model" gets thrown around loosely and the levels have very different economics.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Level&lt;/th&gt;
&lt;th&gt;What you own&lt;/th&gt;
&lt;th&gt;Flywheel works?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Prompt + retrieval&lt;/td&gt;
&lt;td&gt;Nothing&lt;/td&gt;
&lt;td&gt;No — this is renting with extra steps&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adapter / LoRA on a hosted model&lt;/td&gt;
&lt;td&gt;A small delta you can't deploy independently&lt;/td&gt;
&lt;td&gt;Barely — still bounded by the host&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Post-training an open base you deploy yourself&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;The weights you ship&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes — this is where the argument starts to hold&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pre-training from scratch&lt;/td&gt;
&lt;td&gt;Everything&lt;/td&gt;
&lt;td&gt;Yes, but the economics here have &lt;em&gt;not&lt;/em&gt; changed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When I say "owning intelligence" in this post, I mean &lt;strong&gt;the third row&lt;/strong&gt;. The first two are worth doing and often sufficient; they just don't buy you the thing this post is about.&lt;/p&gt;




&lt;h2&gt;
  
  
  What owning intelligence actually buys you
&lt;/h2&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;Renting&lt;/th&gt;
&lt;th&gt;Owning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;General capability; latency set by the vendor&lt;/td&gt;
&lt;td&gt;Trim capability you don't need; optimize inference for your shape&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linear in tokens&lt;/td&gt;
&lt;td&gt;Marginal cost drops sharply past scale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Control&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Price changes, deprecations, rate limits, absorption&lt;/td&gt;
&lt;td&gt;Yours&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data flywheel&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Doesn't spin — nowhere to put the data&lt;/td&gt;
&lt;td&gt;Data goes into post-training; gains feed usage&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The first three rows are cost and risk management. &lt;strong&gt;The fourth is compounding&lt;/strong&gt;, and it's the one that decides long-run separation. Owning a model is what finally gives your data somewhere to go.&lt;/p&gt;




&lt;h2&gt;
  
  
  Should &lt;em&gt;you&lt;/em&gt; do this?
&lt;/h2&gt;

&lt;p&gt;Six questions. Be honest on each.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Is general-purpose capability &lt;em&gt;clearly&lt;/em&gt; insufficient in your domain?&lt;/li&gt;
&lt;li&gt;[ ] Do you have data nobody else can get?&lt;/li&gt;
&lt;li&gt;[ ] Can that data legally be used for training?&lt;/li&gt;
&lt;li&gt;[ ] Is inference cost a material line item yet?&lt;/li&gt;
&lt;li&gt;[ ] Is latency central to the product experience?&lt;/li&gt;
&lt;li&gt;[ ] Can you staff and fund a post-training team?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4+ yes&lt;/strong&gt; → worth seriously evaluating.&lt;br&gt;
&lt;strong&gt;2–3 yes&lt;/strong&gt; → try it on one narrow slice. Don't restructure the company around it.&lt;br&gt;
&lt;strong&gt;0–1 yes&lt;/strong&gt; → keep renting. That is the rational call, not the cowardly one.&lt;/p&gt;

&lt;p&gt;This is a framing device, not a scorecard. Where you set the threshold depends on your runway and your window.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three things that have to be said
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. This is not free.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Owning intelligence means a team that understands post-training, compute, a data pipeline, and eval infrastructure you trust. It also means accepting real risk that your iteration speed gets &lt;em&gt;worse&lt;/em&gt; before it gets better. Those costs are not small, and they're mostly fixed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Most companies should not do this.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If general models are good enough for your domain, if your volume is still small, if you have no proprietary data — renting is correct. Don't do this because it makes a better story for the next round.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. This judgment will change again.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once intelligence is cheap and ubiquitous, the application layer will grow new business models, and "owns a model" may stop being an interesting axis at all. I'd expect that to happen.&lt;/p&gt;

&lt;p&gt;So I'm not going to tell you that you &lt;em&gt;should&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The accurate statement is narrower:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For the first time, owning your intelligence is a real option rather than a wrong answer. It used to be a mistake. Now it's a calculation worth actually running.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  What this post is and isn't
&lt;/h2&gt;

&lt;p&gt;This is a judgment call, not a benchmark report.&lt;/p&gt;

&lt;p&gt;I've deliberately included &lt;strong&gt;no scores&lt;/strong&gt;. How far open models have come &lt;em&gt;in your domain&lt;/em&gt;, and what post-training actually buys you &lt;em&gt;on your data&lt;/em&gt;, are things you have to measure yourself. The general trend is real; the size of the effect is entirely domain-dependent. Don't take anyone's word for the magnitude — including mine.&lt;/p&gt;

&lt;p&gt;If you disagree with the framing, I'd genuinely like to hear where. The weakest link in the argument is probably the claim that domain post-training can beat a closed frontier model in-domain — that's the part most sensitive to what "domain" means and how much data you actually have.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;If you're building on rented intelligence right now: which row of that table hurts most?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt; — volume goes up and the economics stop working&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Control&lt;/strong&gt; — you're one roadmap decision away from being redundant&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flywheel&lt;/strong&gt; — the data is piling up and there's nowhere for it to go&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Curious whether the ordering matches what I'd expect. I'd guess control ranks higher than cost for most people, and that flywheel only ranks first for teams who've already tried and hit the wall.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>posttrain</category>
    </item>
    <item>
      <title>Your Agent Isn't Repeating Itself. That's Why You Can't Catch It Spinning</title>
      <dc:creator>Orkas</dc:creator>
      <pubDate>Tue, 28 Jul 2026 03:51:54 +0000</pubDate>
      <link>https://dev.to/cxw_orkas/your-agent-isnt-repeating-itself-thats-why-you-cant-catch-it-spinning-5099</link>
      <guid>https://dev.to/cxw_orkas/your-agent-isnt-repeating-itself-thats-why-you-cant-catch-it-spinning-5099</guid>
      <description>&lt;p&gt;I've been reading BEACON from Zhejiang University's ZJU-REAL lab (&lt;a href="https://arxiv.org/abs/2605.06078" rel="noopener noreferrer"&gt;arXiv:2605.06078&lt;/a&gt;), and the more I read it the more directly applicable it felt to the long-horizon agent work we're doing. So I'm turning that into a series.&lt;/p&gt;

&lt;h2&gt;
  
  
  The framing
&lt;/h2&gt;

&lt;p&gt;To build a long-horizon agent that actually works, I think two things have to be right:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The agent keeps making progress toward the goal&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context compaction&lt;/strong&gt; — what is safe to forget&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Milestone design&lt;/strong&gt; — how do you know a step is &lt;em&gt;really&lt;/em&gt; done&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spin prevention&lt;/strong&gt; — when it gets stuck, something has to notice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. The agent can reflect and improve&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This post covers spin prevention, from the first group. It goes first because it's the one that hurt us most.&lt;/p&gt;




&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;We had user reports, and saw it internally too: some very long tasks just stop moving forward partway through.&lt;/p&gt;

&lt;p&gt;Look at the logs and the agent is &lt;em&gt;busy&lt;/em&gt; — reading files, searching, running commands, never idle. But half an hour goes by and nothing has advanced.&lt;/p&gt;

&lt;p&gt;My first explanation was context loss: compaction dropped the record that "this path was already tried," so the agent went and tried it again.&lt;/p&gt;

&lt;p&gt;Digging through the code and the logs, that turned out to be only half the story.&lt;/p&gt;




&lt;h2&gt;
  
  
  We already had guards. Three tiers of them.
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tier&lt;/th&gt;
&lt;th&gt;Criterion&lt;/th&gt;
&lt;th&gt;Thresholds&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Exact repeat&lt;/td&gt;
&lt;td&gt;Tool name + canonicalized args, byte-identical&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;LOOP_WARN=3&lt;/code&gt; warn / &lt;code&gt;LOOP_HARD=5&lt;/code&gt; force-stop&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Near-duplicate&lt;/td&gt;
&lt;td&gt;Identical except volatile id / timestamp fields&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;NEAR_DUP_LOOP_WARN=6&lt;/code&gt; / &lt;code&gt;NEAR_DUP_LOOP_HARD=12&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spin convergence&lt;/td&gt;
&lt;td&gt;≥2 compactions &lt;strong&gt;and&lt;/strong&gt; ≥75% of the tool-loop budget burned&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;SPIN_CONVERGENCE_MIN_COMPACTIONS=2&lt;/code&gt;&lt;br&gt;&lt;code&gt;SPIN_CONVERGENCE_TOOL_LOOP_RATIO=0.75&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the problem wasn't that nobody built anything. It's that what we built couldn't catch it.&lt;/p&gt;




&lt;h2&gt;
  
  
  The blind spot: all three are input-side detectors
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;toolCallSignature = tool name + canonicalized args
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That signature answers exactly one question: &lt;strong&gt;are you doing the same thing twice?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But a capable model that's stuck doesn't repeat calls. It does this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;read file A → grep X → re-read A with a different line range
  → run a slightly different command → read file B → grep again …
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every single call has a distinct signature. All three tiers stay silent.&lt;/p&gt;

&lt;p&gt;And during that entire stretch, the number of &lt;strong&gt;verifiable state changes is zero&lt;/strong&gt;. No file actually rewritten. No command producing a new result. Nothing irreversible happening at all.&lt;/p&gt;

&lt;p&gt;One line:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Loop detection ≠ stall detection.&lt;/strong&gt; The first looks at inputs. The second has to look at outputs.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  The paper gives exactly that output-side definition
&lt;/h2&gt;

&lt;p&gt;BEACON's in-segment reward:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;r_t = R_ms · γ^(t_k − t)    if the segment ends in a milestone
    = 0                     otherwise
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A segment that doesn't terminate in a milestone earns &lt;strong&gt;exactly zero&lt;/strong&gt; — regardless of how many actions it contained. Action count doesn't enter the formula at all.&lt;/p&gt;

&lt;p&gt;That's the cleanest formalization of &lt;em&gt;busy ≠ progressing&lt;/em&gt; I've seen.&lt;/p&gt;

&lt;p&gt;The baseline layer is harsher still. The baseline is the group-average &lt;strong&gt;per-step&lt;/strong&gt; return, so if your segment took 8 steps while the group averaged 5, the &lt;em&gt;entire&lt;/em&gt; segment's advantage skews negative, and the penalty scales with how far over you went.&lt;/p&gt;

&lt;p&gt;Spinning isn't merely unrewarded. It's actively penalized, proportionally.&lt;/p&gt;

&lt;p&gt;Figure 8 in the paper has a failed trajectory where the last two actions receive an &lt;strong&gt;identical −2.20&lt;/strong&gt;. That tail — the stretch after the last milestone that never reaches another one — is the mathematical shape of spinning.&lt;/p&gt;

&lt;p&gt;How common is it? Their data: trajectories that complete at least one subgoal but fail the task hold steady at &lt;strong&gt;39–47%&lt;/strong&gt; of samples.&lt;/p&gt;




&lt;h2&gt;
  
  
  One ablation that kills the "split by step count" idea
&lt;/h2&gt;

&lt;p&gt;This is the number I found most valuable:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Partitioning&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;vs. baseline (72.8)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Random 5-way split&lt;/td&gt;
&lt;td&gt;74.2&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+1.4&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Real milestones&lt;/td&gt;
&lt;td&gt;91.4&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+17.2&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Translated into product terms: &lt;strong&gt;splitting by arbitrary step counts is worth almost nothing. Splitting by real structure is worth a lot.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now look back at our third-tier criterion — &lt;em&gt;"75% of the tool-loop budget consumed."&lt;/em&gt; That's an arbitrary-step-count trigger. It asks how much you've burned, not what you've achieved.&lt;/p&gt;

&lt;p&gt;The right shape is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌  if steps &amp;gt; N                          → intervene
✅  if steps &amp;gt; N AND zero verified milestones → intervene
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second one won't misfire on a legitimately long task that's progressing (it hits milestones along the way). The first one will.&lt;/p&gt;




&lt;h2&gt;
  
  
  There's also a positive feedback loop
&lt;/h2&gt;

&lt;p&gt;Put a few constants side by side:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;context at 82%                        → trigger compaction
2 compactions + 75% of loop budget    → only then flag spinning
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Spin → context fills up → compaction fires → durable state gets summarized away → re-derive what was lost → spin more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The spin detector infers spinning by observing that compaction happened repeatedly&lt;/strong&gt; — but compaction is the very step that causes the amnesia. It's detecting a downstream symptom, and it has to wait for the loop to go around twice.&lt;/p&gt;

&lt;p&gt;Worse, its intervention is to &lt;em&gt;nudge the model to re-anchor on its durable state&lt;/em&gt;. If the durable state is precisely what got compacted away, there's nothing left to re-anchor on.&lt;/p&gt;

&lt;p&gt;This is a prompt-layer patch for a state-layer problem.&lt;/p&gt;




&lt;h2&gt;
  
  
  What we plan to change
&lt;/h2&gt;

&lt;p&gt;Add a fourth tier: &lt;strong&gt;output-side stall detection&lt;/strong&gt;. Two counters, both derived mechanically from tool observations. No model judgment required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Steps since the last verified milestone&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Deduplicated new state changes&lt;/strong&gt; ← the more useful one&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;File read with an identical hash → not new information (re-reading the same file at a different line range leaves the hash unchanged)&lt;/li&gt;
&lt;li&gt;Command + exit code + stdout hash identical → not new information&lt;/li&gt;
&lt;li&gt;Write where &lt;code&gt;afterHash&lt;/code&gt; didn't change → nothing was actually written&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This counter targets exactly the case signature matching misses: &lt;strong&gt;every action different, information gain zero.&lt;/strong&gt; The criterion is mechanical — no semantic understanding needed.&lt;/p&gt;

&lt;p&gt;Then make the pressure continuous instead of a one-shot nudge:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;surface the counter in context so the model can see it
  → force a plan revision (admit this path is dead)
    → ask the user
      → abort, but preserve the milestones already achieved
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That last rung matters: &lt;strong&gt;if you're going to stop, stop holding what you earned&lt;/strong&gt; — which echoes the 39–47% number above.&lt;/p&gt;




&lt;h2&gt;
  
  
  One honest discount
&lt;/h2&gt;

&lt;p&gt;BEACON is a &lt;em&gt;training&lt;/em&gt; method. It shapes gradients so the trained policy is less prone to wandering, but it has &lt;strong&gt;no runtime detection or intervention mechanism&lt;/strong&gt; of its own.&lt;/p&gt;

&lt;p&gt;It gives you a definition of progress, not a controller. Thresholds, escalation ladders, when to abort — all of that you design yourself. The paper doesn't help there.&lt;/p&gt;

&lt;p&gt;Also, its per-step baseline needs a group-average segment length as reference. In production a given user task usually runs exactly once, so there's no group. You can only approximate with historical similar tasks, which is considerably noisier.&lt;/p&gt;




&lt;h2&gt;
  
  
  But the first thing to do isn't to fix it — it's to measure it
&lt;/h2&gt;

&lt;p&gt;Instrument only. Change no decision logic. Answer a question we currently can't:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Of the spins happening in production, how many are amnesia-type vs. no-gradient-type?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mostly accompanied by &lt;em&gt;information gain at zero while call signatures all differ&lt;/em&gt;
→ no-gradient-type. The existing three tiers structurally cannot catch it; we need output-side detection.&lt;/li&gt;
&lt;li&gt;Mostly accompanied by &lt;em&gt;re-reading content that was already compacted away&lt;/em&gt;
→ amnesia-type. What needs fixing is what compaction preserves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those two directions call for completely different investments. &lt;strong&gt;Measuring first is cheaper than designing first.&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Next post: why AI self-reflection always seems to conclude with "be more careful."&lt;/p&gt;

&lt;p&gt;If you're building long-running agents — what does yours look like when it gets stuck? Repeating the same action, or looking busy while nothing changes? Curious what others are seeing.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
    </item>
    <item>
      <title>Why RL Training Collapses on Long-Horizon Agents</title>
      <dc:creator>Orkas</dc:creator>
      <pubDate>Mon, 27 Jul 2026 04:12:06 +0000</pubDate>
      <link>https://dev.to/cxw_orkas/why-rl-training-collapses-on-long-horizon-agents-229f</link>
      <guid>https://dev.to/cxw_orkas/why-rl-training-collapses-on-long-horizon-agents-229f</guid>
      <description>&lt;p&gt;Been heads-down lately, but I finally had a couple of days to catch up on some recent papers. Sharing one of them here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Milestone-Guided Policy Learning for Long-Horizon Language Agents&lt;/strong&gt;&lt;br&gt;
Zhejiang University (ZJU-REAL) · &lt;a href="https://arxiv.org/abs/2605.06078" rel="noopener noreferrer"&gt;arXiv:2605.06078&lt;/a&gt; · &lt;a href="https://github.com/ZJU-REAL/BEACON" rel="noopener noreferrer"&gt;github.com/ZJU-REAL/BEACON&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It tackles a very concrete and fairly painful problem: when you train an agent on long tasks with RL, it doesn't just get a bit worse — it falls off a cliff as the horizon grows.&lt;/p&gt;


&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Trajectory-level RL (GRPO and friends) fails on long horizons for two &lt;strong&gt;measurable&lt;/strong&gt; reasons: contradictory gradients and wasted partial successes.&lt;/li&gt;
&lt;li&gt;BEACON splits trajectories at &lt;strong&gt;milestones&lt;/strong&gt; (verifiable state transitions), shapes rewards within each segment, and estimates advantages at two scales.&lt;/li&gt;
&lt;li&gt;ALFWorld long tasks: &lt;strong&gt;53.5% → 92.9%&lt;/strong&gt;. Effective sample utilization: &lt;strong&gt;23.7% → 82.0%&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The gains &lt;em&gt;grow&lt;/em&gt; with horizon length — which is a much stronger claim than a higher average score.&lt;/li&gt;
&lt;li&gt;There's a metric in the paper (CCR) that appears to contradict the method's own design. It doesn't — but working out why is the most interesting part of the paper.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  1. First, look at how cleanly they diagnose the problem
&lt;/h2&gt;

&lt;p&gt;What I appreciate most is that they don't open with the method. They open with an empirical autopsy: Qwen2.5-1.5B + GRPO on ALFWorld, breaking "long-horizon training collapses" into two &lt;em&gt;quantifiable&lt;/em&gt; failure modes.&lt;/p&gt;
&lt;h3&gt;
  
  
  Failure mode 1: credit misattribution
&lt;/h3&gt;

&lt;p&gt;GRPO treats a trajectory as a flat action sequence. Every action shares one terminal score.&lt;/p&gt;

&lt;p&gt;The consequence: the same correct action gets a positive gradient in a successful trajectory and a negative gradient in a failed one. Whether it was "right" depends on what happened &lt;em&gt;afterwards&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;They define &lt;strong&gt;CAR (Contradictory Action Ratio)&lt;/strong&gt; — the fraction of actions that receive opposite-sign advantages across trajectories despite being executed at identical states.&lt;/p&gt;

&lt;p&gt;It peaks &lt;strong&gt;above 40%&lt;/strong&gt;. Nearly half the gradient updates for repeated state-action pairs point in conflicting directions. After cancellation, effective learning signal drops &lt;strong&gt;below 20%&lt;/strong&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Failure mode 2: sample inefficiency
&lt;/h3&gt;

&lt;p&gt;Bucket trajectories three ways: full success, partial success (completed at least one subgoal but failed the task), and total failure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Partial successes hold steady at &lt;strong&gt;39–47%&lt;/strong&gt; of samples throughout training&lt;/li&gt;
&lt;li&gt;Full successes stay &lt;strong&gt;below 27%&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under GRPO, a partial success and a total failure both get a reward of 0. That means &lt;strong&gt;over 73% of samples produce no learning signal at all.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both problems compound as horizons extend: longer tasks have lower success rates (more partial successes) &lt;em&gt;and&lt;/em&gt; more opportunity for downstream stochasticity to corrupt credit.&lt;/p&gt;

&lt;p&gt;The number that makes it concrete: ALFWorld short tasks 76.7%, long tasks 53.5%.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. The core insight
&lt;/h2&gt;

&lt;p&gt;Long-horizon tasks &lt;em&gt;have&lt;/em&gt; structure. Flat trajectory optimization just throws it away.&lt;/p&gt;

&lt;p&gt;They naturally decompose into phases bounded by &lt;strong&gt;milestones&lt;/strong&gt; — verifiable state transitions marking subgoal completion.&lt;/p&gt;

&lt;p&gt;The authors formalize this as the &lt;strong&gt;Milestone Markov Property&lt;/strong&gt;: once you reach a milestone state, the distribution over the remaining trajectory depends mostly on which subgoals are left, not on the full history of how you got there.&lt;/p&gt;

&lt;p&gt;In plain terms: once you have the key, what happens next depends on what you do with it — not on how you found it.&lt;/p&gt;

&lt;p&gt;That approximate Markov property is what makes credit &lt;strong&gt;decoupleable across segments&lt;/strong&gt;.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. The method: three steps
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step 1 — partition at milestones
&lt;/h3&gt;

&lt;p&gt;A detector &lt;code&gt;Φ&lt;/code&gt; flags milestone timesteps and splits the trajectory into segments.&lt;/p&gt;

&lt;p&gt;Here's the design decision I think is underrated: &lt;strong&gt;&lt;code&gt;Φ&lt;/code&gt; requires no learned model and no human annotation.&lt;/strong&gt; It reads observable state changes straight from environment feedback.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ALFWorld: object state transitions (successful pickup, heating complete)&lt;/li&gt;
&lt;li&gt;WebShop: page transitions toward the target product&lt;/li&gt;
&lt;li&gt;ScienceWorld: the environment emits explicit subgoal signals&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Zero extra models, zero extra rollouts. That's the whole cost advantage over process reward models and Monte Carlo value estimation.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 2 — temporal reward shaping inside segments
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;r_t = R_ms * γ^(t_k − t)   if segment k ends in a completed milestone
    = 0                    otherwise
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Only segments that &lt;em&gt;terminate&lt;/em&gt; in a milestone get positive reward. Within such a segment, actions closer to the milestone get more.&lt;/p&gt;

&lt;p&gt;Two effects: every action in a completed segment now carries positive signal (partial successes stop being wasted), and there's an implicit push toward efficient execution.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3 — dual-scale advantage (the crux)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Trajectory level&lt;/strong&gt; — standard GRPO normalization over terminal rewards. Captures global task performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Segment level&lt;/strong&gt; — the trick is in how the comparison group is defined:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;G_k = { i : K_i ≥ k }          # only trajectories that ALSO reached milestone k

A_seg(i,t) = r_t − (1/|G_k|) · Σ_{j∈G_k}  R_k(j) / |Seg_k(j)|
                               └── group-average PER-STEP return ──┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Actions in segment &lt;code&gt;k&lt;/code&gt; are compared &lt;strong&gt;only against trajectories that also reached milestone &lt;code&gt;k&lt;/code&gt;&lt;/strong&gt;. From this the authors prove a variance isolation property: whether later segments succeed or fail cannot mathematically contaminate credit for the current segment.&lt;/p&gt;

&lt;p&gt;Final advantage is &lt;code&gt;A_traj + λ · A_seg&lt;/code&gt;, optimized with a standard PPO clipped surrogate.&lt;/p&gt;

&lt;p&gt;Hyperparameters &lt;code&gt;γ=0.95, λ=1.0&lt;/code&gt; are &lt;strong&gt;fixed across all benchmarks&lt;/strong&gt; — no per-task tuning. Worth noting.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Results
&lt;/h2&gt;

&lt;p&gt;ALFWorld, Qwen2.5-1.5B:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;Short&lt;/th&gt;
&lt;th&gt;Medium&lt;/th&gt;
&lt;th&gt;Long&lt;/th&gt;
&lt;th&gt;Avg&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GRPO&lt;/td&gt;
&lt;td&gt;76.7&lt;/td&gt;
&lt;td&gt;73.9&lt;/td&gt;
&lt;td&gt;53.5&lt;/td&gt;
&lt;td&gt;72.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GiGPO&lt;/td&gt;
&lt;td&gt;90.7&lt;/td&gt;
&lt;td&gt;84.3&lt;/td&gt;
&lt;td&gt;79.5&lt;/td&gt;
&lt;td&gt;86.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BEACON&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;96.8&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;87.0&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;92.9&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;91.4&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Success rate on the other two:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;ScienceWorld&lt;/th&gt;
&lt;th&gt;WebShop&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GRPO&lt;/td&gt;
&lt;td&gt;21.1&lt;/td&gt;
&lt;td&gt;56.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GiGPO&lt;/td&gt;
&lt;td&gt;25.8&lt;/td&gt;
&lt;td&gt;65.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BEACON&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;45.3&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;75.6&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few things worth calling out:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The 1.5B model beats GPT-4o.&lt;/strong&gt; ALFWorld 91.4 vs 48.0, WebShop 75.6 vs 23.7. (Fair caveat: the closed models are prompted with ReAct, not trained. And on ScienceWorld it's a tie — 45.3 vs 45.4. Still, a 1.5B model reaching parity is not nothing.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sample utilization goes from 23.7% to 82.0%&lt;/strong&gt; — a 3.5× increase in trajectories that produce useful gradient. Zero-advantage sample ratio drops from ~55% under GRPO to ~10%.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Convergence is faster too&lt;/strong&gt;: 60% success rate by iteration 50, where GRPO needs iteration 120.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But the most convincing result is that the gains scale with horizon.&lt;/strong&gt; On 7B, relative improvement over GRPO goes from &lt;strong&gt;+13% on short tasks to +39% on long tasks&lt;/strong&gt;. GiGPO only goes from +11% to +22%.&lt;/p&gt;

&lt;p&gt;The reason is interesting. GiGPO builds step-level comparison groups by finding &lt;strong&gt;repeated states&lt;/strong&gt; across trajectories. But as the policy improves and trajectories diversify, state recurrence gets sparser — its own signal source erodes. Milestone anchors don't decay as the policy gets stronger.&lt;/p&gt;

&lt;p&gt;A method whose benefit grows as the problem gets harder is a much stronger claim than a higher average score.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. What's actually novel here
&lt;/h2&gt;

&lt;p&gt;Four things look like real contributions rather than assembly:&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 Redefining the comparison group
&lt;/h3&gt;

&lt;p&gt;Process reward models need expensive annotation and carry reward-hacking risk. Monte Carlo value estimation needs multiple rollouts per decision point. GiGPO leans on state recurrence — incidental structure.&lt;/p&gt;

&lt;p&gt;BEACON swaps in &lt;strong&gt;semantic milestones&lt;/strong&gt;, which are intrinsic to the task, essentially free to detect, and become &lt;em&gt;more&lt;/em&gt; reliable as horizons grow rather than less. That's a methodological switch, not an increment.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.2 Variance isolation has a formal guarantee
&lt;/h3&gt;

&lt;p&gt;Most reward shaping work stops at "it's denser, therefore better." This one actually proves &lt;em&gt;why&lt;/em&gt; cutting here works.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.3 Dual-scale isn't redundancy — the ablation proves both are load-bearing
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variant&lt;/th&gt;
&lt;th&gt;ALFWorld&lt;/th&gt;
&lt;th&gt;WebShop&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;BEACON&lt;/td&gt;
&lt;td&gt;91.4&lt;/td&gt;
&lt;td&gt;75.6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;w/o segment-level advantage&lt;/td&gt;
&lt;td&gt;72.8&lt;/td&gt;
&lt;td&gt;56.8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;w/o trajectory-level advantage&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;23.4&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;67.9&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Drop the segment level and you get GRPO back exactly. Drop the trajectory level and ALFWorld &lt;strong&gt;craters to 23.4%&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That second row deserves thought: with only segment-level signal, the policy reinforces behaviors that &lt;strong&gt;hit intermediate milestones but are doomed to fail overall&lt;/strong&gt;. Every subtask executed beautifully, the whole thing drifting off target.&lt;/p&gt;

&lt;p&gt;The divergence between environments is also telling. WebShop still manages 67.9% without the trajectory level, because its milestones align more directly with final success. ALFWorld collapses. So how much terminal verification you need is a function of task structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.4 A counterintuitive finding — CCR
&lt;/h3&gt;

&lt;p&gt;This one deserves its own section.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. CCR: the number I assumed was a typo
&lt;/h2&gt;

&lt;p&gt;The authors define &lt;strong&gt;CCR (Credit Concentration Ratio)&lt;/strong&gt; = average advantage &lt;em&gt;magnitude&lt;/em&gt; for milestone actions ÷ that for non-milestone actions. CCR &amp;gt; 1 means credit concentrates on milestones.&lt;/p&gt;

&lt;p&gt;Measured:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Method&lt;/th&gt;
&lt;th&gt;CCR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GiGPO&lt;/td&gt;
&lt;td&gt;2.36&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GRPO&lt;/td&gt;
&lt;td&gt;1.37&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BEACON&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.84&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So the best-performing method is the one that concentrates credit on key steps the &lt;em&gt;least&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;My first reaction: this directly contradicts "actions closer to the milestone get more reward." I had to work through the math to see that the two statements measure &lt;strong&gt;different quantities&lt;/strong&gt;, with two transformations in between.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transformation 1 — shaped reward
&lt;/h3&gt;

&lt;p&gt;Within a segment, reward is monotonically increasing toward the milestone. ✅ This part is exactly as advertised.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;γ=0.95&lt;/code&gt; and segment length 5, the five actions get &lt;code&gt;0.8145, 0.857, 0.9025, 0.95, 1.0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;But this is &lt;em&gt;reward&lt;/em&gt;, not the credit that reaches the gradient.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transformation 2 — subtract the group baseline
&lt;/h3&gt;

&lt;p&gt;The baseline is the group-average &lt;strong&gt;per-step&lt;/strong&gt; return (segment return ÷ segment length). For a segment of length &lt;code&gt;L&lt;/code&gt;, per-step return is &lt;code&gt;(1−γ^L) / (L(1−γ))&lt;/code&gt;:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Segment length&lt;/th&gt;
&lt;th&gt;3&lt;/th&gt;
&lt;th&gt;5&lt;/th&gt;
&lt;th&gt;8&lt;/th&gt;
&lt;th&gt;10&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Per-step return&lt;/td&gt;
&lt;td&gt;0.951&lt;/td&gt;
&lt;td&gt;0.905&lt;/td&gt;
&lt;td&gt;0.842&lt;/td&gt;
&lt;td&gt;0.803&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So if your segment took 8 steps while the group averaged 5, your per-step return sits below the baseline and &lt;strong&gt;the entire segment's advantage skews negative&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Note what this means: &lt;strong&gt;the penalty for wandering doesn't come from the decay itself — it comes from the decay acting through the per-step baseline.&lt;/strong&gt; I initially attributed it to the decay alone, which is wrong. Decay alone only orders actions &lt;em&gt;within&lt;/em&gt; a segment.&lt;/p&gt;

&lt;p&gt;At this point, CCR &lt;em&gt;inside a completed segment&lt;/em&gt; is still greater than 1.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transformation 3 — add the trajectory-level advantage
&lt;/h3&gt;

&lt;p&gt;This is where CCR falls below 1, via two asymmetric effects:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(a) The tail segment of a failed trajectory enters no comparison group at all.&lt;/strong&gt; Since &lt;code&gt;G_k = {i : K_i ≥ k}&lt;/code&gt; and the incomplete tail has index &lt;code&gt;K_i + 1 &amp;gt; K_i&lt;/code&gt;, trajectory &lt;code&gt;i&lt;/code&gt; is excluded. That tail gets no segment-level advantage — only the trajectory-level term, at &lt;strong&gt;full magnitude&lt;/strong&gt;. And every one of those is a non-milestone action, inflating the denominator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(b) In failed trajectories, the negative trajectory-level term cancels against the positive segment-level credit on milestone actions&lt;/strong&gt;, squeezing their magnitude toward zero.&lt;/p&gt;

&lt;h3&gt;
  
  
  Figure 8 confirms it numerically
&lt;/h3&gt;

&lt;p&gt;On a failed trajectory that completed milestones S3 and S4:&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;go to toilet&lt;/th&gt;
&lt;th&gt;
&lt;strong&gt;put soapbar&lt;/strong&gt; (S3✓)&lt;/th&gt;
&lt;th&gt;
&lt;strong&gt;go to counter&lt;/strong&gt; (S4✓)&lt;/th&gt;
&lt;th&gt;go to counter&lt;/th&gt;
&lt;th&gt;go to holder&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GRPO&lt;/td&gt;
&lt;td&gt;−2.50&lt;/td&gt;
&lt;td&gt;−2.50&lt;/td&gt;
&lt;td&gt;−2.50&lt;/td&gt;
&lt;td&gt;−2.50&lt;/td&gt;
&lt;td&gt;−2.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;BEACON&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−0.92&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.51&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;+0.32&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;−2.20&lt;/td&gt;
&lt;td&gt;−2.20&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The last two values are &lt;strong&gt;identical&lt;/strong&gt; — the fingerprint of "tail segment gets only the trajectory-level term," which lets you read off &lt;code&gt;A_traj ≈ −2.20&lt;/code&gt;. The two milestone actions are positive, but their magnitude is only ~0.5 because the negative trajectory term ate most of the segment-level credit.&lt;/p&gt;

&lt;p&gt;CCR for this trajectory: &lt;strong&gt;0.23&lt;/strong&gt;. For a successful trajectory: &lt;strong&gt;2.95&lt;/strong&gt;. The global 0.84 is the mixture.&lt;/p&gt;

&lt;h3&gt;
  
  
  So what does CCR &amp;lt; 1 actually mean
&lt;/h3&gt;

&lt;p&gt;CCR measures &lt;strong&gt;the concentration of gradient magnitude&lt;/strong&gt;, not "who got rewarded." The positive credit milestones are supposed to receive within a segment is fully intact.&lt;/p&gt;

&lt;p&gt;The more precise framing: &lt;strong&gt;low CCR isn't a design goal, it's a byproduct&lt;/strong&gt; of dense in-segment allocation plus dual-scale stacking.&lt;/p&gt;

&lt;p&gt;But the authors' conclusion still holds, and it's a good one: don't dump all your gradient energy on the key steps. GiGPO's 2.36 means the preparatory actions in between get almost no signal — and those are exactly what makes reaching the milestone possible.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. Something the paper doesn't spell out
&lt;/h2&gt;

&lt;p&gt;There's an odd cell in the ablation table: &lt;code&gt;γ=1&lt;/code&gt; (uniform in-segment credit) scores &lt;strong&gt;71.8&lt;/strong&gt;, &lt;em&gt;worse&lt;/em&gt; than no shaping at all (&lt;code&gt;γ=0&lt;/code&gt;, 81.2), and even below GRPO's 72.8.&lt;/p&gt;

&lt;p&gt;The paper's explanation: "assigning equal credit to all actions obscures the distinction between critical and preparatory actions, producing misleading gradients."&lt;/p&gt;

&lt;p&gt;Work through the math and the real answer is sharper.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;γ=1&lt;/code&gt;, every action in a completed segment gets the same reward &lt;code&gt;R_ms&lt;/code&gt;. Then &lt;strong&gt;every completed segment, regardless of length, has a per-step return of exactly &lt;code&gt;R_ms&lt;/code&gt;&lt;/strong&gt; — so the baseline is &lt;code&gt;R_ms&lt;/code&gt; too, and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A_seg(i,t) ≡ R_ms − R_ms = 0    for every action
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not that the gradients are misleading. &lt;strong&gt;The segment-level channel vanishes identically, and the method reduces exactly to GRPO.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check it against the table: 71.8 vs GRPO's 72.8. One point apart — run-to-run noise. It lines up perfectly.&lt;/p&gt;

&lt;p&gt;Which means temporal decay isn't just "differentiating actions within a segment." It's a &lt;strong&gt;necessary condition for the segment-level signal to exist at all.&lt;/strong&gt; Without decay, the per-step baseline cancels it out on the spot.&lt;/p&gt;

&lt;p&gt;The paper doesn't say this.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Three experiments that shut down the obvious objections
&lt;/h2&gt;

&lt;p&gt;Credit where due — they proactively close three holes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Isn't this just behavior cloning in disguise?"&lt;/strong&gt;&lt;br&gt;
SFT on oracle trajectories gets 43%. BEACON gets 91.4%. The policy discovers execution strategies &lt;em&gt;better&lt;/em&gt; than the oracle, so it isn't imitating.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Are the gains just from chunking the trajectory?"&lt;/strong&gt;&lt;br&gt;
Random partitioning (5 arbitrary split points) scores 74.2% — only 1.4 points above GRPO's 72.8. Real milestones score 91.4%, a 17.2-point gap. The benefit genuinely comes from task-intrinsic structure. Clean control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"What if the detector is unreliable?"&lt;/strong&gt;&lt;br&gt;
Randomly dropping 50% of milestones still yields 82.8%, 10 points above GRPO. Degradation is graceful, not a cliff.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Limitations, stated honestly
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The biggest bottleneck is whether &lt;code&gt;Φ&lt;/code&gt; is even obtainable.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;All three benchmarks get milestones from rules: pattern matching on environment responses, page transitions, or explicit subgoal signals from the env.&lt;/p&gt;

&lt;p&gt;Real open-ended settings — browser automation, codebase refactoring, deep research — have no such ready-made verifiable state transitions. The authors themselves list automated milestone discovery as an open problem in the appendix.&lt;/p&gt;

&lt;p&gt;So this reads as a paradigm validated in structured environments, not an engineering recipe you can lift as-is.&lt;/p&gt;

&lt;p&gt;Also: milestone &lt;strong&gt;granularity is sensitive&lt;/strong&gt; (too sparse degenerates to GRPO, too dense makes segment advantages noisy); the Markov property is only &lt;em&gt;approximate&lt;/em&gt;, and variance isolation rests on it; experiments stop at 7B with discrete text action spaces — continuous control and multi-agent settings are untested.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing thought
&lt;/h2&gt;

&lt;p&gt;The ideas in this paper matter for anyone designing agents that take on long-horizon tasks — even if you're not training a policy. The transferable part isn't the advantage formula; it's the claim that &lt;strong&gt;long tasks have exploitable compositional structure, and that structure should be a first-class runtime object rather than something you hope the model tracks in context.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We've been working on long-horizon task support in Orkas recently, and I'll keep sharing our design thinking on that as it develops.&lt;/p&gt;

&lt;p&gt;If you're building agents for long tasks — how are you handling intermediate progress signals? Genuinely curious what's working in production.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Rebuilding Orkas for Long-Running Agents</title>
      <dc:creator>Orkas</dc:creator>
      <pubDate>Mon, 20 Jul 2026 09:24:06 +0000</pubDate>
      <link>https://dev.to/cxw_orkas/rebuilding-orkas-for-long-running-agents-co0</link>
      <guid>https://dev.to/cxw_orkas/rebuilding-orkas-for-long-running-agents-co0</guid>
      <description>&lt;p&gt;AI agents don’t only break because the model is weak. They often break because the product treats agent work like a single chatbot response.&lt;/p&gt;

&lt;p&gt;In the Orkas 1.0 foundation refactor, we rebuilt the lower layers of the system: the agent runtime, provider rotation, orchestration, external hosting, memory, and context management.&lt;/p&gt;

&lt;p&gt;This post summarizes the architecture changes and the lessons behind them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the refactor happened
&lt;/h2&gt;

&lt;p&gt;Orkas is a local-first desktop workspace for AI agents. Agents can work with local files, shell commands, project folders, connectors, skills, and knowledge bases.&lt;/p&gt;

&lt;p&gt;That creates a different set of problems from a normal chat UI:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;long-running tasks can span many steps&lt;/li&gt;
&lt;li&gt;context grows quickly&lt;/li&gt;
&lt;li&gt;tool calls need ordering and safety rules&lt;/li&gt;
&lt;li&gt;providers can fail mid-run&lt;/li&gt;
&lt;li&gt;users may interrupt or correct the agent&lt;/li&gt;
&lt;li&gt;multi-agent workflows need coordination, not just a static plan&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The refactor was about moving these concerns into Orkas’s own foundation instead of relying on chat-style assumptions.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. An in-process agent runtime
&lt;/h2&gt;

&lt;p&gt;The core change was a standalone, dynamically loadable, in-process agent runtime.&lt;/p&gt;

&lt;p&gt;It is split into two layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Engine layer&lt;/strong&gt;: owns the generic agent loop, tool calling, streaming, context compaction, retry behavior, provider abstraction, memory, and self-evolution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adapter layer&lt;/strong&gt;: connects that engine to Orkas-specific storage, permissions, skills, connectors, provider rotation, and event formats.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This boundary adds some complexity, but it keeps the reusable agent machinery separate from product-specific wiring.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Desktop agents need desktop-grade tool behavior
&lt;/h2&gt;

&lt;p&gt;A local desktop agent can touch real files, run local commands, and work across project directories. That means the tool loop needs stronger guarantees.&lt;/p&gt;

&lt;p&gt;Some details became important:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;read before write&lt;/li&gt;
&lt;li&gt;stale edit protection&lt;/li&gt;
&lt;li&gt;parallel read-only operations&lt;/li&gt;
&lt;li&gt;ordered writes&lt;/li&gt;
&lt;li&gt;loop detection for repeated tool calls&lt;/li&gt;
&lt;li&gt;interruption handling at safe boundaries&lt;/li&gt;
&lt;li&gt;enough output room for long reports or large edits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are not flashy features, but they are what make agent work feel predictable instead of fragile.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Context is a cost and reliability problem
&lt;/h2&gt;

&lt;p&gt;Long tasks burn tokens in small repeated steps: reading, searching, summarizing, retrying, compacting, and recovering from errors.&lt;/p&gt;

&lt;p&gt;The refactor made context handling more model-aware. Instead of using one conservative context limit, the runtime reads the model’s actual context window and compacts around a usage threshold.&lt;/p&gt;

&lt;p&gt;It also avoids compaction when summarizing would not free useful space.&lt;/p&gt;

&lt;p&gt;The lesson: context management is not just a UX feature. It affects cost, latency, and whether the agent can finish the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Provider rotation belongs below the agent runner
&lt;/h2&gt;

&lt;p&gt;Model calls fail. Keys hit limits. Networks break.&lt;/p&gt;

&lt;p&gt;Orkas moved provider rotation below the agent runner so a user turn can survive safe failures without duplicating session state.&lt;/p&gt;

&lt;p&gt;The rotation rule is conservative:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if failure happens before meaningful output, another provider can be tried&lt;/li&gt;
&lt;li&gt;once text or tool calls start, rotation stops&lt;/li&gt;
&lt;li&gt;transient failures can retry&lt;/li&gt;
&lt;li&gt;request or policy errors should not be hidden by blind retries&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The point is not to make providers invisible. It is to put failover where it can be handled safely.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. From static plans to group-chat orchestration
&lt;/h2&gt;

&lt;p&gt;Earlier orchestration used a more static plan/DAG model. That looked clean, but real agent work changes as new information appears.&lt;/p&gt;

&lt;p&gt;Orkas moved toward dynamic group-chat orchestration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a Commander coordinates the room&lt;/li&gt;
&lt;li&gt;worker agents receive focused slices of context&lt;/li&gt;
&lt;li&gt;dispatch happens through structured tool calls&lt;/li&gt;
&lt;li&gt;the Commander can fan out, synthesize, or hand off work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This fits long-running tasks better than compiling one fixed plan upfront.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Opening the system without removing boundaries
&lt;/h2&gt;

&lt;p&gt;The refactor also made Orkas more open to external capabilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;external packages&lt;/li&gt;
&lt;li&gt;custom skills&lt;/li&gt;
&lt;li&gt;local CLIs&lt;/li&gt;
&lt;li&gt;user-configured MCP servers&lt;/li&gt;
&lt;li&gt;external agents launched from Orkas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important constraint is that risky actions still go through controlled boundaries: explicit user confirmation, local process isolation where possible, encrypted credentials, and permission checks for external side effects.&lt;/p&gt;

&lt;p&gt;Open hosting is useful only if the trust boundary remains clear.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Memory and self-evolution need limits
&lt;/h2&gt;

&lt;p&gt;Orkas also rebuilt memory and self-evolution around a simple principle:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;bounded, observable, and off by default where appropriate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Memory is local and separated into categories such as user preferences and agent notes. Retrieval combines semantic and keyword search.&lt;/p&gt;

&lt;p&gt;Self-evolution is agent-private. It can update private skills or competence notes based on corrections, error recovery, and repeated task patterns, but it is bounded by cost controls and explicit session behavior.&lt;/p&gt;

&lt;p&gt;“Agents that improve with use” is only useful if users can understand and control what is changing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;p&gt;Agent infrastructure has a different shape from chat infrastructure.&lt;/p&gt;

&lt;p&gt;A production agent runtime needs to handle:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tool ordering&lt;/li&gt;
&lt;li&gt;side effects&lt;/li&gt;
&lt;li&gt;provider failures&lt;/li&gt;
&lt;li&gt;context pressure&lt;/li&gt;
&lt;li&gt;token cost&lt;/li&gt;
&lt;li&gt;user interruption&lt;/li&gt;
&lt;li&gt;orchestration state&lt;/li&gt;
&lt;li&gt;local security boundaries&lt;/li&gt;
&lt;li&gt;memory limits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main challenge is deciding where complexity should live.&lt;/p&gt;

&lt;p&gt;For Orkas, the answer became:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;generic agent behavior in the runtime engine&lt;/li&gt;
&lt;li&gt;product-specific wiring in the adapter&lt;/li&gt;
&lt;li&gt;orchestration in the group-chat message bus&lt;/li&gt;
&lt;li&gt;risky external actions behind explicit consent&lt;/li&gt;
&lt;li&gt;memory and self-evolution behind local controls&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;The Orkas 1.0 foundation refactor was not about adding more surface features. It was about rebuilding the operating layer underneath long-running local agents.&lt;/p&gt;

&lt;p&gt;If you are building agent systems, especially local-first or desktop agents, the takeaway is simple:&lt;/p&gt;

&lt;p&gt;You eventually stop building around the model API and start building the runtime around the agent.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
    </item>
    <item>
      <title>The Real Cost Problem in AI Agents</title>
      <dc:creator>Orkas</dc:creator>
      <pubDate>Fri, 03 Jul 2026 10:16:23 +0000</pubDate>
      <link>https://dev.to/cxw_orkas/the-real-cost-problem-in-ai-agents-4ho8</link>
      <guid>https://dev.to/cxw_orkas/the-real-cost-problem-in-ai-agents-4ho8</guid>
      <description>&lt;p&gt;AI agents have a cost problem.&lt;/p&gt;

&lt;p&gt;A single "task" often means many model calls: reading context, calling tools, summarizing results, deciding the next step, retrying, validating output. If every step hits a frontier LLM, the unit economics get ugly fast.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One big model for everything is probably the wrong shape&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The better question isn't "which model is smartest?" — it's "which part of the task actually needs the smartest model?"&lt;/p&gt;

&lt;p&gt;LLMs should handle the hard parts: planning, backtracking, judgment, ambiguous decisions.&lt;/p&gt;

&lt;p&gt;Small language models can handle the boring but frequent parts: extraction, routing, JSON formatting, tool parameters, log summaries, simple validation.&lt;/p&gt;

&lt;p&gt;Most agent workflows contain a lot of that second category.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why desktop agents are interesting&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cloud agents pay for tokens at almost every step — every retry, every summary, every tool-call decision, every formatting pass usually goes through a remote model.&lt;/p&gt;

&lt;p&gt;Desktop agents have another option: local compute. They can run small local models or deterministic code for cheap, repetitive work, and only call cloud LLMs when the task actually needs deeper reasoning.&lt;/p&gt;

&lt;p&gt;That changes the cost structure. Instead of:&lt;/p&gt;

&lt;p&gt;every step → cloud LLM token cost&lt;/p&gt;

&lt;p&gt;you get something closer to:&lt;/p&gt;

&lt;p&gt;routine work → local compute · hard decisions → cloud LLMs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The long-term loop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;start with LLMs → log agent traces → find repeated task patterns → distill them into SLMs / LoRAs → run them locally or cheaply → keep LLMs as fallback&lt;/p&gt;

&lt;p&gt;In other words, agents should get cheaper as they're used more. The more traces you collect, the clearer it gets which tasks are repeated, narrow, and safe to move off frontier models.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My takeaway&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next wave of agents won't just be about stronger models — it'll be about better compute allocation: LLMs for judgment, SLMs for narrow repeated work, code for deterministic checks, local compute wherever possible.&lt;/p&gt;

&lt;p&gt;That may be what makes agent economics work.&lt;/p&gt;

&lt;p&gt;Paper: Small Language Models are the Future of Agentic AI — &lt;a href="https://arxiv.org/abs/2506.02153" rel="noopener noreferrer"&gt;https://arxiv.org/abs/2506.02153&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
