<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shiladitya Ghosh on Medium]]></title>
        <description><![CDATA[Stories by Shiladitya Ghosh on Medium]]></description>
        <link>https://medium.com/@shiladitya321?source=rss-43bfb4b0c1f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3ayC1FuXiHyrR_VuCaPbxQ.jpeg</url>
            <title>Stories by Shiladitya Ghosh on Medium</title>
            <link>https://medium.com/@shiladitya321?source=rss-43bfb4b0c1f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:01:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shiladitya321/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Write It Twice: Safer, Verifiable AI Agent Code with TLA+]]></title>
            <link>https://shiladitya321.medium.com/write-it-twice-safer-verifiable-ai-agent-code-with-tla-6a73ea4435ba?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a73ea4435ba</guid>
            <category><![CDATA[formal-verification]]></category>
            <category><![CDATA[andrej-karpathy]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Tue, 24 Nov 2026 20:41:36 GMT</pubDate>
            <atom:updated>2026-11-24T23:38:44.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A tilted page labelled STE and a graph of states labelled TLA+, one of them red, beside the title “Write It Twice” and the line “For safer, verifiable AI agent code" src="https://cdn-images-1.medium.com/max/1024/1*9Pnsoz-fbGnvK1XSBmzMYQ.png" /></figure><blockquote>Plain English for you, TLA+ for the machine. A simple way to make the code AI agents write easier to review and safer to ship.</blockquote><p>In early October, Andrej Karpathy shared a simple idea. As AI models do more of our work, our main job shifts to understanding what they produce. So we should ask them to present their work in ways that are easy to understand.</p><p>His first tip was to ask for answers in ASD-STE100. This is the plain, strict English used in aircraft maintenance manuals. Because the full standard is strict, he sometimes asks for “80% of the way” there instead. After that, he suggested diagrams, interactive web pages and custom explainer videos.</p><p>It is good advice. Each of these formats makes the output easier to follow. But none of them tells you if the output is correct. A clear description of a bad design is still a bad design. And when a bug hides in the timing between two steps, clear writing can make it easier to miss, because the reader relaxes.</p><h3>Add a spec the machine can check</h3><p>I want to add one more step to Karpathy’s list. When a model designs something with moving parts, like a protocol, an agent’s control loop or concurrent code, ask it for two things:</p><ol><li>A plain explanation in STE style, for you to read.</li><li>A TLA+ spec of the same design, for a machine to check.</li></ol><p>Each one gets its own check. A simple linter checks the writing for short sentences and active voice. SANY, the TLA+ syntax checker, first makes sure the spec is valid TLA+.</p><p>Then TLC, the model checker, explores every state that a small version of the design can reach. If something can go wrong, TLC shows the exact steps that lead there. The model gets those steps back, explains them in plain English, and fixes the design. This repeats until the checks pass.</p><figure><img alt="Figure 1: TLC gates the design; the human reviews only the guarantees" src="https://cdn-images-1.medium.com/max/1024/1*Iq8w0aD7yrCpD0sKa_bEZg.png" /><figcaption>Figure 1: TLC gates the design; the human reviews only the guarantees</figcaption></figure><p>Here is an example. A coding agent writes a common caching pattern:</p><pre>def get_user(user_id):<br>    user = cache.get(user_id)<br>    if user is None:<br>        user = db.fetch_user(user_id)<br>        cache.set(user_id, user)<br>    return user<br><br>def update_user(user_id, fields):<br>    db.update_user(user_id, fields)<br>    cache.delete(user_id)</pre><p>For you — the user, the model writes a plain STE explanation:</p><blockquote>On a cache miss, the reader reads the user from the database. Then the reader writes the user to the cache. The writer updates the database. Then the writer deletes the key from the cache.</blockquote><p>Every sentence is true. The code is short, and the unit tests pass, because they run one call at a time.</p><p>But there is a problem that no sentence above shows:</p><ol><li>One request reads the old value from the database.</li><li>Before it saves that value to the cache, a second request updates the database.</li><li>The second request then deletes the cache entry.</li><li>The first request saves the old value into the cache.</li></ol><p>Now the cache holds stale data until it expires or the data changes again.</p><figure><img alt="Figure 2: One reader and one writer leave stale data in the cache" src="https://cdn-images-1.medium.com/max/1024/1*d5WuXlY_M0PG3IH33d3WmQ.png" /><figcaption>Figure 2: One reader and one writer leave stale data in the cache</figcaption></figure><p>For the checker, the model writes the promise as a TLA+ property, with a plain sentence beside it:</p><pre>\* STE: When no write runs, the cache must hold the database value or be empty.<br>CacheCoherent == ~WriteInProgress =&gt; (cache = Nil \/ cache = db)</pre><p>This one line is what you review. The STE sentence tells you what the system promises. The formula lets TLC test that promise against every possible order of steps.</p><p>Bugs like this live in the order of steps, not in any one sentence. That makes them easy to approve in a code review, and it is exactly what the second check is for. How the check handles this example will come in the next articles.</p><h3>What comes next</h3><p>This article is the idea. The next articles will build it and share what I find:</p><ol><li><strong>The prompt and the linter:</strong> how to get a model to write both the explanation and the spec, plus a small tool that checks the writing.</li><li><strong>The checker loop:</strong> connecting the TLA+ tools so the model can find and fix its own mistakes, and checking that the spec matches your real code, tested on the cache example.</li><li><strong>From traces to tests:</strong> turning TLC’s failing steps into real tests, so a verified design leads to code you can trust, and using the whole setup on an AI agent.</li><li><strong>Keeping the spec in sync:</strong> noticing when the code changes and the spec no longer describes it.</li></ol><h3>References</h3><ul><li><a href="https://x.com/karpathy/status/2105819303471976479">Andrej Karpathy, post on X, October 2, 2026</a></li><li><a href="https://asd-ste100.org/about_STE.html">About ASD-STE100 Simplified Technical English</a></li><li><a href="https://lamport.azurewebsites.net/tla/tla.html">The TLA+ Home Page, Leslie Lamport</a></li><li><a href="https://lamport.azurewebsites.net/tla/learning.html">Learning TLA+: Lamport’s video course and resources</a></li><li><a href="https://lamport.azurewebsites.net/tla/tools.html">The TLA+ tools: SANY (parser and syntax checker), TLC (model checker) and TLAPS (proof system)</a></li><li><a href="https://lamport.azurewebsites.net/tla/standalone-tools.html">Running SANY and TLC outside the Toolbox, Leslie Lamport</a></li><li><a href="https://learntla.com/">Learn TLA+, Hillel Wayne</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a73ea4435ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Need an LLM Judge. Here’s How to Make One You Can Trust.]]></title>
            <link>https://shiladitya321.medium.com/you-need-an-llm-judge-heres-how-to-make-one-you-can-trust-3f6112dce706?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3f6112dce706</guid>
            <category><![CDATA[mlops]]></category>
            <category><![CDATA[llm-evaluation]]></category>
            <category><![CDATA[ai-production-deployment]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 23:18:15 GMT</pubDate>
            <atom:updated>2026-07-09T23:18:15.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A practical guide to de-biasing, calibrating, and monitoring LLM-as-judge in production." src="https://cdn-images-1.medium.com/max/1024/1*K8Y8s80viAihrvFg_qlfmQ.png" /></figure><p><em>A practical guide to running LLM-as-judge in production.</em></p><p>LLM systems cannot be evaluated by hand at production scale. A support bot generates thousands of responses a day, and every prompt change, model upgrade, or retrieval tweak needs checking against that volume. Human review just does not keep up.</p><p>An LLM judge, a model that grades the bot’s outputs, is perhaps the only frasible option. This is the only evaluation approach that matches the production volume and speed.</p><blockquote>The catch is that the judge is itself an LLM, with LLM failure modes.</blockquote><p>Longer answers are quietly preferred over better ones. Verdicts flip depending on reading order. Outputs that sound like the judge’s own model family are favored. And scoring behavior shifts whenever the provider ships a new model version, producing phantom regressions on the dashboard. Left unchecked, a judge hands out confident numbers that are quietly wrong, a ruler nobody ever checked.</p><p>Every one of these failure modes has a known, practical fix. They fall into three obligations, in order: <strong>de-bias the design, calibrate against humans, monitor for drift.</strong></p><figure><img alt="Figure 1, The three obligations: de-bias → calibrate → monitor, as a pipeline with a feedback loop from monitoring back to calibration" src="https://cdn-images-1.medium.com/max/1024/1*wqErd4OhbB_BoLBNHMknkg.png" /><figcaption><strong><em>Figure 1, The three obligations: de-bias → calibrate → monitor, as a pipeline with a feedback loop from monitoring back to calibration</em></strong></figcaption></figure><p><strong>One running example, because abstractions slide off otherwise.</strong> The support bot handles billing. Ticket #4821: <em>“I was charged twice for my subscription this month.”</em> Two candidate responses:</p><ul><li><strong>Response A (2 sentences):</strong> confirms the duplicate charge, refund initiated, 3–5 day timeline.</li><li><strong>Response B (2 paragraphs):</strong> apologizes twice, restates the question, explains billing cycles, links three help articles, asks the customer to confirm they want a refund.</li></ul><p>Any support lead picks A without hesitating. What an unvalidated judge does with this pair is now worth watching.</p><h3>Part 1: De-bias the design</h3><p>Five practices, each one motivated by a specific, documented bias.</p><h3>1. Compare, don’t score</h3><ul><li>Absolute ratings are unstable: the same answer to #4821 gets a 6 today and an 8 tomorrow, for no identifiable reason.</li><li>What judges are consistent at is comparison: “which resolves the ticket better, A or B?” Evaluations should be framed that way.</li><li>Where a scalar is genuinely needed, it should be built from many pairwise verdicts (Elo-style), not conjured directly by the model.</li></ul><h3>2. Swap the order and average</h3><ul><li>Judges have position bias: shown A-then-B the verdict leans one way, B-then-A it can flip, on identical content.</li><li>Every comparison should be run twice with the order reversed and the verdicts averaged.</li><li>The same winner both ways is a preference that can be believed. A flip is no real preference and should be logged as a tie.</li><li>This doubles judge cost. That is the price of a number that can be trusted.</li></ul><h3>3. Watch the length bias</h3><ul><li>Judges reward longer answers, not better ones. On #4821, a naive judge crowns Response B, the padded response customers hate.</li><li>The prompt should state it outright: length is not quality, a concise answer that resolves the ticket wins.</li><li>The instruction alone is not enough, it must be verified. Plotting win rate against response length shows the tell: if the line climbs, the judge is measuring verbosity, and its “improvements” may just be the bot getting chattier.</li></ul><h3>4. Don’t let a model grade its own family</h3><ul><li>Models favor outputs that sound like themselves, same phrasings, same tics, same blind spots.</li><li>A bot on model X judged by model X or its sibling amounts to grading one’s own homework and calling it QA.</li><li>For anything high-stakes, the judge should come from a different provider, or at minimum a clearly different model family. It complicates the vendor story, and it is worth it.</li></ul><h3>5. A real rubric, reasons before verdict</h3><ul><li>“Is this a good support response?” is not a rubric. For the bot: resolved the actual issue, factual claims correct, no invented refund commitments, tone fits a frustrated customer.</li><li>Every criterion must map to a business outcome or be cut. Resolution → repeat-contact rate. No invented commitments → refund leakage. Tone → CSAT and escalations.</li><li>The same test rules criteria out: “uses proper markdown” protects nothing, and left in, the judge will trade real resolutions for prettier bullets.</li><li>Each criterion needs worked pass/fail examples, and the judge must write its reasoning before the verdict. A judge required to explain why B fails on concision before scoring is measurably steadier.</li></ul><h3>Part 2: Calibrate against humans</h3><p>Part 1 makes the judge less biased. None of it establishes whether the judge is <em>right</em>, and that distinction carries real weight. Ground truth is human judgment: “a good support response” is whatever humans decide it is, and a stand-in has to be checked against the real thing.</p><h3>Build a calibration set first</h3><ul><li>A few hundred real tickets from production, labeled by the actual support leads, using the same rubric given to the judge.</li><li>The work is dull and there is no shortcut, and it is the entire foundation. A judge without a calibration set is an opinion generator.</li></ul><h3>Measure agreement, and know the ceiling</h3><ul><li>Judge–human agreement is measured on the calibration set, human–human agreement on an overlapping slice.</li><li>Low human agreement indicts the rubric, not the judge. If leads agree only 60% on “tone,” the criterion is ambiguous, and no prompting rescues a definition humans cannot share.</li></ul><h3>Deploy only where agreement holds</h3><ul><li>Agreement is uneven, and that is workable: perhaps 90% on “policy claim correct,” 55% on “tone for an angry customer.”</li><li>The judge takes the high-agreement slices, humans keep the rest. Coverage does not need to be total, it needs to be honest.</li></ul><h3>Never report a bare score</h3><ul><li>Not “judge score: 8.2.” Rather “8.2, at 72% agreement with support-lead labels on billing tickets.”</li><li>The agreement figure is the error bar. A naked number will be treated, three months later, as more precise than it ever was.</li></ul><figure><img alt="Figure 2, The calibration loop: judge → agreement check vs. human set → deploy on high-agreement slices → human audit + drift monitor feeding back" src="https://cdn-images-1.medium.com/max/1024/1*887RRWMpjyrMLrMmZBiutg.png" /><figcaption><strong><em>Figure 2, The calibration loop: judge → agreement check vs. human set → deploy on high-agreement slices → human audit + drift monitor feeding back</em></strong></figcaption></figure><h3>Part 3: Monitor for drift</h3><p>Calibration is not a thing that gets finished. A judge trustworthy in January can be quietly wrong by June, and no notification will arrive.</p><h3>Keep a permanent human audit sample</h3><ul><li>1–2% of judged tickets go to human review, permanently. It looks redundant right up until the day it catches something: a launch shifting the ticket mix, the judge sliding, the rubric falling out of step.</li></ul><h3>Watch the decay signal</h3><ul><li>The check that matters most: do judge scores still predict real outcomes, CSAT, resolution rate, escalations?</li><li>Scores climbing while CSAT stays flat means the judge has decayed. It is still measuring something, just not the thing that matters.</li><li>The business-outcome mapping from Part 1 pays off here, decay can be localized: tone scores up, CSAT flat → the tone criterion drifted.</li><li>When it happens, the prompt should not be patched in hope. Rebuild: a fresh calibration set from recent escalations, a rubric re-derived from real complaints, validated from scratch.</li></ul><h3>The whole thing on one screen</h3><p><strong>De-bias the design</strong></p><ul><li>Compare instead of scoring</li><li>Swap order, average, treat flips as ties</li><li>Warn against length bias, then verify it</li><li>Different model family than the system under test</li><li>Rubric with worked examples, reasoning before verdict</li><li>Every criterion maps to a business outcome, cut the rest</li></ul><p><strong>Calibrate against humans</strong></p><ul><li>Labeled calibration set from real tickets</li><li>Judge–human agreement, human–human agreement as the ceiling</li><li>Deploy only on high-agreement slices</li><li>Report the agreement number with every score</li></ul><p><strong>Monitor for drift</strong></p><ul><li>Re-validate on every judge version change, pin versions</li><li>Permanent 1–2% human audit sample</li><li>Scores stop predicting outcomes → rebuild, don’t patch</li></ul><p>None of this is glamorous. It is the discipline every measurement-heavy field learned the hard way: the instrument is validated before its readings drive decisions, and it keeps being validated for as long as it is in service. The judge is not optional at production scale. The mistake was never using one. The mistake is trusting one that was never checked.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f6112dce706" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fugu: Not a Router. Not a Framework. So What Is It?]]></title>
            <link>https://shiladitya321.medium.com/sakana-fugu-explained-multi-agent-ai-orchestration-0e58a3ab897d?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e58a3ab897d</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[sakana-ai]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 23:39:54 GMT</pubDate>
            <atom:updated>2026-06-26T08:12:45.014Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="Stylized puffer fish illustration with spines connecting to frontier AI models GPT-5.5, Opus 4.8, and Gemini — representing Sakana Fugu’s multi-agent orchestration" src="https://cdn-images-1.medium.com/max/1024/1*JBbk-07h4yifHD_a1bzUcQ.png" /></figure><p><em>One AI enthusiast reads about Sakana’s Fugu, ends up with more questions than answers, and tries to make sense of it, a short digest, roughly in the order the questions came up.</em></p><p><em>Quotes, figures, and section references (§) throughout are from the </em><a href="https://arxiv.org/abs/2606.21228"><em>Sakana Fugu Technical Report</em></a><em> (arXiv:2606.21228, Sakana AI, 2026), unless noted.</em></p><p>I came across Fugu the way you probably did, one line that sounds a little too tidy: <em>one model to command them all.</em></p><p>You call Fugu through a single OpenAI-compatible endpoint (<a href="https://sakana.ai/fugu/">product page</a>). Behind it sits a pool of frontier models, Gemini 3.1 Pro, Claude Opus 4.8, GPT-5.5, and others (§4.1.1). You send a query; it picks a model. And my first reaction was deflating: <em>haven’t I seen this before? Isn’t this just a router?</em></p><p>Then a second question landed on the first. If there’s a pool of models back there… is Fugu even a model? And a third: if it’s choosing models, how does it know which one to choose? Within a minute I had a small pile of questions and no clean answers.</p><p>So this is me working through that pile, in the order the questions showed up — and landing, at the end, on a one-paragraph mental model that finally made it click.</p><figure><img alt="FIGURE 1 — A learned orchestrator at the hub, frontier workers on the spokes — routing, coordination, and feedback all flow through it. The picture I kept coming back to." src="https://cdn-images-1.medium.com/max/1024/1*hY4ZEAqToRRKxd1osPKgug.png" /><figcaption><strong><em>FIGURE 1 — </em></strong><em>A learned orchestrator at the hub, frontier workers on the spokes — routing, coordination, and feedback all flow through it. The picture I kept coming back to.</em></figcaption></figure><h3>Is Sakana Fugu Just a Router?</h3><p>Let me take the router worry first, because it’s the loudest one.</p><p>A router is a clean baseline. It sits in front of many models and makes one decision, which model, and which provider, should answer this request. Concretely:</p><ul><li>it forwards your request to <strong>one</strong> model (you pick it, or a small classifier picks by complexity, cost, or quality);</li><li>it fails over to another if the first is down;</li><li>it usually <strong>pins</strong> that choice for the rest of the conversation, for consistency.</li></ul><p>That’s a dispatch layer, and a good one. Three things define it: <strong>one</strong> model per request, a <strong>bolt-on classifier</strong> in front of the pool, and a <strong>pinned</strong> choice. The router decides where the request goes, hands it off, and steps out.</p><p>Fugu inverts all three:</p><ul><li><strong>The choice comes from inside.</strong> The orchestrator is a model trained to “dynamically devise agentic scaffolds” over the pool (Abstract); the selection comes from its own internal state, learned from how the workers perform (§3.1.1–3.1.2), not a classifier reading your prompt. The paper is blunt that, unlike single-step routers, “Fugu models are themselves trained orchestrators that can adaptively decide how to use an agent pool for each query” (§2).</li><li><strong>Nothing is pinned.</strong> On multi-step tasks it re-decides per step (§4.1.2).</li><li><strong>Dispatch is only the floor.</strong> Its heavy variant stops picking models and starts conducting them (§3.2).</li></ul><p>So a router makes one decision and hands off; Fugu keeps deciding as the work goes on.</p><p>And that quietly answers my second question too. <em>Is it a model?</em> There is a real model in here, the orchestrator has weights and was trained. But what you’re using is the orchestrator <strong>plus</strong> the pool <strong>plus</strong> the learned coordination. The image that stuck with me: Fugu is a tem-lead who knows their team so well they don’t do the work themselves, they assign it. The team-lead is a model; “Fugu” is the team-lead and the team together.</p><figure><img alt="FIGURE 2 — proposed (create in the same style) Shows: a side-by-side. Left, “Router”: query → classifier → one model, pinned, hand off. Right, “Fugu”: query → trained orchestrator → per-step selection (fast) or composed workflow (Ultra), staying in the loop. Caption: Same packaging, different job: a router hands off, Fugu keeps going." src="https://cdn-images-1.medium.com/max/1024/1*JFjb-iydygEpvc-p4TDd8w.png" /><figcaption><strong><em>FIGURE 2 — </em></strong>Shows:<em> a side-by-side. </em><strong><em>Left, “Router”:</em></strong><em> query → classifier → one model, pinned, hand off. </em><strong><em>Right, “Fugu”:</em></strong><em> query → trained orchestrator → per-step selection (fast) or composed workflow (Ultra), staying in the loop. </em>Caption:<em> Same packaging, different job: a router hands off, Fugu keeps going.</em></figcaption></figure><p>That team-lead comes in two flavors (§1):</p><ul><li><strong>Fugu</strong> — picks one worker per query; latency stays near a direct model call.</li><li><strong>Fugu-Ultra</strong> — composes a whole workflow of agents per query; slower, but stronger on hard problems.</li></ul><p>Two different machines under the hood. So naturally my next question was about the fast one.</p><h3>So how does the fast one decide that fast?</h3><p>This was the detail that won me over. A naive orchestrator would think out loud, burn a full text generation just to reason about which model to call. Fugu doesn’t (all §3.1.1):</p><ul><li>“a lightweight selection head operates in parallel to the base model’s LM head” (Fig. 2);</li><li>it reads a hidden state and emits <strong>one logit per worker</strong>, and the query goes to the top scorer;</li><li>the trick: “Fugu uses the orchestrator’s logits rather than its generated text,” so it “can compute a hidden state at an early token position, apply the selection head, and immediately dispatch the query to the selected worker, without the expensive autoregressive decoding process.”</li></ul><p>No tokens spent deliberating. It decides, then gets out of the way. Two more choices keep it lean (§3.1.1): a tiny trainable footprint (just the selection head plus singular-value fine-tuning on a few backbone matrices), and no role assignment, “removing role assignment narrows the coordination space to model selection alone.” They made it simpler on purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HiW0iNNtpEy6VOyOqzhADw.png" /><figcaption><strong><em>FIGURE 3 </em></strong><em>The fast variant’s three stages — selection head, supervised fine-tuning on a soft target distribution, then sep-CMA-ES on end-to-end tasks (§3.1.1–3.1.3). </em>Fix before publishing:<em> the footer says “a single routing logit.” The head emits </em><strong><em>one logit per worker</em></strong><em> (L logits, §3.1.1) — better phrased “a single routing decision.”</em></figcaption></figure><h3>But how did it learn who’s good at what?</h3><p>This is the part I’d most want explained, so I dug in. The routing isn’t hand-written, it’s learned in two stages, and neither one teaches the orchestrator to <em>answer</em> anything. Both teach it to <em>predict who answers best</em>.</p><p><strong>Stage one — supervised fine-tuning on checkable tasks (§3.1.2).</strong></p><ul><li><strong>Data:</strong> a large set of single-step problems “spanning coding, mathematics, reasoning, language understanding, and numerous agentic scenarios,” each with a verifiable ground-truth solution.</li><li><strong>Labels:</strong> “run every worker model … for <em>n</em> repetitions and measure each model’s performance” against that solution, then “convert the scores into a soft target distribution over workers via a softmax transform.”</li><li><strong>Why soft:</strong> “learning from a soft performance distribution, rather than classifying a single best label, gives the orchestrator a richer training signal.” The experts effectively write the training set by sitting the same exams over and over.</li></ul><p><strong>Stage two — evolutionary optimization on end-to-end tasks (§3.1.3).</strong></p><ul><li><strong>Data:</strong> real multi-turn trajectories “from different coding-assistant environments like Claude Code, Codex, and OpenCode,” rebuilt into tasks with repository context, editing, tool calls, and execution feedback.</li><li><strong>Optimizer:</strong> sep-CMA-ES. <strong>Reward:</strong> one bit, did the task complete.</li><li><strong>Why bother:</strong> SFT already lands the parameters in a strong region; evolution then optimizes sparse end-to-end success directly. It also teaches a <em>practical</em> sense of skill, these trajectories “reveal differences between agents that are not visible from performance scores alone,” like a strong reasoner that’s clumsy with tools.</li></ul><p>One detail I appreciated: none of this overlaps what Fugu is later scored on. The benchmarks in the report were “unseen by our models during training” (§4.1.1).</p><p>And here’s the router contrast made concrete. A router leans on a fixed rule or a bolt-on classifier and pins one model; Fugu re-decides as it goes. On Terminal Bench it “alternates between GPT-5.5 and Claude-Opus-4.8 throughout the progression of the solution, calling in Claude-Opus-4.8 at particular, critical debugging points” (§4.1.2). Same surface behavior as a router, but a different thing underneath.</p><h3>And the heavy version — how does that work?</h3><p>Fugu-Ultra runs on a different mechanism, the Conductor, and here the orchestrator stops picking and starts composing (all §3.2.1):</p><ul><li>it “leverages reinforcement learning for training a language model to prompt-engineer and coordinate a set of powerful LLM agents”;</li><li>it writes a plan, “full agentic workflows as natural language that divide an input task, allocate arbitrary subtasks, and define targeted communication strategies”;</li><li>each step names a subtask, “an integer id corresponding to the assigned worker agent,” and “an access list indexing which subtask solutions from the previous steps to include in the worker’s context”;</li><li>that access list is the workhorse: by controlling what each worker sees, the Conductor builds anything from “simple best-of-N and sequential chain-like topologies to arbitrary parallelizable tree-structured approaches,” and can even name “the orchestrator itself as a worker agent”;</li><li>it’s trained with GRPO on a two-stage reward: zero if the workflow won’t parse; if it parses, 1 when the executed output is correct and 0.5 otherwise.</li></ul><p>Out of that, the paper says, emerge “problem decompositions and prompt-engineered subtasks” nobody hand-designed.</p><h3>Wait — doesn’t running many agents create a memory mess?</h3><p>That was my instinct, and it turns out to be a real problem the paper addresses. For a single agent, the tool loop needs no memory, the transcript carries everything, and there’s only one recipient. But in Fugu-Ultra “any agent may make a function call at any time,” so the system has to track who called what. Two mechanisms keep it sane (all §3.2.2):</p><ul><li><strong>Intra-workflow isolation</strong> — each agent’s trajectory is kept separate, to prevent “orchestration collapse, whereby the first agent to interact with the environment sets the trajectory for all future agents.” Each worker sees the others only through the access list.</li><li><strong>Persistent shared memory</strong> — agents still keep memory of the environment across turns “in order to not make redundant, repeated tool calls.” Isolated <em>within</em> a workflow, but sharing the conversation’s accumulated context.</li></ul><p>It reminded me of the state management you’d see in a distributed system.</p><h3>Okay, but isn’t this just a multi-agent framework?</h3><p>My last skeptical question. We already have frameworks that run several models together — the canonical one is <strong>Mixture-of-Agents</strong>: models answer the same prompt in parallel, and a synthesizer combines them. It works; reconciled attempts beat a single shot. But two things are fixed up front:</p><ul><li>the <strong>synthesizer</strong> — one model always aggregates, whatever the task;</li><li>the <strong>topology</strong> — propose, then aggregate, every time.</li></ul><p>The paper draws exactly this line and calls out exactly this class of system: “dynamic adaptation of an aggregator role is precisely the kind of adaptation unavailable to existing multi-agent systems,” which “necessitate a fixed model to always act as a final synthesizer.” They get “bottlenecked by that rigidity” — capped by the aggregator’s blind spots (all §4.4).</p><p>Fugu-Ultra doesn’t fix either one. It <strong>picks the aggregator per task</strong> — Gemini at the head of the tree for a trivia question, GPT for a math one (§4.4) — and <strong>builds the topology per question</strong> (§3.2.1). And underneath that, a framework is something <em>you</em> assemble and run, whereas Fugu “presents the collective as a single model interface” (§2) and assembles the workflow for you.</p><figure><img alt="FIGURE 5 — Shows: “Mixture-of-Agents”: panel → one fixed synthesizer, every task. “Fugu-Ultra”: panel → aggregator chosen per task — Gemini at the root for trivia, GPT for math. Caption: Same shape, except Fugu chooses the synthesizer per task instead of fixing one." src="https://cdn-images-1.medium.com/max/1024/1*8Y6Uey30ms0Imb6c9gv5DQ.png" /><figcaption><strong><em>FIGURE 5 — </em></strong>Shows:<em> </em><strong><em>“Mixture-of-Agents”:</em></strong><em> panel → one </em>fixed<em> synthesizer, every task. </em><strong><em>“Fugu-Ultra”:</em></strong><em> panel → aggregator </em>chosen per task<em> — Gemini at the root for trivia, GPT for math. </em>Caption:<em> Same shape, except Fugu chooses the synthesizer per task instead of fixing one.</em></figcaption></figure><h3>Fine — but does it work?</h3><p>That covered the how; I still wanted to see it work. The paper’s examples are the part I enjoyed most.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZw3Vs-RS6_ma2E1sYRMvA.png" /><figcaption><strong><em>FIGURE 6 — </em></strong><em>Three patterns Fugu-Ultra produces per task — debate-and-aggregation (tree), build-and-debug (loop), and the specialist handoff (§4.4).</em></figcaption></figure><p>Three coordination patterns keep recurring, each tied to a concrete task (all §4.4):</p><ul><li><strong>Debate and aggregation, </strong>on a Heroes of Might &amp; Magic III trivia question, two leaf agents (Gemini and GPT) each got it partly wrong, and a Gemini aggregator at the root stitched their answers into a fully correct one.</li><li><strong>Build and debug, </strong>building a PyPI server on Terminal Bench, GPT-5.5 built while Opus stepped in “to enumerate all concrete risks,” flagging a fragile zipfile-built wheel and an erroneous reachability check; relaying those back let GPT finish. (On a SWE-Bench Pro bug the roles flipped — Opus hit a dead end, GPT spotted “a client-side concurrency bug,” and they converged on a shared ContextReader.)</li><li><strong>The specialist</strong> — on a differential-cryptanalysis attack, Opus wrote the bulk of the exploit, then GPT was pulled in as a math specialist to derive the differential constant.</li></ul><p>And two demos that made the reliability tangible:</p><ul><li>a Rubik’s solver written from scratch: two of three frontier baselines shipped code that crashed, while both Fugu variants solved all 300 cubes — Fugu-Ultra at 19.72 moves, within one of God’s number, 20 (App. B.1);</li><li>blindfold chess, the whole board held in memory: it played “with no blunders or mistakes of its own” against an expert-strength engine (App. B.2, Fig. 9). The paper frames these as selected, illustrative games, not a win rate.</li></ul><h3>The digest: what Fugu is</h3><p>So, after all that, here’s the mental model I landed on.</p><p>Fugu is a small trained model that knows a team of frontier models well enough to conduct them. Ask it something, and a learned orchestrator, not a hand-written rulebook, decides who should handle it, often re-deciding mid-task, and in its heavy form composing a whole little workflow of agents and choosing who gets the final say. It learned all of this by watching the workers take the same exams, then by being rewarded only for finishing real tasks. You reach the whole thing through one endpoint, so it <em>feels</em> like one model.</p><p>Two things make it more than a clever wrapper, and they’re the answers to the two questions I started with:</p><ul><li>it’s <strong>not just a router</strong>, because a router hands off and leaves, while Fugu keeps working past that point — and it learned its choices instead of being handed a rulebook;</li><li>it’s <strong>not just a multi-agent framework</strong>, because nothing is wired in advance — the team, the topology, even who synthesizes, are all decided per question.</li></ul><p>And one quiet payoff for the future: because Fugu composes models at the behavioral level rather than merging their weights (§2, §5), you can opt providers out for compliance with no retraining (§1), and newly released models drop into the pool as they ship (§1). It gets better as the ecosystem does, without a training run of its own.</p><p>A bigger model would have been the obvious bet. Fugu is betting that the <em>conducting</em> matters as much as the size — and after chasing down all these questions, that’s the idea that stuck with me.</p><p><em>Source: Fugu Team, Sakana AI, “Sakana Fugu Technical Report,” </em><a href="https://arxiv.org/abs/2606.21228"><em>arXiv:2606.21228</em></a><em> (2026), CC BY 4.0. All quotations are from the report; section (§), figure (Fig.), and appendix (App.) references point to it. Product details (e.g., the OpenAI-compatible API) are from Sakana’s </em><a href="https://sakana.ai/fugu/"><em>Fugu product page</em></a><em>.</em></p><blockquote><strong>Hey! Thanks for reading :) Here are a couple of more of my AI related articles that you might like to read:</strong></blockquote><blockquote><a href="https://medium.com/@shiladitya321/prompt-engineering-mistake-why-too-many-constraints-kill-your-llm-output-1d78387fedb8"><strong>Prompt Engineering Mistake: Why Too Many Constraints Kill Your LLM Output</strong></a></blockquote><blockquote><a href="https://medium.com/@shiladitya321/agents-md-invariants-claude-code-1a5dffd84a12"><strong>Your AGENTS.md Is Probably Missing Invariants</strong></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e58a3ab897d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What a Naval Ravikant Podcast Taught Me About Happiness]]></title>
            <link>https://medium.com/the-yellow-tent-%EF%B8%8F/what-a-naval-ravikant-podcast-taught-me-about-happiness-4f20abe89945?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f20abe89945</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[naval-ravikant]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[happiness]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 16:25:09 GMT</pubDate>
            <atom:updated>2026-04-21T16:25:14.714Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p><em>I walked in looking for the elixir of happiness. I walked out with something quieter — peace over pleasure, desire as a contract, and the present moment.</em></p><figure><img alt="Yellow “HAPPINESS” painted on stone pavement with an arrow pointing forward" src="https://cdn-images-1.medium.com/max/1024/0*Mzptpv9Oar3334cF" /><figcaption>Photo by <a href="https://unsplash.com/@cooljonez?utm_source=medium&amp;utm_medium=referral">Denise Jones</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Recently, I’ve gotten into this habit of taking a walk around my neighbourhood after dinner, and more recently I started listening to podcasts as I’m walking. And on one such walk I came across a half-an-hour long Naval Ravikant podcast on “Happiness”! Now this is something that I’ve read a lot about — but still the urge remains to find that elixir that’s finally going to unlock the secret of being happy in the truest sense. So with this expectation in mind, I pressed the play button — hoping to learn something new about happiness..</p><h3>If we live long enough — we’re all philosophers</h3><figure><img alt="Pensive man looking towards the water" src="https://cdn-images-1.medium.com/max/1024/0*fdyzkAiuF_UMFnVT" /><figcaption>Photo by <a href="https://unsplash.com/@ante_kante?utm_source=medium&amp;utm_medium=referral">Ante Hamersmit</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As I started listening to the podcast, this was the line that got me hooked in an instant. True isn’t it? All of us who have spent more than a couple of decades on this planet have developed our own belief-systems, we all have our definitions of good-and-bad, right-and-wrong. We all start seeing everything in a larger scheme of things, start looking out for answers like — what makes us and more importantly keeps us happy.</p><h3>You won’t buy your way into happiness, but you can buy your way out common causes of unhappiness</h3><figure><img alt="A man rejoicing near a lake" src="https://cdn-images-1.medium.com/max/1024/0*8K7aoE6JHsWIRLUq" /><figcaption>Photo by <a href="https://unsplash.com/@kyleloftusstudios?utm_source=medium&amp;utm_medium=referral">Kyle Loftus</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We’ve all grown-up with this idea — <em>money can’t buy you happiness!</em> True, but misplaced and misinterpreted. Without money/wealth you’ll always live in a survival mode, money gives you freedom. It buys you time so that you can focus on different aspects in life that’ll ultimately become your path to happiness.</p><p>Also, <em>money can’t buy you happiness</em> is something that the society has conditioned us to believe. A society is a group and a group seeks consensus. It is not hard to figure out that there are fewer wealthy people in the society than the people who are not. Hence, it is always good to question certain beliefs and find what is right.</p><h3>Happiness is peace, not pleasure</h3><figure><img alt="Calm water refecting sunset colors" src="https://cdn-images-1.medium.com/max/1024/0*29b2En00CEqhOsti" /><figcaption>Photo by <a href="https://unsplash.com/@harlimarten?utm_source=medium&amp;utm_medium=referral">Harli Marten</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>One of the sharpest ideas from the podcast was this — we often confuse happiness with excitement or pleasure, but they’re not the same thing.</p><blockquote>Pleasure is a high, and every high has a low on the other side.</blockquote><p>Peace is something quieter — it’s the absence of a restless mind, the feeling of having nowhere else you’d rather be.</p><p>This reframed a lot for me. I’d spent years chasing moments — the next trip, the next milestone, the next <em>I’ll be happy when…</em>. But those are peaks, and peaks always come with valleys. Peace doesn’t need a high to exist. It just needs you to stop running.</p><h3>Every desire is a chosen unhappiness</h3><figure><img alt="Letting go a bunch of colorful balloons" src="https://cdn-images-1.medium.com/max/1024/0*hVTEf3W7EwAmNKcI" /><figcaption>Photo by <a href="https://unsplash.com/@an_ku_sh?utm_source=medium&amp;utm_medium=referral">Ankush Minda</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This line stopped me mid-step on the walk. Every desire is essentially a contract you sign with yourself —</p><blockquote>I will be unhappy until this thing happens.</blockquote><p>Think about how many of these contracts we’re carrying around at once. The promotion. The relationship. The recognition. Each one a quiet agreement to be dissatisfied until life delivers.</p><p>The podcast didn’t say desires are bad — it said <em>be deliberate about them</em>. Pick one or two that genuinely matter, and let the rest go. Because the cost of a desire isn’t just the effort it takes to achieve it — it’s all the moments in between where you tell yourself <em>you’re not enough yet</em>.</p><h3>The present is the only place happiness actually lives</h3><figure><img alt="Solitary bench in a mystical forest" src="https://cdn-images-1.medium.com/max/1024/0*fd7u8_E9aCgjDEaI" /><figcaption>Photo by <a href="https://unsplash.com/@ripey__?utm_source=medium&amp;utm_medium=referral">Ibrahim Rifath</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I caught myself doing something on this walk — mentally drafting tomorrow’s work, rehearsing a conversation I hadn’t had yet, circling back to something someone said last week. The body was walking, the mind was somewhere else entirely.</p><p>The podcast’s point was simple — <em>happiness is a present-moment phenomenon</em>. You can’t be happy about tomorrow, you can only <em>anticipate</em>. You can’t be happy about yesterday, you can only <em>remember</em>. The only moment happiness can actually be experienced is this one. And we spend most of our lives leaving it.</p><h3>So, what did the podcast actually teach me?</h3><figure><img alt="A dandelion flower" src="https://cdn-images-1.medium.com/max/1024/0*_MZ5ADSL8WfwQp_Q" /><figcaption>Photo by <a href="https://unsplash.com/@breakfast_on_jupiter?utm_source=medium&amp;utm_medium=referral">Aleksandr Ledogorov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>By the time I reached home, the podcast had ended. I didn’t find the elixir I’d gone in looking for — no five-step formula, no single insight that rearranged my life. But I did come back with something steadier.</p><blockquote>Happiness isn’t a destination you arrive at. It’s a skill you practice.</blockquote><p>It’s the small act of auditing your desires. Of choosing peace over the next high. Of catching yourself drifting and coming back to where your feet are.</p><p>And maybe that’s why the walks help. For thirty minutes a day, there’s nowhere else to be.</p><p>Link to the podcast: <a href="https://open.spotify.com/episode/1shh8qUjlDWEKOoNzzBBms?si=f57502e42cdb4dfe">https://open.spotify.com/episode/1shh8qUjlDWEKOoNzzBBms?si=f57502e42cdb4dfe</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f20abe89945" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-yellow-tent-%EF%B8%8F/what-a-naval-ravikant-podcast-taught-me-about-happiness-4f20abe89945">What a Naval Ravikant Podcast Taught Me About Happiness</a> was originally published in <a href="https://medium.com/the-yellow-tent-%EF%B8%8F">The Yellow Tent 🏕️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your AGENTS.md Is Probably Missing Invariants]]></title>
            <link>https://shiladitya321.medium.com/agents-md-invariants-claude-code-1a5dffd84a12?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a5dffd84a12</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[ai-coding-agent]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Wed, 15 Apr 2026 21:20:16 GMT</pubDate>
            <atom:updated>2026-04-15T21:20:16.136Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vhP2I7pXaWeSNwtFK9rQLA.png" /></figure><blockquote><em>Why your Claude Code spec keeps growing — and how to write rules that absorb failures instead of accumulating them.</em></blockquote><h3>A Tuesday afternoon with Claude Code</h3><p>You’re on your fourth PR of the day with Claude Code, and your AGENTS.md just got another bullet. The agent just added a card component to the dashboard, and on review you notice it:</p><ul><li><em>Used a raw hex value instead of a design token.</em></li></ul><p>You sigh, open AGENTS.md, and add a bullet: <em>&quot;Don&#39;t use raw hex values — always use tokens from </em><em>@/theme/tokens.&quot;</em> You commit the fix and kick the agent again. The next pass uses the token, but now the card has:</p><ul><li><em>A local </em><em>useState for loading state that the parent was already tracking.</em></li></ul><p>You add another bullet. <em>“Don’t introduce local state for anything the parent is already tracking.”</em> Two bullets in one session. It’s a Tuesday.</p><p>You glance at the top of the file and notice something uncomfortable. The rules have spilled past the first screen. The “Important” section has twenty-three items. Half reference incidents you half-remember. The agent seems to be following maybe sixty percent of them on any given run — and <em>which</em> sixty percent shifts depending on how much else is in the prompt that day.</p><p>You’re now at the failure mode every patched spec converges to:</p><ul><li><strong>You can’t tell which rules are still load-bearing.</strong> The original three made sense. The next twenty arrived as patches against specific bad outputs, and the war stories behind half of them have faded.</li><li><strong>The agent’s compliance is non-deterministic.</strong> It follows a different subset of rules each run, because at this length the rules are competing with each other for attention.</li><li><strong>Every new failure invites a new rule.</strong> The fix that worked yesterday — <em>add a bullet</em> — is the only tool you have, and the file is growing faster than you can reason about it.</li><li><strong>You can’t onboard the spec.</strong> The next engineer who joins will read it, ask you why rule #14 exists, and you won’t remember.</li></ul><p>This is the trajectory. Eventually somebody rewrites the whole file from scratch, losing every hard-won war story encoded in the patches, and the cycle starts over in six months.</p><p>There’s a different shape this file can take — one that absorbs the patches instead of accumulating them, and one the agent can actually check itself against when it’s done. It’s a shape engineers already use everywhere else in their code, and once you see it, the AGENTS.md you’ve been patching for months collapses into something you can hold in your head again. The example later in this article shows exactly what that looks like on the file you just read about.</p><h3>Invariants</h3><p>An invariant is a property that always holds. It’s what you mean when you say “this list is always sorted,” “this reference is never null,” “every request has a corresponding response.” The term comes from program verification but engineers use it intuitively every day — in type signatures, in database constraints, in loop invariants, in the contracts we enforce at API boundaries.</p><p>The reason we reach for invariants in code is that they’re a compact way to rule out an entire class of states instead of enumerating the specific bad states we happen to have seen.</p><p>A spec invariant is the same idea, applied to what a coding agent produces. Instead of a list of failures to avoid — “don’t use hex values, don’t introduce local state, don’t, don’t” — you write properties that every correct change must have.</p><p>Here’s the move in its smallest form:</p><ul><li><strong>Constraint:</strong> <em>“Don’t use raw hex values — always use tokens.”</em></li><li><strong>Invariant:</strong> <em>“Every color value in code resolves to a token from </em><em>@/theme/tokens.&quot;</em></li></ul><p>Read those twice. The constraint is written in the shape of a past mistake — it describes the specific thing you saw yesterday.</p><p>The invariant is written in the shape of a property the code has or doesn’t have, in a form that can be checked against any line of code without knowing what went wrong last Tuesday. And the invariant catches failure modes the constraint doesn’t: a hex value smuggled in via an inline style, a color typed as rgb() instead of hex, a hardcoded Tailwind class like bg-[#fff]. The constraint chased one mistake. The invariant named the property those mistakes were all violating.</p><p>That’s the entire move. The question for the rest of this article is whether it actually buys you anything when applied to a real, messy AGENTS.md — and I want to be upfront that the answer is <em>partially</em>, not <em>magically</em>.</p><h3>A frontend AGENTS.md, patched over four months</h3><p>Here’s the kind of file I’m talking about. This is a React/Next.js dashboard app with a design system, a component library, and a small team who’ve been using Claude Code for a couple of months. I invented this file, but I invented it to look like the real ones I’ve seen — cluttered, war-story-heavy, and mostly written in the past tense of specific failures.</p><pre># Dashboard App<br>This is the Acme admin dashboard, built with Next.js 14 (App Router), TypeScript, and Tailwind. We use shadcn/ui for primitives and a custom component library in `src/components/ui/`. Data fetching goes through TanStack Query; forms use react-hook-form with zod resolvers.<br>When making changes, please follow these guidelines:<br>**Styling**<br>- Don&#39;t use raw hex values. Use tokens from `@/theme/tokens` (e.g., `tokens.color.surface.primary`).<br>- Don&#39;t use arbitrary Tailwind values like `bg-[#fff]` or `p-[13px]`. Use the scale.<br>- Don&#39;t mix styling approaches - if the file uses Tailwind, don&#39;t introduce CSS modules.<br>- We had a bug where someone added `!important` to override a design system style. Don&#39;t do this. If the design system isn&#39;t giving you what you need, ask a human.<br>**Components**<br>- Prefer composition over configuration. Don&#39;t add a new prop to `&lt;Button&gt;` when you could wrap it.<br>- Don&#39;t introduce local state (`useState`) for values the parent is already tracking. Lift state up.<br>- Don&#39;t use `useEffect` for data fetching - use TanStack Query. We had an incident where a component fetched the same data three times on mount because of a stale-closure bug.<br>- Don&#39;t add `key={index}` to list items. Use a stable id.<br>- Don&#39;t use inline arrow functions in JSX props if the component is memoized - it breaks memoization.<br>**Accessibility**<br>- Every interactive element must be keyboard-accessible. Don&#39;t use `&lt;div onClick&gt;`.<br>- Every form input must have an associated label. Not a placeholder - a label.<br>- Don&#39;t remove focus outlines without providing a replacement.<br>- Images must have alt text. Decorative images should have `alt=&quot;&quot;`.<br>- We had an a11y audit flag our modals last quarter - they weren&#39;t trapping focus. Don&#39;t ship a modal that doesn&#39;t trap focus.<br>**Data fetching**<br>- Use TanStack Query for all server state. Don&#39;t use `useEffect` + `fetch`.<br>- Don&#39;t hardcode API URLs. Use the `api` client from `@/lib/api`.<br>- Don&#39;t catch errors silently. Either handle them or let them bubble to the error boundary.<br>- We had a case where someone called an internal endpoint from a client component and it leaked through to the browser network tab. If an endpoint is internal-only, call it from a server component or a route handler.<br>**Forms**<br>- Use react-hook-form with a zod resolver. Don&#39;t roll your own form state.<br>- Don&#39;t submit forms to an endpoint without validating on the client first.<br>- Don&#39;t disable the submit button based on validation - show errors inline and let the user try.<br>**Testing**<br>- New components need at least one test. We use Vitest + Testing Library.<br>- Don&#39;t test implementation details (don&#39;t assert on `useState` internals). Test what the user sees.<br>- Don&#39;t use `data-testid` as the primary query. Prefer role/label/text queries.<br>**Important things we keep getting wrong:**<br>- Don&#39;t import from `@/components/ui/index` - import from the specific file. The barrel import breaks tree-shaking and we measured a 40kb regression.<br>- Don&#39;t use `next/image` without specifying width and height. It breaks CLS.<br>- Don&#39;t add a new npm dependency without asking.<br>- Don&#39;t edit files in `src/generated/` - they&#39;re generated from the API schema.<br>- Don&#39;t `console.log` in committed code. We have a logger at `@/lib/logger` for anything that should persist.<br>- Don&#39;t add new translations directly to the English file - use the i18n CLI.<br>- Be concise in your PR descriptions. Don&#39;t re-explain the whole codebase.</pre><p>Count the don’ts. I count twenty-eight. Notice the shape of the pollution: war stories embedded in sentences (“<em>We had an incident where a component fetched the same data three times on mount</em>”), a bottom-of-file “Important things we keep getting wrong” section that is always the dead giveaway of a patched spec, and at the very end — the tell I find most poignant in every polluted file I’ve ever read — an instruction to <em>be concise</em> appearing at the end of a document that is itself not concise.</p><p>This file isn’t bad. It’s <em>typical</em>. The engineers who wrote it are doing exactly what engineers are supposed to do: noticing failures, writing them down, trying to prevent recurrence. The problem isn’t the discipline. The problem is the shape.</p><h3>Rewriting AGENTS.md</h3><p>Here’s the same AGENTS.md, rewritten as a short list of invariants plus the few constraints that don’t compress. I want you to read the whole thing first and then we’ll walk through what each one is doing.</p><pre># Dashboard App<br>This is the Acme admin dashboard: Next.js 14 (App Router), TypeScript, Tailwind, shadcn/ui, TanStack Query, react-hook-form with zod.<br>Every change you make must satisfy the following invariants. Verify each one against every file you have touched before you finish.<br>**I1 - Pattern conformance.** Every file you add or modify follows the patterns already visible in the nearest sibling files of the same kind. Components look like other components. Tests look like other tests. Styling follows the approach already in use in that file.<br>**I2 - Design system boundary.** Every visual value in code - color, spacing, radius, typography, shadow - resolves to a token from `@/theme/tokens` or a class from Tailwind&#39;s configured scale. A value that bypasses the design system (arbitrary Tailwind, inline hex, `!important`, raw CSS property) is a violation.<br>**I3 - State locality.** Every piece of state lives at the lowest level of the tree that needs it, and no lower. A child component holding state the parent is already tracking is a violation. A parent holding state only one child uses is a violation.<br>**I4 - Server state via query client.** Every read of server data goes through a TanStack Query hook, and every write goes through a mutation. A `useEffect` that fetches, a bare `fetch` call in a component, or a hand-rolled loading/error state machine over async data is a violation.<br>**I5 - Interaction accessibility.** Every element a user can interact with is reachable by keyboard, labeled for screen readers, and exposes the correct ARIA role. An interactive `&lt;div&gt;`, an input without a label, a modal that doesn&#39;t trap focus, or an image without `alt` is a violation.<br>**I6 - Error surface.** Every async operation either handles its error locally with a user-visible outcome or lets the error propagate to the nearest error boundary. A silently swallowed catch, a promise with no `.catch`, or an error logged and discarded is a violation.<br>**Constraints that don&#39;t reduce to an invariant:**<br>- No new npm dependencies without asking.<br>- Don&#39;t edit files under `src/generated/`.<br>- Import component primitives from their specific file, not from `@/components/ui/index` (tree-shaking).<br>- `next/image` requires explicit width and height.<br>- New translations go through the i18n CLI, not direct edits to locale files.</pre><p>Six invariants and five constraints. The original had twenty-eight patches plus some of those same constraints buried among them. Let me tell you what each invariant is doing and — this is the part I’m going to be honest about — where its limits are.</p><h3>I1 — Pattern conformance</h3><p><strong>What it absorbs.</strong> Rules like “don’t mix styling approaches,” “don’t add a new prop when you could wrap,” “don’t use data-testid as the primary query,&quot; &quot;don&#39;t test implementation details.&quot; Every one of these is really a statement about what <em>sibling files already do</em>:</p><ul><li>Design system files don’t mix approaches.</li><li>Existing components don’t add redundant props.</li><li>Existing tests use role queries.</li></ul><p>If the agent is told to conform to the patterns already visible, all of those rules collapse into a single instruction it can act on: <em>read the neighbors and match them</em>.</p><p><strong>What it covers for free.</strong> Rules you didn’t think to write down — import ordering, naming conventions, file layout, how errors are handled in similar situations. The rules the original spec is missing are the ones I1 handles automatically.</p><p><strong>Honest limit.</strong> I1 only works if the neighbors are actually consistent. In a codebase with three different styling approaches because it grew organically and nobody cleaned up, the agent will pick one at random and justify it as conformance. I1 leverages consistency that already exists; it doesn’t create consistency that doesn’t. In a messy codebase, pair it with an explicit reference file the agent is told to prefer — otherwise it’ll amplify the mess.</p><h3>I2 — Design system boundary</h3><p><strong>What it absorbs.</strong> The whole styling section plus the !important war story. The original spec was trying to block three separate mistakes, all of which were the same underlying failure (code that bypassed the design system):</p><ul><li>Hex values</li><li>Arbitrary Tailwind classes</li><li>!important overrides</li></ul><p>The invariant names the property directly — every visual value resolves to a token or a configured class — and the three failure modes collapse into one check.</p><p><strong>What it covers for free.</strong> Failure modes the original spec didn’t list: a hardcoded RGB value, an inline style with a px value, a custom CSS file imported into a component. Any new way to sneak a magic value into the code fails I2 automatically.</p><p><strong>Honest limit.</strong> I2 isn’t structurally unviolatable. The agent can still:</p><ul><li>Produce a token name that doesn’t exist (tokens.color.surface.magical)</li><li>Use a Tailwind class that <em>looks</em> configured but was actually added as an arbitrary value by someone else months ago</li></ul><p>The invariant narrows the judgment call — “does this value come from the token file?” is much easier to answer than “is this styling approach okay?” — but the judgment is still there. What you get is a more focused question, not a guaranteed answer.</p><h3>I3 — State locality</h3><p><strong>What it absorbs.</strong> “Don’t introduce local state for values the parent is tracking” plus its mirror, “don’t hold state in the parent if only one child needs it.” The original spec only had the first half because that’s the failure mode the team had seen. The invariant states the property <em>bidirectionally</em> because state locality is a property, not a mistake — once you name it that way, both failure modes fall out of the same rule, and so does every other state-placement failure the team hasn’t encountered yet.</p><p><strong>Honest limit.</strong> “The lowest level that needs it” is itself a judgment call:</p><ul><li>Two siblings sharing state need a common ancestor.</li><li>Three siblings need a higher one.</li><li>A sibling that <em>will</em> need the state next sprint complicates things.</li></ul><p>The agent is going to get edge cases wrong, and I3 doesn’t prevent that. What it does prevent are the <em>confidently wrong</em> cases — the ones where the agent adds useState to a leaf component for a value the parent is already rendering. Those were the failures the original spec was patching. I3 catches them cleanly.</p><h3>I4 — Server state via query client</h3><p><strong>What it absorbs.</strong> Multiple patches that were all symptoms of the same bypass:</p><ul><li>The TanStack Query rule</li><li>The stale-closure war story</li><li>“Don’t hardcode API URLs”</li><li>The “internal endpoint leaked to browser” incident</li></ul><p>The last one isn’t obvious until you see why: an internal-only endpoint called from a client component is a <em>read of server data not going through a query hook</em>, because the query hook would have routed it properly. The underlying failure wasn’t “someone called an internal endpoint from the wrong place” — it was “the server-fetching pathway got bypassed.” I4 catches the bypass; the specific leak story is one instance of it.</p><p><strong>Honest limit.</strong> I4 is the cleanest invariant in this file, and the one I’m most confident about. The reason is structural: TanStack Query is a <em>narrower</em> pathway than “do whatever async you want.” The more your codebase channels work through a specific abstraction, the more checkable the invariants about that abstraction become.</p><p>This is a general pattern worth naming explicitly: <strong>invariants are easier to write and easier to verify against codebases that already have strong abstractions.</strong> In a codebase where everyone rolls their own async, I4 wouldn’t work — you’d have to introduce the abstraction first and name the invariant about it second.</p><h3>I5 — Interaction accessibility</h3><p><strong>What it absorbs.</strong> Four separate a11y rules into one property: every interactive element is fully accessible. The original spec had patches accumulated from five different audit findings:</p><ul><li>Keyboard access</li><li>Labels</li><li>Focus outlines</li><li>Alt text</li><li>Focus traps</li></ul><p>The invariant names the property the audits were all checking against. Any future finding either already falls under I5 or reveals a new a11y property the invariant should be strengthened to include.</p><p><strong>Honest limit.</strong> This is the most <em>aspirational</em> invariant in the file — it names a direction rather than a mechanical check. A real a11y audit will still catch things I5 doesn’t.</p><h3>I6 — Error surface</h3><p><strong>What it absorbs.</strong> “Don’t catch silently” and several other scattered error-handling patches. The underlying property: every async operation has a <em>declared outcome</em> — either it resolves visibly for the user, or it escalates to something that will. All of these violate the same contract:</p><ul><li>Silently eaten errors</li><li>Floating promises with no .catch</li><li>Log-and-discard catch blocks</li></ul><p><strong>Honest limit.</strong> “Handles its error locally with a user-visible outcome” papers over real judgment calls — is a silent retry visible? a failed background refresh? — and this is the invariant I’m least confident about in the file.</p><h3>What stays as a constraint</h3><p>Five rules don’t compress, and that’s correct. They aren’t symptoms of a deeper property — they <em>are</em> the property, in the smallest form it comes in:</p><ul><li><strong>No new npm dependencies without asking.</strong> A supply-chain policy, not a code-shape property.</li><li><strong>Don’t edit </strong><strong>src/generated/.</strong> A don&#39;t-touch zone enforced by a tool outside the agent&#39;s view.</li><li><strong>Use specific imports, not the barrel.</strong> A mechanical perf rule with a measured cost (40kb).</li><li><strong>next/image requires explicit width and height.</strong> A framework requirement.</li><li><strong>Translations go through the i18n CLI.</strong> A cross-cutting tooling constraint.</li></ul><p>Leaving these as constraints is the right call. The discipline isn’t to convert every rule into an invariant — it’s to stop <em>patching</em> what should be <em>named</em>.</p><h3>What the move does not do</h3><p>I want to be clear about something, because I’ve read enough AI writing to recognize the genre and I don’t want this piece to join it. Rewriting an AGENTS.md as invariants does <em>not</em>:</p><p><strong>Make the agent magically correct.</strong> The agent still has to interpret what “conforms to sibling patterns” means on every file. It’ll get some of those interpretations wrong. The invariant version is better than the constraint version, but it’s better by maybe 20–40% on the things I’ve tried it on, not by 10x. If the piece you’re reading is claiming 10x, the author is either running a very small test or isn’t counting carefully.</p><p><strong>Eliminate judgment.</strong> Every invariant in the file above still has a fuzzy boundary. I2’s boundary is “what counts as a visual value”; I3’s is “what counts as the lowest level that needs it”; I5’s is “what counts as fully accessible.” The invariants don’t remove those judgments — they narrow them to a smaller, more focused question the agent is more likely to answer correctly. “Is this a design system token?” is an easier question than “is this styling approach okay?” but it’s still a question the agent can get wrong.</p><p><strong>Guarantee the file won’t grow.</strong> I believe invariant-driven specs grow more slowly than constraint-driven ones, but I don’t have a controlled experiment and neither does anyone else writing about this. What I can say is that when a new failure mode shows up, the question the invariant discipline asks (“is this a new property or a leaky existing one?”) produces a <em>smaller</em> edit to the file than the patching discipline (“add a new bullet”). Smaller edits accumulate slower. That’s the claim, and it’s the honest version of the “specs converge” story.</p><p>What the move <em>does</em> do is measurable and real. It replaces rules the agent had to remember with rules the agent can check. It collapses several rules that were symptoms of the same cause into one rule that names the cause. It makes the spec readable in one pass by a new team member. And it produces a file small enough that you can tell, at a glance, whether a new rule you’re about to add is already covered by an existing invariant — which is the single most important discipline for keeping a spec from sprawling.</p><p>If you’ve been around this conversation for a while, the invariant-shaped spec will feel adjacent to several things: structured outputs and JSON schemas, which push output <em>shape</em> into a declarative form the model has to match; type systems, which let the compiler enforce properties instead of hoping programmers remember them; the broader spec-driven development movement, where the spec is the artifact you iterate on and the code is downstream.</p><p>What I think this reframe adds to that conversation is specifically about <em>prose specs for coding agents</em> — the AGENTS.md and SKILL.md tier, which sits between a schema (too rigid for what you want to express) and a README (too loose for an agent to check itself against). Invariants are a shape that fits that tier: declarative enough to be checkable, prose enough to capture things a schema can’t. The move isn’t novel in the abstract. It’s the specific application to this specific artifact that I haven’t seen written down, which is why I’m writing it down.</p><h3>A small example: a SKILL.md for adding a chart</h3><p>One more, briefly, to show that the move transfers to narrower specs. This is the kind of file you’d drop into .claude/skills/add-chart/SKILL.md when your team keeps asking Claude Code to add charts to the dashboard and keeps getting results that don&#39;t match the design system or the data patterns.</p><p>The patched version:</p><pre>**When to use this skill:** user is asking to add or modify a chart in the dashboard.<br>We use Recharts. <br>Don&#39;t use a different chart library. <br>Don&#39;t use hardcoded colors - use the chart palette from `@/theme/chart`. <br>Don&#39;t forget to handle empty states (we had a bug where a chart rendered as a broken axis when the data was `[]`). <br>Don&#39;t forget the loading state. Don&#39;t use a line chart for categorical data. <br>Don&#39;t use a pie chart for more than five categories. <br>Don&#39;t forget to make it responsive - we had a case where a chart was fixed at 800px and broke on mobile. Accessibility: charts need an accessible name and a text summary for screen readers. Don&#39;t skip this.</pre><p>Nine don’ts, two war stories, one conflated paragraph. The invariant version:</p><pre>**When to use this skill:** user is asking to add or modify a chart in the dashboard.</pre><blockquote>A correct chart change satisfies:</blockquote><blockquote>**I1 — Library conformance.** The chart uses Recharts and the palette from `@/theme/chart`. Any other library or color source is a violation.</blockquote><blockquote>**I2 — State completeness.** The chart renders a meaningful UI for all three states: loading, empty (zero data points), and populated. A chart that only handles the populated case is incomplete.</blockquote><blockquote>**I3 — Chart-type fit.** The chart type matches the shape of the data: continuous data uses line or area, discrete comparison uses bar, part-of-whole with ≤5 categories uses pie, everything else uses bar. A mismatch is a violation.</blockquote><blockquote>**I4 — Responsive and accessible.** The chart resizes to its container and exposes an accessible name plus a text summary readable by a screen reader.</blockquote><p>Four invariants and zero residual constraints — this skill was small enough that everything compressed cleanly. The nine don’ts collapsed into properties about library use, state completeness, chart-type fit, and responsive accessibility. The two war stories (broken empty state, fixed-width chart on mobile) are now properties rather than stories, which is what war stories should become when you’re ready to prevent recurrence instead of just remembering the pain.</p><p>The interesting thing about the small example is that it shows the move is <em>more</em> dramatic on narrower specs, not less. The deep example had a residue of five constraints that didn’t compress; the small example has none. Small, focused specs are where invariant-driven writing works best, because every rule is about the same underlying activity and every rule has a chance of being a symptom of the same few underlying properties.</p><h3>The discipline</h3><p>The next time you’re about to add a don’t to an AGENTS.md or a SKILL.md, stop and ask one question: <em>what property is this bad output violating?</em> If you can name the property, the invariant is better than the patch, and you can probably delete two or three other rules that were pointing at the same thing. If you can’t name the property — if the rule is a one-off policy, a mechanical lint, or a cross-cutting tooling constraint — leave it as a constraint and move on. The goal isn’t to convert every rule into an invariant. The goal is to stop <em>patching</em> what should be <em>named</em>.</p><p>Then add one line at the end of your spec that the patched version doesn’t have: <em>verify each invariant against every file you have touched before you finish</em>. That single line is what turns the spec from a list of rules the agent is supposed to remember into a checklist the agent can run on its own output.</p><h3>The test</h3><p>Here’s how you know whether you got the rewrite right. For each rule in your spec, ask whether the agent — after it has finished a change — can answer the question <em>did I satisfy this on the files I just touched?</em></p><p>If the answer is yes, you’ve written an invariant. The rule names a property, the property is checkable against the diff, and the agent can run the check without external help. This is the whole point. Your spec has stopped being a hope and started being a contract.</p><p>If the answer is “sort of” or “I think so” or “it depends what you mean by,” you’ve written a constraint in disguise. The rule is still a good rule, but it’s a rule that will continue to produce drift on the failure modes it was originally written to catch, because the agent can’t verify it even when it wants to. You haven’t lost — the rewrite is still better than the patched version — but you also haven’t gotten the full benefit of the move. That’s where the next iteration goes.</p><p>Your AGENTS.md grows because every failure you’ve seen leaves a scar, and scars accumulate. The shape of the scar is the thing you can control. A scar written as a don’t tells the agent one thing it’s not supposed to do and then hopes it remembers. A scar written as an invariant tells the agent one thing it must verify about every file it touches, and then gives it the means to do the verifying. The first shape ages into scar tissue. The second shape ages into a specification.</p><p>Stop hoping. Start specifying.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a5dffd84a12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prompt Engineering Mistake: Why Too Many Constraints Kill Your LLM Output]]></title>
            <link>https://shiladitya321.medium.com/prompt-engineering-mistake-why-too-many-constraints-kill-your-llm-output-1d78387fedb8?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d78387fedb8</guid>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 15:44:09 GMT</pubDate>
            <atom:updated>2026-04-06T04:12:31.379Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MsBvQytAUC3gOEd_I3rGw.png" /></figure><p>You’ve probably seen those <em>“anatomy of a perfect prompt”</em> frameworks floating around LinkedIn — role, task, context, examples, thinking, constraints, output format, prefill. Structured. Satisfying. And mostly solid advice.</p><p>Until you get to the <strong>constraints</strong> layer and go overboard.</p><p>Here’s what those frameworks don’t tell you: <strong><em>LLMs have a finite attention budget.</em></strong> Every token the model processes — your instructions, your rules, your context — competes for the same limited pool of attention.</p><p>Think of it like working memory in a human brain. The more rules you force the model to hold in mind, the less cognitive capacity it has left for the thing you actually care about: <em>understanding your content and generating a quality response.</em></p><p><strong><em>This is the prompt engineering trap nobody talks about</em></strong>…</p><p>When you stack nine rules onto a prompt, you’re not making it more precise — you’re eating into the model’s ability to reason. Each constraint you add claims a slice of that attention budget, and past a tipping point, the model is spending more effort navigating your rule minefield than doing the actual task.</p><p>The result? Output that reads like a compliance checklist, not a thoughtful response.</p><p>Let me show you exactly what this looks like — and the fix that actually works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*872HQW-Tq7M_67C5mDHt5Q.png" /><figcaption>Fig 1: An example that we are going to use thorughout this article, a prompt for summarizing a research paper, on the left you see the typical over-constatined prompt — the right one leaves enough attention budget for the LLMs to work ..</figcaption></figure><h3>What an Over-Constrained Prompt Looks Like</h3><p>Say you want an LLM — Claude, GPT-4, Gemini — to summarize a research paper. After following every prompt optimization checklist you’ve seen, you arrive at this:</p><pre>You are a senior research scientist with 15 years of experience.<br>Your tone should be precise but accessible. Your audience is engineers.<br><br>Summarize this paper so that the key findings are clear.<br><br>Rules you must follow:<br>- Never use passive voice<br>- Always cite specific section numbers<br>- Never exceed 300 words<br>- Always use bullet points for findings<br>- Never start a sentence with &quot;The&quot;<br>- Always include a confidence score for each claim<br>- Never use jargon without defining it<br>- Always end with exactly 3 open questions<br>- If you are about to break any rule, stop and tell me</pre><p>Nine rules. Each sounds reasonable on its own. Together, the LLM spends more attention navigating your rule minefield than understanding the paper. The output reads like a compliance exercise, not a summary.</p><p>This is the hidden trap in prompt engineering: <strong>more constraints ≠ better output.</strong></p><h3>Why Over-Constraining Hurts LLM Output</h3><p>Three things happen under the hood when you overload a prompt with rules:</p><h3>Attention is finite</h3><p>Every constraint you add competes for the model’s limited context window. The more rules it holds in working memory, the less capacity remains for the actual task — understanding, reasoning, and synthesizing your content.</p><h3>Constraints conflict silently</h3><p>“Never use passive voice” and “always cite section numbers” can quietly clash. A natural sentence like <em>“It was found in Section 3.2 that…”</em> is passive. The model either breaks a rule or produces an awkward rewrite. You won’t know which rules are fighting until the output looks off. The scary part is that you have introduced this conflict without even realizing it ..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xZ9cfkuN7N0106JT8Cn9nw.png" /><figcaption>Fig 2: Conflicting constraints that you introduce without even realizing</figcaption></figure><h3>You’re solving problems that don’t exist yet</h3><p>Half the rules in a heavily constrained prompt are preemptive patches for failure modes that <strong>haven’t happened.</strong> You’re debugging code you haven’t run — and creating new bugs in the process.</p><h3>The Fix: Iterative Prompt Refinement</h3><p>The best prompt engineers don’t front-load constraints. They <strong>iterate.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xwz6sMv7pBw2ziNozokgog.png" /><figcaption>Fig 3: The ideal iterative approach to solving complex tasks with prompt engineering</figcaption></figure><p>Think of prompt optimization like debugging, not architecture. You wouldn’t write 200 lines of error handling before running your code once. Same principle applies.</p><p><strong>Start with a lean prompt:</strong></p><pre>Summarize this research paper for a technical audience.<br>Focus on key findings, methodology, and implications.<br>Keep it under 300 words.</pre><p>Three lines. Run it. Read the output critically.</p><p>Maybe the output is too jargon-heavy. Now you’ve identified the <em>actual</em> failure mode. Add <strong>one</strong> targeted constraint:</p><pre>Define any specialized terms on first use.</pre><p>Run it again. Maybe the structure needs work. Add:</p><pre>Use bullet points for the key findings section.</pre><p>Two iterations. Two surgical fixes. Better output than the nine-rule version — because every constraint was <strong>earned</strong>, not speculative.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVvWXTlBdd-vngyLHXJY0Q.png" /><figcaption>Fig 4: An iterative prompt evolution</figcaption></figure><h3>The Iterative Prompting Framework</h3><p>Here’s the process distilled:</p><p><strong>1. Start lean</strong> — role + task + one or two essentials</p><p><strong>2. Run it</strong> — read the actual LLM output critically</p><p><strong>3. Identify the gap</strong> — what <em>specifically</em> went wrong?</p><p><strong>4. Add one constraint</strong> — the surgical fix for that gap</p><p><strong>5. Repeat</strong></p><p>Three rounds of this will consistently outperform a prompt you spent 30 minutes “perfecting” in one shot.</p><h3>The Takeaway</h3><p>Constraints are a scalpel, not a sledgehammer. Every rule in your prompt should be a response to a <em>real</em> failure you observed — not a precaution against an imagined one.</p><p>Start lean. Iterate. Let the output tell you what’s missing.</p><p>The best prompts aren’t the longest. They’re the ones where every line earned its place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d78387fedb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Have you hugged a tree?]]></title>
            <link>https://medium.com/the-yellow-tent-%EF%B8%8F/have-you-hugged-a-tree-4295839cf982?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/4295839cf982</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[trek-experience]]></category>
            <category><![CDATA[trees]]></category>
            <category><![CDATA[himalayas]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Fri, 23 Apr 2021 19:01:55 GMT</pubDate>
            <atom:updated>2026-04-18T11:15:31.672Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fE0WbG3v_6j6ndMyV83oCA.jpeg" /><figcaption>Picture courtesy: Pratima Chennupati</figcaption></figure><p>Imagine yourself standing inside a dense forest on the slope of the Himalayas, surrounded by gigantic trees, covered in green moss with water droplets glistening on them like tiny diamonds.</p><p>The sun is down behind the mountains and the clouds make you feel like the dementors are lurking nearby.</p><p>I was in this very setting exactly a month ago while on my trek en route Brahmatal. And then submerged in thick silence, I found myself standing next to a giant oak tree, looking up just to find the sky covered by its branches, feeling humbled and moved to the core.</p><p>While I closed my eyes and gently wrapped my arms around it, I could feel something gripping me in as well, I could feel some form of an energy flowing through me, I could feel as if I was part of something larger, much larger than my naive human perceptions can ever fathom — the tree hugged me back!</p><p>The bliss and the gratefulness I felt that day is very difficult to put in words, I could actually feel being part of this planet, part of life and everything beautiful that surrounds us.</p><p>Remember in Kung-fu Panda, when Master Oogway finally hands over the Dragon Scroll (secret to eternal Kung fu mastery) to Po — and then he opens it only to discover that it’s blank, but he sees his own reflection on the parchment? Well, in my case that good old tree turned out to be my Master Oogway 😊, it made me realize that the peace of mind I always sought was right within me.</p><p>My dear old oak tree, I might never see you again. But you’ll always be around me in spirits and I’ll always crawl back to you in times when I feel insignificant in this artificial world! ♥️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4295839cf982" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-yellow-tent-%EF%B8%8F/have-you-hugged-a-tree-4295839cf982">Have you hugged a tree?</a> was originally published in <a href="https://medium.com/the-yellow-tent-%EF%B8%8F">The Yellow Tent 🏕️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It’s 3 am..]]></title>
            <link>https://shiladitya321.medium.com/its-3-am-780033b36097?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/780033b36097</guid>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[poems-on-medium]]></category>
            <category><![CDATA[ramblings]]></category>
            <category><![CDATA[poem]]></category>
            <category><![CDATA[night]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Fri, 02 Oct 2020 21:32:59 GMT</pubDate>
            <atom:updated>2020-10-02T22:25:19.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4LrOSr7PKi61UQvL" /><figcaption>Photo by <a href="https://unsplash.com/@jplenio?utm_source=medium&amp;utm_medium=referral">Johannes Plenio</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Sitting on a rock-cliff</p><p>Endless waves crashing on the shore..</p><p>Life, yes! Always wanted it to be more!</p><p>Does life happen to you?</p><p>What’s life anyway?</p><p>Is it real? Oh wait! What’s reality? I say..</p><p>Perhaps an illusion, a construct in time,</p><p>A web of possibilities created by my choices?</p><p>I may never know! But within me I do hear voices…</p><p>I see a shooting star! Galaxies in my eyes..</p><p>I want to chase the milky-way</p><p>I see a black-hole, yet a supernova shines bright!</p><p>I am that string, caught in this universe!</p><p>Let it go. Let it run free..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=780033b36097" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Coursera Datascience Capstone Project]]></title>
            <link>https://shiladitya321.medium.com/coursera-datascience-capstone-project-5b9345bd149f?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b9345bd149f</guid>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Sun, 16 Aug 2020 10:48:23 GMT</pubDate>
            <atom:updated>2020-08-16T10:48:23.568Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ctwr2jtIowBAUzKc" /><figcaption>Photo by <a href="https://unsplash.com/@nik_owens?utm_source=medium&amp;utm_medium=referral">Nik Owens</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>The IBM data-science professional course on Coursera is focused on enabling someone to get started on their data-science journey. As part of the certificate course one needs to take several smaller courses and make his/her way up to the capstone project — which is the ultimate test to check one’s ability to apply the skills acquired in a real-life scenario.</p><p>For the capstone project we need to define a business problem and work towards creating a data-science driven decision mechanism to take best possible decisions for the same.</p><p>For my capstone project I chose to work on the problem of opening a new Pizza-place in the city of Toronto. The following sections explain the problem as well as the data-science flow in detail.</p><h3>Business Problem</h3><p>Toronto, the capital of the province of Ontario, is the city with the highest population in Canada. The overall demographics of the city is also quite diverse based on different parameters like ethnicity, age-group etc. A food-and-beverage business can always reap profit in such an environment. Although, with varied demographics food choices also vary, but there are certain types of food that have a global appeal and Pizza is most certainly one of them. In this project we will try to find a neighbourhood in Toronto where there is a scarcity of Pizza-places. And suggest to start our business there.</p><p>This project can be beneficial to different types of audience like:</p><ul><li>A business-person planning to open a Pizza-place in Toronto to expand his/her business and needs guidance backed by data on choosing a location</li><li>Data-scientists who wish to explore the neighbourhoods of Toronto to perform exploratory data analysis and tag different neighbourhoods with similar features</li></ul><h3>Data source</h3><p>- Using “List of Postal code of Canada: M” wiki page (<a href="https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M">https://en.wikipedia.org/wiki/List_of_postal_codes_of_Canada:_M</a>) to get all the information about the neighbourhoods present in Toronto. This page has the postal code, borough &amp; the name of all the neighbourhoods present in Toronto.</p><p>- Using “<a href="https://cocl.us/Geospatial_data%E2%80%9D">https://cocl.us/Geospatial_data”</a> csv file to get all the geographical coordinates of the neighbourhoods.</p><p>- To get location and other information about various venues in Toronto the Foursquare’s explore API is used. Foursquare’s explore API (which gives venues recommendations) can be used to fetch details about the venues up present in Toronto and collected their names, categories and locations (latitude and longitude).</p><p>API doc: (<a href="https://developer.foursquare.com/docs)">https://developer.foursquare.com/docs)</a></p><h3>Methodology:</h3><p>First, we need to get the list of neighborhoods in Toronto, Canada. This is possible by extracting the list of neighborhoods from Wikipedia page — as mentioned in the Data-sources section. The web scraping was done by utilizing the Wikipedia library available in Python. This method was adopted as it is easier and more convenient to pull tabular data directly from a Wikipedia-page into a dataframe. However, it is only a list of neighbourhoods names and postal codes. We had to get their coordinates to utilize Foursquare to pull the list of venues near these neighborhoods.</p><p>To get the coordinates, we were supposed to use the Geocoder package but it didn’t seem to work correctly, so I used the csv file provided by IBM team to match the coordinates of Toronto neighborhoods. After gathering all these coordinates, the map of Toronto was visualized using Folium package to verify whether these are correct coordinates. Next, the Foursquare API was used to pull the list of top 100 venues within 600 meters radius. A Foursquare developer account in order to obtain account ID and API key to pull the data.</p><p>The clustering method — k-means clustering was applied on the data. K-means clustering algorithm identifies k number of centeriods, and then allocates every data point to the nearest cluster, while keeping the centroids as small as possible. It is one of the simplest and popular</p><p>unsupervised machine learning algorithms and it is highly suited for this project as well.</p><p>The neighborhoods in Toronto were clustered into 3 clusters based on their frequency of occurrence for pizza-places. The number of clusters were selected based on the silhouette score method. Based on the results (the concentration of clusters), the ideal location for opening a Pizza-place can be suggested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*waXNhmHNnhQpe6k5juiT1Q.png" /><figcaption>Clusters displayed on the map of Toronto</figcaption></figure><h3>Results and Recommendations:</h3><p>After analyzing the data from the clusters, it is clear that the venues in cluster-1 already contains quite a few places tagged as Pizza-place. Hence, to avoid getting into a location already crowded with pizza places, it is recommended to open a new pizza-place in the locations grouped under cluster-1 like i.e borough — “York”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b9345bd149f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When a trek changed my life.. (part-2)]]></title>
            <link>https://medium.com/the-yellow-tent-%EF%B8%8F/when-a-trek-changed-my-life-part-2-90cab5381919?source=rss-43bfb4b0c1f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/90cab5381919</guid>
            <category><![CDATA[mountains]]></category>
            <category><![CDATA[trek]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[valley-of-flower]]></category>
            <category><![CDATA[himalayas]]></category>
            <dc:creator><![CDATA[Shiladitya Ghosh]]></dc:creator>
            <pubDate>Fri, 10 Jul 2020 20:41:30 GMT</pubDate>
            <atom:updated>2026-04-18T11:15:11.319Z</atom:updated>
            <content:encoded><![CDATA[<p>A travelogue of my first ever Himalayan trek to the Valley of Flowers..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kP-t9FWF-M83NRnlMa_Ebw.jpeg" /><figcaption>View on the trail — Govindghat to Ghangria (instagram @shiladitya.tito)</figcaption></figure><p>Hey there! 😃 If you’re reading this article, then you’ve probably already come across the <a href="https://medium.com/@shiladitya321/when-a-trek-changed-my-life-part-1-b70b9f83ca0a">part-1</a> of this series. If not, then I urge you to have a read. There I wrote about the backdrop of this awesome journey and Day-0 of the trek when we reached our basecamp Govindghat from Rishikesh. Thank you for staying with me till here! 😊 Let’s start with Day-1 then..</p><p>Day-1</p><p>It rained quite heavily last night. I could hardly catch any sleep — Kept on getting a mixed feeling about the next day. I was excited to start the trek, but was equally anxious wondering if we’ll be able to trek at all with all the rain around.</p><p>We all woke up early to a very gloomy, foggy and soaking wet morning and it was still drizzling continuously. It was my first time in the mountains during the monsoon season and I most certainly wasn’t familiar with this avatar of the Himalayas. It was so gloomy that it seemed that the dementors were around (potterheads will know 😜).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*as672llPjNVCY9jMqlVhfg.jpeg" /><figcaption>Gloomy morning at Govindghat (by Sudipa — instagram @hemlata_asifa_desouza)</figcaption></figure><p>But for the seasoned trekkers in our group, specially for our trek-leader Abhishek, it seemed like business as usual, while I was still wondering if I’m going to die of pneumonia if I get wet in that cold weather. But everything went ahead as planned in the end — ponchos and rain jackets on, rucksacks loaded — it was time to finally trek!</p><p>This was supposed to be the longest day of the trek in terms of distance covered. Our destination for the day was <a href="https://en.wikipedia.org/wiki/Ghangaria?wprov=sfla1">Ghangria</a>, which is a small settlement located at about 10,000 ft. It primarily serves as a pit stop for the pilgrims heading towards <a href="https://en.wikipedia.org/wiki/Gurudwara_Shri_Hemkund_Sahib?wprov=sfla1">Hemkund Sahib</a>. The total distance to be covered was 11+ kilometers. And it was supposed to take nearly 8 hrs to complete including breaks.</p><p>The mood was quite upbeat all around as we started ascending, but it wasn’t long before the reality struck for the first-timers like me 😛</p><p>Trust me, it’s not a walk in the park when you need to trek in the rain with a 8kg rucksack on your back specially when you’re not used to the altitude. I was totally wet within minutes, not due to the rain, but from the sweat that I worked up within minutes. None the less, the group started ascending slowly. And as we trekked for about an hour it started getting brighter — the clouds gave way and the Sun was shining upon us. Our bodies had also adjusted to the altitude by that time — it was time to enjoy the trail 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-0DUA2-lKG5xPLgF248yA.jpeg" /><figcaption>Trail towards Ghangria (by Adarsh — isntagram: @adash_000)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FaHbRLDy4XJ1uh7Cj5l7JA.jpeg" /><figcaption>Happy us — starting to get along with the trail (by Sankarshan — instagram: @sankarshan.sm)</figcaption></figure><p>The trail from Govindghat to Ghangria is a well defined one and even paved with stones since the same is used by the pilgrims on the way to Hemkund Sahib. But it doesn’t take anything away from the natural beauty that is on offer on this trail. The trail runs alongside a river until it slowly takes you down to the riverbed. Mountains on the other side of the river are covered in thick vegetation and looks particularly stunning against the clear blue skies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HMaEF9G1SVRbYGro9Nx8pA.jpeg" /><figcaption>View on the trail — Govindghat to Ghangria (instagram @shiladitya.tito)</figcaption></figure><p>The halfway mark of the trail was reached when we descended down to the riverbed. By that time we had covered around 6 kilometres and we were hungry as hell from all the trekking. It was time to munch on the delicious <a href="https://en.wikipedia.org/wiki/Aloo_paratha">aloo-parathas</a> that we had packed for lunch in the morning.</p><p>For the next part of the trail you need to cross the river using a makeshift bridge and then you come across stairs!!! Yes, moss-covered stairs going upwards and only upwards into a dense forest. You could tell that it’s going to be daunting to climb these just by looking at it. And it turned out to be just that. There was a point when we had to take breaks after climbing just a couple of flights of stairs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BftKF4-adgr4EWo0NCr7Q.jpeg" /><figcaption>Almost there.. (by Sankarshan — instagram: @sankarshan.sm)</figcaption></figure><p>Thankfully, the stairs again give way to a trail like we had before. At that point we were at about an height of 10,000 ft and the weather started changing again. It started getting cloudy and cold. But you don’t feel any of it while trekking. You actually still sweat!</p><p>None the less, we finally reached Ghangria at around 5 pm which was as per our trek-leader a record for any batch that he has led. It felt awesome! 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*362AmPnf-Nlh_Q5Qhncvew.jpeg" /><figcaption>Reaching Ghangria :) (by Sankarshan — instagram: @sankarshan.sm)</figcaption></figure><p>Ghangria as I told before is a very small settlement and it remains under the snow for six months every year. One unique thing about the valley of flowers trek is that you don’t need to camp outside, rather you stay in proper rooms in a lodge. So we headed towards ours. Once the rooms were allocated everyone had to gather for an ice-breaking session. There were games where we had to remember each others names and like always none could remember or pronounce my name with ease. So I ended up being Shila again 😅</p><p>The next day we were supposed to trek towards the valley of flowers and back. We were briefed on the trail, what to expect, how to prepare etc. At the end it was mentioned that we might have to ditch the trek altogether if it rains heavily overnight as the trail is well-known for falling boulders 😕</p><p>With that we headed to our rooms. I was again sharing the room with Sankarshan. We were happily going through the pics we clicked throughout the day and getting our day-packs ready for tomorrow when we heard a super-loud thundering sound. So loud that it felt like the mountains have cracked. Then there was another one and another and then it started raining like all hell has broken loose. It kept on raining till the time we went to sleep. And it seemed ominous that we weren’t going to the Valley of Flowers tomorrow 😕</p><p>This concludes the Day-1 of the trek! Thank you again if you’ve stayed with me till here. And hope you liked what you read. See you in part-3 of this series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90cab5381919" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-yellow-tent-%EF%B8%8F/when-a-trek-changed-my-life-part-2-90cab5381919">When a trek changed my life.. (part-2)</a> was originally published in <a href="https://medium.com/the-yellow-tent-%EF%B8%8F">The Yellow Tent 🏕️</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>