<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://derekchen14.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://derekchen14.github.io/" rel="alternate" type="text/html" /><updated>2026-07-30T13:23:44-04:00</updated><id>https://derekchen14.github.io/feed.xml</id><title type="html">More Than One Turn</title><subtitle>Blog about AI Agents and Managing Ambiguity</subtitle><entry><title type="html">Meeting Users Where They Are</title><link href="https://derekchen14.github.io/2026/07/02/meeting-users-where-they-are.html" rel="alternate" type="text/html" title="Meeting Users Where They Are" /><published>2026-07-02T00:00:00-04:00</published><updated>2026-07-02T00:00:00-04:00</updated><id>https://derekchen14.github.io/2026/07/02/meeting-users-where-they-are</id><content type="html" xml:base="https://derekchen14.github.io/2026/07/02/meeting-users-where-they-are.html"><![CDATA[<p>What does it mean for AI to be fair? Well, one definition entails making sure predictions do not produce outputs that systematically disadvantage any protected group. Another angle is to look at fairness through the lens of the user. In this sense, AI that is fair and equitable comes down to being equally accessible to people regardless of their background, skin color, gender, and, crucially, skill level.  <em>AI for Everyone</em> means that you don’t have to just be a programmer to gain all the advantages offered by state of the art models. It means your personal assistant works reasonably well even when you would never consider yourself a prompt engineer.</p>

<!--more-->

<p>AI coding agents have hammered the software engineering field harder than when the Hulk smashed Loki around like a rag doll. No one is denying anymore that we are undergoing a seismic shift in how software is built, an earthquake whose magnitude is still growing and whose downstream impacts have yet to be fully realized. At the same time, there have been countless articles about how AI is supposed to take over design, consulting, medicine, law, and journalism.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> Well, 3 years in and radiology still hasn’t disappeared as a profession.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup> And what about every other profession not mentioned? Are they just supposed to wait on the sidelines while everyone else shoots forward?</p>

<p>One might argue that it’s everyone’s individual responsibility to upskill themselves, which is largely true! But with new models coming out literally every week (see GPT-5.5, DeepSeek V4, Gemini 3.5 Flash, Opus 4.8, Microsoft MAI, Fable 5, Kimi K2.7, GLM 5.2, GPT-5.6 Sol, Sonnet 5) <sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup>, and new trends popping up before you can absorb the previous one (see <a href="https://github.com/openai/swarm">swarms</a>, <a href="https://github.com/openclaw/openclaw">OpenClaw</a>, and <a href="https://thenewstack.io/loop-engineering/">loops</a>), is it any wonder that people aren’t really digging the AI revolution?<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> If millions are feeling left behind by AI, can all of it be attributed to user error alone?<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup> Can 55% of workers <em>all</em> be holding it wrong? <sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup></p>

<p>When presented with something ambiguous, a human will ask for clarification. (Equally important, when asked something clear and straightforward, a human will not over-ask either.) Humans come in with their own expectations of what they believe is right, and will behave accordingly. For better or for worse, AI models don’t contain this property. During one session it may vehemently insist it has saved all changes to the file, and upon a refresh, the model now acquiesces on the issue by shamelessly declaring that “you’re absolutely right!” Practically speaking, new technology <em>should</em> adapt to the user, but not like this. Even if AI is conscious, perhaps <em>especially</em> if the technology is conscious, we should expect reliable and trustworthy judgment that holds steady from one session to the next.</p>

<h2 id="recognizing-uncertainty">Recognizing Uncertainty</h2>

<p>It turns out that even recognizing that a user’s request may be ambiguous is actually deceptively difficult.<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup> This is due to several factors which feed into each other.</p>

<h3 id="multiple-levels-of-ambiguity">Multiple Levels of Ambiguity</h3>

<p>The first aspect of complexity is that uncertainty doesn’t arise for just one type of ambiguity. Situations can be ambiguous at multiple layers.<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup> <strong>General</strong> ambiguity occurs when a single utterance can match several intents at once. Given a calendar assistant, “Fix my Thursday” could mean clear the conflicts, decline the invitations, or protect focus time. A single model picks the likeliest reading and commits, sounding certain while the user has no idea whether the actions taken were genuinely correct or just a lucky guess.</p>

<p>With the intent settled, we turn our attention to requests such as “move that meeting” or “invite her” that leave the entity open — which meeting, who is she? This second level of <strong>partial</strong> ambiguity occurs when we roughly know what the user wants, but it’s not clear what person or thing they are referring to. A model will take a shortcut by binding to the most salient candidate and proceeding. The user must audit which meeting was actually moved, defeating the purpose of having the assistant in the first place.</p>

<p>“Reschedule the sync to next week” with no time, or “make it shorter” with no length, leaves a required value blank even when the intent and core entity are known. Under vague instructions, models “arbitrarily generate the missed item,” and a confident hallucination follows <sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup>. Research has shown that underspecified inputs regress accuracy about twice as often as specified ones <sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">10</a></sup>, which can be thought of as <strong>specific</strong> ambiguity.</p>

<p>Finally, we consider a <strong>confirmation</strong> level ambiguity whereby the assistant has some clear candidates in mind, but needs approval on which of the several options is the preferred one. At this point, we’re pretty sure we know what the right answer is, but we just want to make sure. Overall, ambiguity isn’t one problem to solve but four separate layers, and a single request can be unclear at more than one of them at once.</p>

<h3 id="grounding-to-actual-data">Grounding to Actual Data</h3>

<p>Another aspect of ambiguity is that a user’s request is heavily situation dependent. Given a query of “How much money did we make last month?”, the uncertainty depends on what data is available in the database. If there is a column for revenue and a column for date, then we’re in luck! But what if we don’t? Maybe the columns are called ‘Gross Payments’ and ‘Charge Date’? What if the formula for revenue in fact requires 3 different columns summed together? What if accounting wants ‘the last month’ as the last full month, while marketing considers ‘the last month’ as month-to-date?</p>

<p>So far, we’ve also been assuming that we have the right permissions to access the data. What if we know the formula, but we don’t have read-access to that third table which we need to adjust for expenses? Or what if we do have access, but the latest information just hasn’t been populated yet because the servers hit an issue overnight and there’s a backlog of orders to process before we get the final numbers? All this, and we’re still dealing with the same original user request.</p>

<h3 id="lacking-a-theory-of-mind">Lacking a Theory of Mind</h3>

<p>Ultimately, current LLMs fail to recognize ambiguity because they don’t hold a sense of what they expect from the user. Only by establishing their own beliefs can the model recognize when something has deviated from their world view. Furthermore, they also lack a model of the person across from them: what the user already knows, what they want, and what they’ve left unsaid on purpose. What we’re left with then is a system that mistakes its own assumptions for the user’s intent, while treating every instruction as if it were already complete.</p>

<p>Gaining a Theory-of-Mind is far from solved though. While there have been attempts to instill such a capability into AI agents, the most recent findings have merely shown that the apparent skill rides on surface patterns. Models handle the textbook version but break on adversarial variants of the same task.<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">11</a></sup> <sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">12</a></sup>  There are also models that ace the <em>literal</em> task of predicting what someone will do, but that says little about the functional theory-of-mind ability an assistant needs to accomplish real-world tasks.<sup id="fnref:13" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">13</a></sup> As things stand today, reasoning models stay overconfident on ambiguous inputs, and chain-of-thought does not fix their calibration <sup id="fnref:14" role="doc-noteref"><a href="#fn:14" class="footnote" rel="footnote">14</a></sup> <sup id="fnref:15" role="doc-noteref"><a href="#fn:15" class="footnote" rel="footnote">15</a></sup>.</p>

<h2 id="recovering-from-the-unknown">Recovering from the Unknown</h2>

<p>Once we’ve recognized that something doesn’t seem right, the next step is to fix the issue. Given the variety of sources of confusion, there are a corresponding number of techniques that may be deployed.</p>

<p>The core problem with ‘general’ ambiguity is that the agent doesn’t know what the user wants. When a single model makes a prediction, the model may be biased or miscalibrated. Thus, a solution is to measure agreement across a tiered ensemble of voters.<sup id="fnref:16" role="doc-noteref"><a href="#fn:16" class="footnote" rel="footnote">16</a></sup> Disagreement among voters gives an uncertainty signal, while a unanimous reading represents strong confidence. More sophisticated versions can even weight the voters or allow them to abstain. The real effort though is method for quickly and easily enumerate all the possible intents that a user may express, which is now viable, but will be covered in a separate post.<sup id="fnref:17" role="doc-noteref"><a href="#fn:17" class="footnote" rel="footnote">17</a></sup></p>

<p>Moving onto ‘partial’ ambiguity, the agent must be instructed to identify a grounding artifact before proceeding. For a writing assistant, the grounding entity may be a blog post. For a data analysis assistant, the grounding entity may be a table, row or column. For our calendar assistant, this could be a specific calendar event or attendee. An empty entity should force a hard stop, which requires resolving with the user rather than guessing. Because the entity slot is declared and checked, the agent cannot finish a reschedule until it knows which event it is rescheduling.</p>

<p>For ‘specific’ ambiguity and grounding issues, a natural solution is to examine the grounding entity. Concretely, suppose we don’t know if we should use Table A or Table B. Then the assistant can peek at the first 100 rows of each table to see which one seems more relevant. Don’t know which calendar event should be removed? Read the details of the event to decide. Other related techniques include retrieving stored user preferences or previous conversations to see what has already been decided in the past. Strong assistants have memory stored at multiple levels, going far beyond RAG on documents.</p>

<p>The best way around ‘confirmation’ issues is to ask the question. Intelligent questions move from the generic “what time?” into a higher value “10am, 2pm, or 4pm?” where each option comes from actual open spots on the calendar. Given the techniques mentioned above, asking a clarification question is often the last resort, but we shouldn’t hesitate to go there if that’s what it takes to resolve the issue.<sup id="fnref:18" role="doc-noteref"><a href="#fn:18" class="footnote" rel="footnote">18</a></sup> Useful assistants know what to ask, rather than placing the burden on the user to know what to prompt.</p>

<h2 id="full-spectrum-of-accessibility">Full Spectrum of Accessibility</h2>

<p>Ambiguity handling lets a user stay an ops manager or a nurse rather than forcing them to moonlight as a part-time engineer. Today’s agents push the cognitive load of proper communication onto the user: learn to prompt, specify precisely, verify the output. However, the user should be able to receive a good answer without auditing a hidden decision, which is only possible when the model surfaces its reasoning and proactively calls out when a proposed action might be incorrect or carry unforeseen adverse consequences. Without that, AI becomes regressive as it rewards people who already have the skills. A fair system inverts the arrangement so the party with more capacity (the AI agent) carries the heavier burden.</p>

<p>Underspecified language acts as only one pillar of ambiguity though. Context ambiguity is just as real, since a request means nothing without the data and the surroundings it points to, which is why a fair assistant has to perceive the world the way its user does. Multimodal perception is not a bonus feature in that light. A friend of mine had carpal tunnel and couldn’t type for months, and for that whole stretch an assistant that only accepted typed commands may as well not have existed. Bolting a screen reader onto a text interface is not sufficient. To meet people with different vision, hearing, or mobility needs, the model has to work differently from the ground up, treating speech, images, and gestures as first-class input rather than as accommodations tacked on at the end.</p>

<p>Perception runs deeper than the five senses too. How can a model form a real theory of what we want if it can’t tell how we feel? Even with flawless ASR, a system that registers only our words misses most of what we are actually saying. Roughly half of human communication is carried through non-verbal signals like tone, expression, and timing rather than the words themselves. Until an assistant can catch the pause before a reluctant “yes,” the sigh that means “fine, but I’m not happy about it,” or the glance at the clock that means “wrap this up,” it will keep reading politeness as agreement and compliance as consent.</p>

<p>As we expand our definition of fairness, more traditional accessibility gaps come into view. Coverage of low-resource languages is a clear case where models still fall short simply due to the overwhelming English-based training data.<sup id="fnref:19" role="doc-noteref"><a href="#fn:19" class="footnote" rel="footnote">19</a></sup> Because models are billed per token, and low-resource languages splinter into far more tokens per sentence, their speakers are charged several times over for the same request while getting worse answers back<sup id="fnref:20" role="doc-noteref"><a href="#fn:20" class="footnote" rel="footnote">20</a></sup>. At some level, we hope it just stops with poor performance for marginalized communities, but the reality is, unfortunately, outright prejudice.</p>

<p>Even within English, dialect coverage is another area in dire need of attention. Studies have found LLMs judging speakers of African American English more harshly than speakers of other dialects, assigning them less prestigious jobs and stiffer criminal sentences.<sup id="fnref:21" role="doc-noteref"><a href="#fn:21" class="footnote" rel="footnote">21</a></sup> Furthermore, these fears are no longer hypothetical. Audits of AI candidate screening tools have found the same résumé ranked lower when encountering names that are associated with Black or female applicants.<sup id="fnref:22" role="doc-noteref"><a href="#fn:22" class="footnote" rel="footnote">22</a></sup> Consequently, meeting users where they are is not a feature to bolt on once the model is smart enough, but rather what turns a powerful model into one that actually belongs to everyone.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>(Goldman Sachs, 2023) <a href="https://www.forbes.com/sites/jackkelly/2023/03/31/goldman-sachs-predicts-300-million-jobs-will-be-lost-or-degraded-by-artificial-intelligence/">Generative AI could expose 300 million jobs to automation</a>, reported in Forbes. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>(Fortune, 2026) <a href="https://fortune.com/2026/05/04/godfather-of-ai-geoffrey-hinton-radiologists-future-of-work-tech-ai-job-anxiety/">A decade after the ‘Godfather of AI’ said radiologists were obsolete, their salaries are up to $571K and demand is growing fast</a>. Geoffrey Hinton said in 2016 that we should “stop training radiologists”; the profession has grown instead. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>GPT-5.5 (Apr 23), DeepSeek V4 (Apr 24), Gemini 3.5 Flash (May 19), Opus 4.8 (May 28), Microsoft MAI (Jun 2), Fable 5 (Jun 9), Kimi K2.7 (Jun 12), GLM 5.2 (Jun 13), GPT-5.6 Sol (Jun 26), and Sonnet 5 (Jun 30) — ten frontier models within a span of ten weeks, April to June 2026. See the <a href="https://aiflashreport.com/model-releases.html">AI Model Release Timeline 2025–2026</a>. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>(NBC News, 2025) <a href="https://www.nbcnews.com/tech/tech-news/former-google-ceo-booed-graduation-speech-ai-rcna345585">Former Google CEO Eric Schmidt booed during graduation speech about AI</a>. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>(Pew Research Center, 2026) <a href="https://www.pewresearch.org/short-reads/2026/03/12/key-findings-about-how-americans-view-artificial-intelligence/">Key findings about how Americans view artificial intelligence</a>. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>(The Harris Poll for MasterClass, 2025) <a href="https://www.newsweek.com/most-employees-dont-know-how-adopt-ai-survey-2128604">Most Employees Don’t Know How to Adopt AI</a>, Newsweek. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>(Zhang et al., 2024) <a href="https://arxiv.org/abs/2405.12063">CLAMBER: A Benchmark of Identifying and Clarifying Ambiguous Information Needs in Large Language Models</a>, ACL 2024. <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>(Paek and Horvitz, 2000) <a href="https://arxiv.org/abs/1301.3883">Conversation as Action Under Uncertainty</a>, UAI 2000. Models dialogue as breakdowns that can happen at four levels — channel, signal, intention, and conversation. <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p>(Wang et al., 2024) <a href="https://arxiv.org/abs/2409.00557">Learning to Ask: When LLMs Meet Unclear Instruction</a>, 2024. <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10" role="doc-endnote">
      <p>(Yang et al., 2025) <a href="https://arxiv.org/abs/2505.13360">What Prompts Don’t Say: Underspecified Instructions in Code Generation</a>, 2025. <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11" role="doc-endnote">
      <p>(Ullman, 2023) <a href="https://arxiv.org/abs/2302.08399">Large Language Models Fail on Trivial Alterations to Theory-of-Mind Tasks</a>. Small, logically irrelevant edits to a false-belief task flip the model’s answer. <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12" role="doc-endnote">
      <p>(Shapira et al., 2024) <a href="https://arxiv.org/abs/2305.14763">Clever Hans or Neural Theory of Mind? Stress Testing Social Reasoning in Large Language Models</a>, EACL 2024. Apparent theory-of-mind rests on shallow heuristics and breaks on adversarial examples. <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13" role="doc-endnote">
      <p><a href="https://arxiv.org/abs/2412.19726">Position: Theory of Mind Benchmarks are Broken for Large Language Models</a>, ICML 2025. <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14" role="doc-endnote">
      <p>(Mei et al., 2026) <a href="https://arxiv.org/abs/2506.18183">Reasoning about Uncertainty: Do Reasoning Models Know When They Don’t Know?</a>, Findings of EACL 2026. <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15" role="doc-endnote">
      <p><a href="/2026/06/08/how-much-can-you-trust-your-agent.html">How Much Can You Trust Your Agent?</a>, 2026. <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:16" role="doc-endnote">
      <p><a href="/2026/05/18/reliable-agents-from-unreliable-parts.html">Reliable Agents from Unreliable Parts</a>, 2026. <a href="#fnref:16" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:17" role="doc-endnote">
      <p>(Kim et al., 2026) <a href="https://arxiv.org/abs/2602.03429">DiscoverLLM: From Executing Intents to Discovering Them</a>, ICML 2026. <a href="#fnref:17" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:18" role="doc-endnote">
      <p>(Kong et al., 2026) <a href="https://arxiv.org/abs/2603.00656">InfoPO: Information-Driven Policy Optimization for User-Centric Agents</a>, 2026. <a href="#fnref:18" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:19" role="doc-endnote">
      <p><a href="https://arxiv.org/abs/2404.11553">Language Ranker: A Metric for Quantifying LLM Performance Across High and Low-Resource Languages</a>, 2024. <a href="#fnref:19" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:20" role="doc-endnote">
      <p>(Ahia et al., 2023) <a href="https://arxiv.org/abs/2305.13707">Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models</a>, EMNLP 2023. <a href="#fnref:20" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:21" role="doc-endnote">
      <p>(Hofmann et al., 2024) <a href="https://arxiv.org/abs/2403.00742">Dialect prejudice predicts AI decisions about people’s character, employability, and criminality</a>, Nature 633:147–154. <a href="#fnref:21" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:22" role="doc-endnote">
      <p>(Wilson &amp; Caliskan, 2024) <a href="https://arxiv.org/abs/2407.20371">Gender, Race, and Intersectional Bias in Resume Screening via Language Model Retrieval</a>. A résumé-screening model favored White-associated names ~85% of the time and never ranked a Black-male name above an equivalent White-male one. <a href="#fnref:22" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="agents" /><category term="ai" /><category term="ambiguity" /><category term="dialogue" /><category term="explainer" /><category term="trustworthy" /><summary type="html"><![CDATA[What does it mean for AI to be fair? Well, one definition entails making sure predictions do not produce outputs that systematically disadvantage any protected group. Another angle is to look at fairness through the lens of the user. In this sense, AI that is fair and equitable comes down to being equally accessible to people regardless of their background, skin color, gender, and, crucially, skill level. AI for Everyone means that you don’t have to just be a programmer to gain all the advantages offered by state of the art models. It means your personal assistant works reasonably well even when you would never consider yourself a prompt engineer.]]></summary></entry><entry><title type="html">How Much Can You Trust Your Agent?</title><link href="https://derekchen14.github.io/2026/06/08/how-much-can-you-trust-your-agent.html" rel="alternate" type="text/html" title="How Much Can You Trust Your Agent?" /><published>2026-06-08T00:00:00-04:00</published><updated>2026-06-08T00:00:00-04:00</updated><id>https://derekchen14.github.io/2026/06/08/how-much-can-you-trust-your-agent</id><content type="html" xml:base="https://derekchen14.github.io/2026/06/08/how-much-can-you-trust-your-agent.html"><![CDATA[<p>Every company, big or small, currently has a mandate to lean into the AI future and provide <em>some</em> offering around agentic AI. Stripped down to the essentials though, an agent is just a while loop with some tool calls. It can’t be that complicated, right? Given the simplicity, one might expect these agent offerings to be relatively homogenous, sharing roughly the same abstractions under different brand names. After reading through the source code of a dozen-plus agent SDKs, this turns out <em>not</em> to be the case. Every company carries along unique biases and incentives, leading to a proliferation of different philosophies when designing an AI Agent. Choosing the right SDK for your own purposes actually comes down to asking, “How AGI-pilled have you become?”</p>

<!--more-->

<p>Each agent SDK has baked in its own set of assumptions about when and where to trust the underlying model(s) powering its operations. The SDKs which trust the model more tend to stay smaller, giving more free rein. The SDKs that don’t trust the LLM as much tend to be bigger, with more code needed to enforce guardrails. But this isn’t the only difference. Across composition, observability, memory, and a whole host of other dimensions, agents are being built in all sorts of shapes and sizes!</p>

<p>Concretely, the seven specific agent SDKs or harnesses that we studied, in no particular order:</p>
<ul>
  <li><strong>LangGraph</strong> (LangChain): <a href="https://github.com/langchain-ai/langgraph">github.com/langchain-ai/langgraph</a></li>
  <li><strong>Claude Agent SDK</strong> (Anthropic): <a href="https://github.com/anthropics/claude-agent-sdk-python">github.com/anthropics/claude-agent-sdk-python</a></li>
  <li><strong>Google ADK</strong> (Google): <a href="https://github.com/google/adk-python">github.com/google/adk-python</a></li>
  <li><strong>OpenAI Agents SDK</strong> (OpenAI): <a href="https://github.com/openai/openai-agents-python">github.com/openai/openai-agents-python</a></li>
  <li><strong>Pi-mono</strong> (earendil-works): <a href="https://github.com/earendil-works/pi">github.com/earendil-works/pi</a></li>
  <li><strong>OpenCode</strong> (Anomaly): <a href="https://github.com/anomalyco/opencode">github.com/anomalyco/opencode</a></li>
  <li><strong>Cortex Code</strong> (Snowflake): <a href="https://docs.snowflake.com/en/user-guide/cortex-code-agent-sdk/cortex-code-agent-sdk">docs.snowflake.com/cortex-code-agent-sdk</a></li>
</ul>

<p>While many other agent projects were considered, I landed on these 7 due to their popularity and their diversity of opinion. In other words, each one is fairly representative of a unique stance in the ecosystem and has reasonable traction within a group of followers. As a bonus, I will also be including a comparison to <a href="https://www.assistantfactory.io">Assistant Factory</a>, which captures my own best practices around building an agent, having been actively focused on this space for nearly a decade.</p>

<p>After weeks poring through thousands of lines of code, it became clear that authors’ beliefs around AI can influence everything from control flow and memory management to error recovery and evaluation. What you actually get when you adopt one of these SDKs is a set of inherited opinions about how much to trust the model in the loop, which end up dictating the capabilities (but also the limitations) of what your agent can accomplish. The next few sections walk through the most interesting insights that emerged as we traced the critical distinctions among the competing options. An appendix is also included to provide a cross-cutting view of the key dimensions.</p>

<h2 id="everyone-has-an-opinion">Everyone Has an Opinion</h2>
<p><em>SDKs are designed to push the vendor’s agenda more than they are to help you build agents</em></p>

<p>Every SDK is shipped by a parent company with a financial reason to ship it, and that reason is rarely a pure love of agents. The foundation-model providers are the easiest group to read, since their SDKs exist to route inference spend back to the parent’s API. While OpenAI ships its Agents SDK with the option to pick other providers, it sets <code class="language-plaintext highlighter-rouge">gpt-5.4-mini</code> by default and only asks for the OpenAI API key to get started.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> The Claude Agent SDK goes further by bundling the Claude Code CLI inside the package such that you’re not even allowed to choose non-Anthropic models.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup> Both agent SDKs also provide numerous methods to allow the agent to loop and reason, which leads to spending more tokens and driving up API costs.</p>

<p>You would think Google ADK belongs with the model providers with Gemini as the driver. While it’s true <code class="language-plaintext highlighter-rouge">gemini-3-flash-preview</code> is the default, with access to some privileged paths<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup>, the real funnel points at the cloud. Much of ADK’s code surface points back to Google Enterprise Agent Platform (prev. Vertex AI), with comparatively little devoted to agent-loop logic. Thus, the main driver is actually to support the hyperscaler business model. Amazon Strands runs the same playbook, instantiating an AWS Bedrock model whenever you do not pass one in and a dozen endpoints meant to hook into AWS services.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> Microsoft’s Agent Framework also follows this pattern, framing its quickstarts and hosted deployment path around Azure AI Foundry while other providers sit in satellite packages.<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup> For the hyperscalers the model is swappable by design, because the product is the cloud spend around the loop rather than the tokens inside it.</p>

<p>The next group is genuinely model-agnostic since their aim is to provide open-source offerings for free, while getting paid in hosting and services. Pi lets you wire any provider behind its small set of built-in tools. OpenCode requires you to declare the provider and model on every call, mildly annoying and exactly the point, since the SDK holds no opinion about whose model you run. Assistant Factory provides a PromptEngineer class which lets you pick the model by changing a single parameter during instantiation. LangGraph likewise treats the model as something you bring, since LangChain makes its money on the paid LangSmith observability product. When nobody upstream profits from your token spend, the defaults stop nudging you.</p>

<p>The final group includes the platform vendors who hardly care which model runs the loop, so long as their platform stays the system of record. Snowflake Cortex is the cleanest case: the agent runs inside Snowflake on Anthropic’s models by default, but its tools run under Snowflake governance, and its traces land in an in-account SQL table, so your data never gets a reason to leave the warehouse. Databricks Mosaic AI makes the same assumption about the lakehouse, building agents over Unity Catalog governance, while ServiceNow’s Now Assist runs its agents natively inside the workflows the Now Platform already owns, and Salesforce Agentforce grounds its Atlas reasoning engine in the CRM records its Data Cloud unifies.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup> Whereas others may care about tokens and compute, this group is focused on data gravity and making sure they remain at the center of it.</p>

<p>One final piece of evidence that the SDKs are not meant to build great agents: the parent companies rarely use the SDKs when launching their own AI agents! OpenAI’s Codex is an independent Rust implementation with no dependency on the Agents SDK.<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup> Google does say ADK powers enterprise products like Agentspace, but its consumer agents and CLI show no public sign of it.<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup> LangChain offers an ‘Ask AI’ agent on their website, but it is powered using a general loop rather than taking advantage of the full set of abstractions offered by LangGraph. Overall, <strong>these SDKs are distribution channels first and engineering artifacts second.</strong> With that said, the engineering does reveal additional insights, which is what we will dive into next.</p>

<h2 id="the-shape-of-intelligence">The Shape of Intelligence</h2>
<p><em>The way context flows through an agent falls into several distinct buckets</em></p>

<p>Given the user utterance, how does information flow within an AI agent to produce a response? Across just eight SDKs, we encounter at least five distinct topologies: deterministic graphs, decentralized swarms, stacks and queues, hub-and-spoke orchestration, and the no-structure loop. None are clear winners since each topology offers its own pros and cons when deciding who tackles the next unit of work and how that information is conveyed. Each shape is also a statement of trust: pre-determined routes display a lack of trust in the model to choose the correct options for itself, while routing during inference implies it can.</p>

<h3 id="sub-agent-composition-and-communication">Sub-agent Composition and Communication</h3>

<p>Google ADK and LangGraph are graph engines. The developer is expected to explicitly wire together a series of nodes and edges, where each node is effectively its own sub-agent. The graph is validated up front, and the topology is fixed at authoring time.<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup> Microsoft Agent Framework also falls under the same bucket, and even uses the same terminology of a <code class="language-plaintext highlighter-rouge">workflow</code> to describe the collection of nodes used to compose the graph. All three execute their policies with Pregel-style super-steps.<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">10</a></sup> Sub-agents communicate through typed, key-addressed state, with downstream nodes reading upstream outputs by name: ADK threads a schema-checked dict, LangGraph gives every channel its own key. These strict data structures hint at the core audience of these tools: enterprise customers who demand strict governance, reproducible execution order, and somewhere to place the blame when something goes wrong.</p>

<p>OpenAI Agents and Assistant Factory let routing happen at runtime, but maintain clear guidelines around how one sub-agent or flow passes authority over to the next. OpenAI runs a decentralized swarm with no central coordinator: each agent is handed other agents as delegation targets, a handoff is a <code class="language-plaintext highlighter-rouge">transfer_to_X()</code> tool call<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">11</a></sup> that moves control wholesale, and the topology becomes whatever chain appears. The handoff payload is a strict JSON schema rather than free text, and the run carries a typed item log, so spontaneity does not cost the swarm its structured state. Assistant Factory composes work as sub-agents on a stack. There is exactly one active Flow on top at any given time, with options to <code class="language-plaintext highlighter-rouge">fallback</code> to other Flows or <code class="language-plaintext highlighter-rouge">stackon</code> to inject additional Flows to run first (especially useful for multi-step planning). A structured belief state including typed slot-value pairs and natural language insights is passed around through a shared session scratchpad.</p>

<p>The Claude Agent SDK, OpenCode, and Snowflake Cortex converge on hub-and-spoke, in which a single orchestrator model farms isolated tasks out to short-lived subagents and decides alone when to do so. Each spoke runs in a fresh context window, sees only the prompt the hub composed, and returns one result. Each sub-agent is effectively just another tool call.<sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">12</a></sup> Communication here is an append-only prose transcript, since the payload a spoke returns is natural-language text the hub must re-read and re-interpret rather than a field it can look up. Nothing but the prompt enforces what a spoke reports back, which makes this a doubly trusting design: the model routes the work and serializes the results in prose, hopefully without losing anything that matters.</p>

<p>Arguably, Pi (not Claude) is the most radical, declining to have any composition structure at all. The core is a single agent running a single loop that streams a message, executes whatever tool calls it requested, appends the results, and repeats.<sup id="fnref:13" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">13</a></sup> There is no data structure to mediate the information flow, no additional scaffolding, and in fact, no sub-agents at all! The design philosophy is to keep everything as minimal as possible. Multi-agent work exists only in forked repos which add them as extensions. The communication story is equally bare: state is a flat message list, and compaction summaries stand in for structure when the window fills. With four default tools (read, bash, edit, write) and little else, Pi bets that a capable model can improvise whatever scaffolding a task requires, the most trusting position in this study.</p>

<style>
  .post-content table td { font-size: 0.85em; }
  @media (min-width: 1000px) {
    .post-content .table-wide {
      width: 130%;
      margin-left: -15%;
    }
  }
</style>

<table>
  <thead>
    <tr>
      <th>Framework</th>
      <th>Topology</th>
      <th>Who picks the next unit of work</th>
      <th>What gets passed along</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Google ADK</strong></td>
      <td>Deterministic graph</td>
      <td>The developer, through edges validated at build time</td>
      <td>Typed state dict with scoped key prefixes</td>
    </tr>
    <tr>
      <td><strong>LangGraph</strong></td>
      <td>Deterministic graph, cycles allowed</td>
      <td>The developer, through conditional edges run in super-steps</td>
      <td>Typed channels, each merged by its own reducer</td>
    </tr>
    <tr>
      <td><strong>OpenAI Agents</strong></td>
      <td>Decentralized swarm</td>
      <td>The model, by emitting <code class="language-plaintext highlighter-rouge">transfer_to_X</code> at runtime</td>
      <td>Strict JSON handoff payload plus a typed item log</td>
    </tr>
    <tr>
      <td><strong>Assistant Factory</strong></td>
      <td>Stack of Flows</td>
      <td>The model ensemble, by pushing and popping Flows</td>
      <td>Typed belief state plus a shared session scratchpad</td>
    </tr>
    <tr>
      <td><strong>Claude Agent SDK</strong></td>
      <td>Hub-and-spoke</td>
      <td>The orchestrator model, by spawning subagents</td>
      <td>Prose results, with a fresh context per spoke</td>
    </tr>
    <tr>
      <td><strong>OpenCode</strong></td>
      <td>Hub-and-spoke</td>
      <td>The primary agent, through a task tool</td>
      <td>Typed envelope wrapping a prose payload</td>
    </tr>
    <tr>
      <td><strong>Cortex Code</strong></td>
      <td>Hub-and-spoke</td>
      <td>The orchestrator model, fenced by data rails</td>
      <td>Markdown and SQL</td>
    </tr>
    <tr>
      <td><strong>Pi</strong></td>
      <td>Single loop</td>
      <td>Nobody, since there are no sub-agents</td>
      <td>A flat message list</td>
    </tr>
  </tbody>
</table>

<p><em>The five topologies at a glance. The middle column is the trust decision and the right column is its consequence, since whoever routes the work also decides how much structure survives the handoff.</em></p>

<h3 id="the-trust-spectrum">The Trust Spectrum</h3>

<p>At the low-trust end, the architecture expands because a deterministic graph cannot exist without supporting machinery. Such SDKs must include a node abstraction with its own lifecycle, a scheduler to decide what fires, and the typed edges, joins, and checkpoints that keep the graph operational. A recursive loop needs none of that, because the call stack is the schedule and the model decides what fires next. This tax has its benefits though: reproducible execution order, durable mid-run resume after a crash, static validation to catch errors early, and explicit semantics for joining parallel work. The platform and cloud vendors decided that we still can’t trust the models enough to meet the stringent requirements of responsible AI by themselves, so they converged on something a bit heavier.</p>

<p>The other end replaces that machinery with the model’s own judgment, which can actually be observed by looking at the code. Normalizing for bundled extras, the agent-loop of a trusting harness like Strands comes to about 5,000 lines, while the equivalent slices of the graph-shaped engines run from just under 11,000 to over 13,000.<sup id="fnref:14" role="doc-noteref"><a href="#fn:14" class="footnote" rel="footnote">14</a></sup> Pi, the Claude Agent SDK, and the OpenAI Agents SDK stay small because a thin loop plus configuration is all that remains once routing is delegated.<sup id="fnref:13:1" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">13</a></sup> These extra lines are composed of extra guardrails, extra validation checks, and extra type checks. Most of the field sits between the poles, and you can approximately place any SDK by weighing its source tree.</p>

<figure>
<svg viewBox="0 0 760 575" width="100%" role="img" aria-label="Scatter plot of trust in the model versus ease of use across eight agent SDKs" font-family="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif">
  <rect x="70" y="30" width="660" height="460" fill="none" stroke="#d5dce4" />
  <line x1="235" y1="30" x2="235" y2="490" stroke="#d5dce4" stroke-dasharray="3 4" />
  <line x1="400" y1="30" x2="400" y2="490" stroke="#d5dce4" stroke-dasharray="3 4" />
  <line x1="565" y1="30" x2="565" y2="490" stroke="#d5dce4" stroke-dasharray="3 4" />
  <line x1="70" y1="375" x2="730" y2="375" stroke="#d5dce4" stroke-dasharray="3 4" />
  <line x1="70" y1="260" x2="730" y2="260" stroke="#d5dce4" stroke-dasharray="3 4" />
  <line x1="70" y1="145" x2="730" y2="145" stroke="#d5dce4" stroke-dasharray="3 4" />
  <text x="60" y="494" text-anchor="end" fill="#5f6b78" font-size="12">1 &middot; none</text>
  <text x="60" y="379" text-anchor="end" fill="#5f6b78" font-size="12">2 &middot; low</text>
  <text x="60" y="264" text-anchor="end" fill="#5f6b78" font-size="12">3 &middot; avg</text>
  <text x="60" y="149" text-anchor="end" fill="#5f6b78" font-size="12">4 &middot; high</text>
  <text x="60" y="34" text-anchor="end" fill="#5f6b78" font-size="12">5 &middot; full</text>
  <text x="70" y="510" text-anchor="middle" fill="#5f6b78" font-size="12">1</text>
  <text x="70" y="524" text-anchor="middle" fill="#5f6b78" font-size="11">dead simple</text>
  <text x="235" y="510" text-anchor="middle" fill="#5f6b78" font-size="12">2</text>
  <text x="235" y="524" text-anchor="middle" fill="#5f6b78" font-size="11">easy</text>
  <text x="400" y="510" text-anchor="middle" fill="#5f6b78" font-size="12">3</text>
  <text x="400" y="524" text-anchor="middle" fill="#5f6b78" font-size="11">average</text>
  <text x="565" y="510" text-anchor="middle" fill="#5f6b78" font-size="12">4</text>
  <text x="565" y="524" text-anchor="middle" fill="#5f6b78" font-size="11">hard</text>
  <text x="730" y="510" text-anchor="middle" fill="#5f6b78" font-size="12">5</text>
  <text x="730" y="524" text-anchor="middle" fill="#5f6b78" font-size="11">steep curve</text>
  <text x="400" y="552" text-anchor="middle" fill="#1e4669" font-size="13" font-weight="600">Ease of use (effort to get up and running) </text>
  <text x="20" y="260" text-anchor="middle" fill="#1e4669" font-size="13" font-weight="600" transform="rotate(-90 20 260)">Trust (how much model autonomy)</text>
  <circle cx="317.5" cy="30" r="6" fill="#2f6fb3" />
  <text x="327.5" y="34" fill="#2d333b" font-size="13" font-weight="600">Pi</text>
  <circle cx="235" cy="57" r="6" fill="#2f6fb3" />
  <text x="245" y="61" fill="#2d333b" font-size="13" font-weight="600">Claude</text>
  <circle cx="152.5" cy="145" r="6" fill="#2f6fb3" />
  <text x="162.5" y="149" fill="#2d333b" font-size="13" font-weight="600">OpenAI</text>
  <circle cx="390" cy="255" r="6" fill="#2f6fb3" />
  <text x="400" y="260" fill="#2d333b" font-size="13" font-weight="600">Snowflake</text>
  <circle cx="400" cy="317.5" r="6" fill="#2f6fb3" />
  <text x="410" y="321.5" fill="#2d333b" font-size="13" font-weight="600">OpenCode</text>
  <circle cx="482.5" cy="375" r="6" fill="#2f6fb3" />
  <text x="492.5" y="379" fill="#2d333b" font-size="13" font-weight="600">Google ADK</text>
  <circle cx="647.5" cy="432.5" r="6" fill="#2f6fb3" />
  <text x="637.5" y="436.5" text-anchor="end" fill="#2d333b" font-size="13" font-weight="600">LangGraph</text>
  <circle cx="482.5" cy="210" r="7" fill="#d6336c" stroke="#ffffff" stroke-width="2" />
  <circle cx="482.5" cy="210" r="11" fill="none" stroke="#d6336c" stroke-opacity="0.45" />
  <text x="496" y="214" fill="#d6336c" font-size="13" font-weight="600">Assistant Factory</text>
</svg>
<figcaption><em>How much each framework trusts the model, plotted against the effort it takes to get running. The points trend along the diagonal because the same scaffolding that constrains the model is what a newcomer has to learn. The empty corners are the real finding, since nobody has decoupled control from onboarding cost.</em></figcaption>
</figure>

<p>Neither end of the spectrum comes for free. Trusting the model means accepting that runs are unrepeatable and that a wrong routing decision leaves no trace beyond a plausible but false transcript explaining itself. Distrusting the model means paying for schemas, validation, and reducers up front, then discovering that the agent cannot properly complete a task because you failed to anticipate an edge case. <strong>Choosing a topology is therefore choosing a failure mode</strong>, which is why this one trust decision impacts so much of the downstream design. What none of the structure addresses is the judgment of the model inside the loop, and that is where every camp, trusting or not, turns out to be exposed.</p>

<h2 id="knowing-when-you-dont-know">Knowing When You Don’t Know</h2>
<p><em>Agents remain as blindly over-confident as the underlying models which power them</em></p>

<p>Real users write under-specified requests, leaving out the time range they mean, the account in question, or the constraint that makes the request sensible. An agent that cannot recognize what it does not know fills those gaps with guesses and proceeds with the confidence of the Dunningest Kruger to ever exist. Coding agents get away with this because their end users are developers who can read the diff, run the tests, and catch a wrong commit within minutes. Outside of this domain though, folks are less technical and less aware of the shortcomings of AI. The output is harder to verify, and a confidently wrong answer can travel far before anyone notices. Recognizing uncertainty turns out to be harder than winning IOI gold medals, which leads to <a href="/2025/08/07/ambiguity-is-the-bottleneck.html">ambiguity as a bottleneck</a> to building useful and reliable AI agents.</p>

<p>Across the seven SDKs, the only equipment for handling an unclear request is a single tool that pauses the run and reaches out to a human. Claude’s <code class="language-plaintext highlighter-rouge">AskUserQuestion</code> and ADK’s <code class="language-plaintext highlighter-rouge">RequestInput</code> are genuine clarification hooks, while LangGraph’s <code class="language-plaintext highlighter-rouge">interrupt</code> is placed by the developer instead of raised by the model, firing only where someone predicted help would be needed. A second family of mechanisms has little to do with ambiguity at all, since OpenCode’s permission events and OpenAI’s tool-approval items gate destructive actions, answering “may I do this” rather than “did I understand this.” Pi ships its question tool only as an example extension, so an agent built on the core cannot ask at all.<sup id="fnref:15" role="doc-noteref"><a href="#fn:15" class="footnote" rel="footnote">15</a></sup></p>

<p>That pause-and-ask design assumes the model can recognize when something is ambiguous, an assumption the research record <em>thoroughly rejects</em>. Xiong and colleagues found verbalized confidence systematically overstated across five widely used models, with proposed mitigations only partially closing the gap and every method struggling on professional-knowledge tasks.<sup id="fnref:16" role="doc-noteref"><a href="#fn:16" class="footnote" rel="footnote">16</a></sup> OpenAI’s GPT-4 technical report showed the pre-trained model was well calibrated until post-training damaged that calibration.<sup id="fnref:17" role="doc-noteref"><a href="#fn:17" class="footnote" rel="footnote">17</a></sup> Mei and colleagues caught reasoning models verbalizing confidence above 85 percent on wrong answers, with deeper chains of thought making the overconfidence <em>worse</em>.<sup id="fnref:18" role="doc-noteref"><a href="#fn:18" class="footnote" rel="footnote">18</a></sup> Apple’s Illusion of Thinking study watched frontier reasoning models collapse to zero accuracy as puzzle complexity grew, spending <em>fewer</em> tokens on harder instances.<sup id="fnref:19" role="doc-noteref"><a href="#fn:19" class="footnote" rel="footnote">19</a></sup> The finding extends to tool use: evidence-gathering tools like web search induce extra overconfidence in agents, while verification tools such as code interpreters ground it.<sup id="fnref:20" role="doc-noteref"><a href="#fn:20" class="footnote" rel="footnote">20</a></sup> As we move towards the state-of-the-art, <strong>the models haven’t improved at recognizing when they don’t know something, instead they’ve only gotten better at hiding it</strong>!</p>

<p>The concession made by the SDKs that models will make mistakes is written into their code. Bounded loops, default turn caps, per-node retries, and permission gates are all budgets for failure, set by people who knew the model would sometimes spin without converging. Every one of those budgets is reactive though, catching the failure only <em>after</em> the wrong action was taken. Nothing intervenes before the loop is caught running for too long to measure whether the model should be taking on the task at all. The result is a generation of agents that sometimes recover from being wrong, but almost never notice they might be wrong in the first place. It’s a great way to burn a lot of tokens though!</p>

<p>Cortex Code makes an attempt at formalizing this issue through its reflection step, where the model reviews its work after each tool call and chooses to clarify, iterate, or finalize. Assistant Factory is the only framework which treats ambiguity as a first-class concern, providing multiple mechanisms to measure uncertainty that do not depend on self-reporting. Sub-agent routing is decided by an ensemble of voting models, offering a confidence score on the routing decision.<sup id="fnref:21" role="doc-noteref"><a href="#fn:21" class="footnote" rel="footnote">21</a></sup> Open-ended requests are grounded to concrete entities like files, tables, or pages to establish shared context before proceeding. And user intents are explicitly tracked so any deviations from the curated world model are flagged immediately. Failing any of these checks triggers a fine-grained ambiguity handler classifying uncertainty into a four-level gradient running from general (the intent is unclear) through partial (the key entity is ungrounded) and specific (a required value is missing) to confirmation (a candidate needs sign-off). All this combined provides the agent with a Theory of Mind to recognize when something doesn’t operate as expected.</p>

<h2 id="anyones-game-to-win">Anyone’s Game to Win</h2>
<p><em>The supporting systems around the agent loop have yet to be standardized</em></p>

<p>Ask the seven SDKs what an agent should remember and you get two incompatible answers. The coding-style harnesses (Claude, OpenCode, Pi, Cortex, and OpenAI’s sandbox layer) keep long-term memory as natural-language markdown files on disk that the agent re-reads on later runs. Markdown memory is lossy but debuggable, editable by hand, and free to design, while typed stores are queryable and hard to corrupt. The orchestration engines go the other way, with LangGraph pairing a per-thread checkpointer with a key-value document store, and Google ADK choosing a typed state object whose key prefixes scope each entry’s lifetime.<sup id="fnref:22" role="doc-noteref"><a href="#fn:22" class="footnote" rel="footnote">22</a></sup> The split is the trust axis again, since markdown memory trusts the model to re-interpret prose correctly every time, while a typed store relies on a schema the developer wrote in advance.</p>

<p>Startups like Letta and Mem0 push this even further by taking the stance that memory deserves to be its own first-party component which merits a place in the dedicated infrastructure layer.<sup id="fnref:23" role="doc-noteref"><a href="#fn:23" class="footnote" rel="footnote">23</a></sup> Natural language search is not enough, and key-value pairs are not enough. Rather, they believe that we should be chunking, indexing, and retrieving just the right documents at just the right time in order to provide the appropriate context to the agent. The hybrid of exact text match and embedding search arguably gives better semantic matching over grepping through files alone. Regardless of what you believe is the right format for agent memory, the absence of a standard format tells you the field has not figured out what works best.</p>

<p>Telemetry splits along a familiar line, between vendors that tell you what quality means and vendors that hand you spans and wish you luck. Google ADK ships prebuilt scorers for tool trajectories and hallucination, and provides traces that are fully OTel-compatible.<sup id="fnref:24" role="doc-noteref"><a href="#fn:24" class="footnote" rel="footnote">24</a></sup> Cortex Code bundles LLM-as-judge metrics for groundedness, so adopting either means inheriting its definition of a good agent. The rest emit raw signal. OpenAI, Claude, and OpenCode all offer telemetry of their own flavor which are technically compatible with OpenTelemetry, but only because the consortium allows for extensions to be part of the spec. The extremes are occupied by Pi (minimal logging)<sup id="fnref:25" role="doc-noteref"><a href="#fn:25" class="footnote" rel="footnote">25</a></sup> and LangGraph (maximum logging). Perhaps it should come as no surprise that LangGraph has the most opinionated traces because the main revenue driver these days is actually the evaluation suite built into LangSmith.</p>

<p>Memory and telemetry are about as basic as supporting infrastructure gets, and the field disagrees about both at the level of first principles. Nothing here resembles the settled middleware of earlier platform shifts, where a default database or logging stack emerged within a few years, and the absence shows up in practice. I might even venture to say that MCP is up for grabs at this point with minimal support within most SDKs and even less adoption among active developers. At this moment, no incumbent has locked in their advantage and the field is shifting as quickly as ever. This is great news for builders though. Despite the hype, we’re still in the early innings, and the opportunity to build a durable, life-changing company is still open to anyone willing to enter the arena.</p>

<h2 id="closing-thoughts">Closing Thoughts</h2>

<p>The basic description of an agent as a while-loop is accurate (I found a <code class="language-plaintext highlighter-rouge">while</code> functio in every SDK!), but it stops being useful the moment you try to build one. The loop itself is a few dozen lines everywhere, while the code around it ranges from a few thousand lines to over a hundred thousand.<sup id="fnref:26" role="doc-noteref"><a href="#fn:26" class="footnote" rel="footnote">26</a></sup> Everything in that gap is a decision about how far to trust the model, and the same decision echoes through topology, state design, recovery posture, and evaluation. Having gone through this exercise, it is exceedingly clear that agents are designed to serve the vendor’s existing business models rather than signaling a wave of innovative agentic commerce.</p>

<p>The practical advice is to <strong>choose your position on the trust axis before you choose an SDK, because the SDK’s position will override yours.</strong> If your domain lets users verify output quickly, the more trusting harnesses will get you further faster because their failure modes get caught by the people using them. If a wrong answer is expensive or invisible, the graph camp’s reproducibility and reliability machinery is worth its overhead tax, and you should weigh how seriously a candidate SDK treats clarification before trusting it with ambiguous users. There is no right answer yet, and anyone claiming otherwise is selling something.</p>

<p>What exists today is a set of distinct, internally coherent philosophies, each betting on a different trajectory for the models underneath. Not everyone will be a winner because at some point the dust will settle and the wager on the slope of model improvement will pay off. Trust too early and your agent confidently spews garbage, trust too late and you maintain scaffolding the next model generation turns obsolete. Whichever camp you pick, the most important thing is to just start building because if you take two months to make a decision, the field will have moved on without you.</p>

<h2 id="appendix-the-cross-cutting-view">Appendix: The Cross-Cutting View</h2>

<p>The five dimensions of the comparison with one line per framework:</p>

<div class="table-wide">

  <table>
    <thead>
      <tr>
        <th>Framework</th>
        <th>Philosophy</th>
        <th>Composition</th>
        <th>Ambiguity</th>
        <th>Memory</th>
        <th>Observability</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><strong>Claude Agent SDK</strong></td>
        <td>Thin wrapper, model owns the loop</td>
        <td>Hub-and-spoke subagents</td>
        <td>Model-initiated <code class="language-plaintext highlighter-rouge">AskUserQuestion</code></td>
        <td>Markdown files plus JSONL transcript</td>
        <td>Per-turn cost and usage, no scorers</td>
      </tr>
      <tr>
        <td><strong>OpenAI Agents</strong></td>
        <td>Minimal scaffolding, model-driven</td>
        <td>Handoffs and agent-as-tool</td>
        <td>Guardrails and approval gates</td>
        <td>Session transcript plus sandbox markdown</td>
        <td>Tracing on by default, no scorers</td>
      </tr>
      <tr>
        <td><strong>Google ADK</strong></td>
        <td>Build-validated graph</td>
        <td>Explicit nodes and edges</td>
        <td><code class="language-plaintext highlighter-rouge">RequestInput</code> interrupt</td>
        <td>Typed prefixed state plus memory service</td>
        <td>OTel-native plus prebuilt scorers</td>
      </tr>
      <tr>
        <td><strong>LangGraph</strong></td>
        <td>Developer-owned Pregel runtime</td>
        <td>Typed channels and conditional edges</td>
        <td>Developer-placed <code class="language-plaintext highlighter-rouge">interrupt()</code></td>
        <td>Checkpointer plus document store</td>
        <td>Routed to paid LangSmith</td>
      </tr>
      <tr>
        <td><strong>Pi</strong></td>
        <td>One loop, four tools</td>
        <td>None, single agent</td>
        <td>None in core</td>
        <td>Flat transcript plus markdown</td>
        <td>Typed events, no OTel</td>
      </tr>
      <tr>
        <td><strong>OpenCode</strong></td>
        <td>Client/server, explicit wiring</td>
        <td>Primary and subagent modes</td>
        <td>Permission gates</td>
        <td><code class="language-plaintext highlighter-rouge">AGENTS.md</code> plus session history</td>
        <td>Event bus plus per-call cost</td>
      </tr>
      <tr>
        <td><strong>Cortex Code</strong></td>
        <td>Claude-style loop fenced for data</td>
        <td>Markdown subagents plus data tools</td>
        <td>Permission gates plus reflection</td>
        <td>Markdown inside the warehouse</td>
        <td>TruLens judges in-account</td>
      </tr>
      <tr>
        <td><strong>Assistant Factory</strong></td>
        <td>Orchestrator with dynamic sub-agent routing</td>
        <td>Stack of Flows</td>
        <td>Four-level ambiguity gradient</td>
        <td>Three-tier typed cache</td>
        <td>Signal envelopes plus three-level evals</td>
      </tr>
    </tbody>
  </table>

</div>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p><code class="language-plaintext highlighter-rouge">get_default_model()</code> falls back to <code class="language-plaintext highlighter-rouge">"gpt-5.4-mini"</code> unless an environment variable overrides it: <a href="https://github.com/openai/openai-agents-python/blob/5a3028f37c74/src/agents/models/default_models.py#L99"><code class="language-plaintext highlighter-rouge">agents/models/default_models.py:99</code></a>. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>“The Claude Code CLI is automatically bundled with the package” (<a href="https://github.com/anthropics/claude-agent-sdk-python/blob/3f50b5eb8374/README.md">README</a>), located at startup by <code class="language-plaintext highlighter-rouge">_find_bundled_cli()</code>: <a href="https://github.com/anthropics/claude-agent-sdk-python/blob/3f50b5eb8374/src/claude_agent_sdk/_internal/transport/subprocess_cli.py#L114"><code class="language-plaintext highlighter-rouge">subprocess_cli.py:114</code></a>. There are ways to hack around this to use open source models (ie. DeepSeek) as the driver, but this is clearly not intended or allowed. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p><code class="language-plaintext highlighter-rouge">DEFAULT_MODEL: ClassVar[str] = 'gemini-3-flash-preview'</code>: <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/agents/llm_agent.py#L201"><code class="language-plaintext highlighter-rouge">agents/llm_agent.py:201</code></a>. The same core package bundles a 21K-line CLI, an 11.6K-line eval harness, and 158 tool files; 132,900 lines across 610 files in total. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p><code class="language-plaintext highlighter-rouge">self.model = BedrockModel() if not model else ...</code>: <a href="https://github.com/strands-agents/sdk-python/blob/ca9569dbabdf/strands-py/src/strands/agent/agent.py#L258"><code class="language-plaintext highlighter-rouge">strands/agent/agent.py:258</code></a>. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>Provider integrations ship as sub-packages of the core <a href="https://github.com/microsoft/agent-framework"><code class="language-plaintext highlighter-rouge">agent-framework</code></a> package, while the managed deployment path runs through <a href="https://learn.microsoft.com/en-us/azure/foundry/agents/overview">Azure AI Foundry Agent Service</a>. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>Snowflake: <a href="https://docs.snowflake.com/en/user-guide/cortex-code-agent-sdk/cortex-code-agent-sdk">Cortex Code Agent SDK docs</a>. Databricks: <a href="https://www.databricks.com/blog/governing-ai-agents-scale-unity-catalog">Governing AI agents at scale with Unity Catalog</a>. ServiceNow: <a href="https://docs.servicenow.com/bundle/zurich-intelligent-experiences/page/administer/now-assist-platform/concept/now-assist-landing.html">Now Assist docs</a>. Salesforce: <a href="https://www.salesforce.com/agentforce/what-is-a-reasoning-engine/atlas/">Atlas Reasoning Engine</a> and <a href="https://www.salesforce.com/news/stories/how-data-cloud-powers-agentforce/">Data Cloud</a>. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>The <a href="https://github.com/openai/codex">Codex repository</a> is 96 percent Rust per GitHub’s language breakdown, with no dependency on the Agents SDK (which ships only in Python and TypeScript). <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>“ADK is the same framework powering agents within Google products like Agentspace and the Google Customer Engagement Suite (CES)”, per the <a href="https://developers.googleblog.com/en/agent-development-kit-easy-to-build-multi-agent-applications/">ADK launch post</a>. <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p>ADK v2 deprecates <code class="language-plaintext highlighter-rouge">SequentialAgent</code>, <code class="language-plaintext highlighter-rouge">ParallelAgent</code>, and <code class="language-plaintext highlighter-rouge">LoopAgent</code> with the guidance “Please use Workflow instead”: <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/agents/sequential_agent.py#L51"><code class="language-plaintext highlighter-rouge">agents/sequential_agent.py:51</code></a>. The unified graph engine lives in <a href="https://github.com/google/adk-python/tree/03671c63f09c/src/google/adk/workflow"><code class="language-plaintext highlighter-rouge">src/google/adk/workflow/</code></a>. <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10" role="doc-endnote">
      <p>LangGraph’s runtime is literally a class named <code class="language-plaintext highlighter-rouge">Pregel</code>: <a href="https://github.com/langchain-ai/langgraph/blob/f0e814796be5/libs/langgraph/langgraph/pregel/main.py#L449"><code class="language-plaintext highlighter-rouge">pregel/main.py:449</code></a>. MAF’s <code class="language-plaintext highlighter-rouge">Workflow</code> docstring describes “a Pregel-like model, running in supersteps until the graph becomes idle”: <a href="https://github.com/microsoft/agent-framework/blob/3753d938f5c3/python/packages/core/agent_framework/_workflows/_workflow.py#L211"><code class="language-plaintext highlighter-rouge">_workflows/_workflow.py:211</code></a>. ADK scopes its shared state keys with <code class="language-plaintext highlighter-rouge">app:</code> / <code class="language-plaintext highlighter-rouge">user:</code> / <code class="language-plaintext highlighter-rouge">temp:</code> prefixes: <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/sessions/state.py#L64"><code class="language-plaintext highlighter-rouge">sessions/state.py:64</code></a>. <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11" role="doc-endnote">
      <p>Handoff tool names are generated as <code class="language-plaintext highlighter-rouge">transfer_to_{agent.name}</code>: <a href="https://github.com/openai/openai-agents-python/blob/5a3028f37c74/src/agents/handoffs/__init__.py#L173"><code class="language-plaintext highlighter-rouge">handoffs/__init__.py:173</code></a>. <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12" role="doc-endnote">
      <p>Claude subagents are declared as a flat dict of <code class="language-plaintext highlighter-rouge">AgentDefinition</code>: <a href="https://github.com/anthropics/claude-agent-sdk-python/blob/3f50b5eb8374/src/claude_agent_sdk/types.py#L83"><code class="language-plaintext highlighter-rouge">types.py:83</code></a>. OpenCode agents carry a <code class="language-plaintext highlighter-rouge">mode</code> of <code class="language-plaintext highlighter-rouge">"subagent"</code>, <code class="language-plaintext highlighter-rouge">"primary"</code>, or <code class="language-plaintext highlighter-rouge">"all"</code>: <a href="https://github.com/anomalyco/opencode/blob/f43b0d3afd80/packages/opencode/src/agent/agent.ts#L38"><code class="language-plaintext highlighter-rouge">agent/agent.ts:38</code></a>. <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13" role="doc-endnote">
      <p>Pi’s loop is <code class="language-plaintext highlighter-rouge">runLoop</code>, an outer <code class="language-plaintext highlighter-rouge">while (true)</code> that streams one assistant message per pass: <a href="https://github.com/earendil-works/pi/blob/406a2214aa1d/packages/agent/src/agent-loop.ts#L155"><code class="language-plaintext highlighter-rouge">agent-loop.ts:155</code></a>. The Claude Agent SDK contains no loop of its own; the loop ships inside the bundled CLI. <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:13:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a></p>
    </li>
    <li id="fn:14" role="doc-endnote">
      <p>Normalization slices: Strands <code class="language-plaintext highlighter-rouge">agent/</code> + <code class="language-plaintext highlighter-rouge">event_loop/</code> (18 files, 5,044 LOC); MAF <code class="language-plaintext highlighter-rouge">_agents</code> + <code class="language-plaintext highlighter-rouge">_tools</code> + <code class="language-plaintext highlighter-rouge">_clients</code> + <code class="language-plaintext highlighter-rouge">_middleware</code> + <code class="language-plaintext highlighter-rouge">_types</code> (10,855 LOC); ADK <code class="language-plaintext highlighter-rouge">agents/</code> + <code class="language-plaintext highlighter-rouge">flows/</code> (52 files, 13,313 LOC). Graph subsystems: Strands fits in one file, <a href="https://github.com/strands-agents/sdk-python/blob/ca9569dbabdf/strands-py/src/strands/multiagent/graph.py"><code class="language-plaintext highlighter-rouge">multiagent/graph.py</code></a> (1,299 lines); ADK’s <code class="language-plaintext highlighter-rouge">workflow/</code> is 26 files and 5,720 lines; MAF’s <code class="language-plaintext highlighter-rouge">_workflows/</code> is 27 files and 12,845 lines. Counted at the June 2026 head of each repo. <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15" role="doc-endnote">
      <p>Claude Code’s <code class="language-plaintext highlighter-rouge">AskUserQuestion</code> is a tool of the CLI (<a href="https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md">changelog</a>); ADK ships <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/tools/_request_input_tool.py"><code class="language-plaintext highlighter-rouge">tools/_request_input_tool.py</code></a>; LangGraph’s <code class="language-plaintext highlighter-rouge">interrupt()</code>: <a href="https://github.com/langchain-ai/langgraph/blob/f0e814796be5/libs/langgraph/langgraph/types.py#L811"><code class="language-plaintext highlighter-rouge">types.py:811</code></a>; OpenCode’s <code class="language-plaintext highlighter-rouge">permission.asked</code> event: <a href="https://github.com/anomalyco/opencode/blob/f43b0d3afd80/packages/opencode/src/permission/index.ts#L12"><code class="language-plaintext highlighter-rouge">permission/index.ts:12</code></a>; OpenAI’s <code class="language-plaintext highlighter-rouge">ToolApprovalItem</code>: <a href="https://github.com/openai/openai-agents-python/blob/5a3028f37c74/src/agents/items.py#L502"><code class="language-plaintext highlighter-rouge">items.py:502</code></a>. <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:16" role="doc-endnote">
      <p>(Xiong et al., 2024) <a href="https://arxiv.org/abs/2306.13063">Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMs</a>, ICLR 2024. <a href="#fnref:16" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:17" role="doc-endnote">
      <p>(OpenAI, 2023) <a href="https://arxiv.org/abs/2303.08774">GPT-4 Technical Report</a>; see the MMLU calibration plots comparing the pre-trained and post-trained models. <a href="#fnref:17" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:18" role="doc-endnote">
      <p>(Mei et al., 2025) <a href="https://arxiv.org/abs/2506.18183">Reasoning about Uncertainty: Do Reasoning Models Know When They Don’t Know?</a> <a href="#fnref:18" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:19" role="doc-endnote">
      <p>(Shojaee et al., 2025) <a href="https://machinelearning.apple.com/research/illusion-of-thinking">The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity</a>, Apple Machine Learning Research. <a href="#fnref:19" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:20" role="doc-endnote">
      <p>(Xuan et al., 2026) <a href="https://arxiv.org/abs/2601.07264">The Confidence Dichotomy: Analyzing and Mitigating Miscalibration in Tool-Use Agents</a> <a href="#fnref:20" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:21" role="doc-endnote">
      <p>From Assistant Factory’s internal evals on flow-detection benchmarks: routing by an ensemble of three models voting outperformed single-model routing by 12%. <a href="#fnref:21" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:22" role="doc-endnote">
      <p>LangGraph’s <code class="language-plaintext highlighter-rouge">BaseCheckpointSaver</code>: <a href="https://github.com/langchain-ai/langgraph/blob/f0e814796be5/libs/checkpoint/langgraph/checkpoint/base/__init__.py#L176"><code class="language-plaintext highlighter-rouge">checkpoint/base/__init__.py:176</code></a> and <code class="language-plaintext highlighter-rouge">BaseStore</code>: <a href="https://github.com/langchain-ai/langgraph/blob/f0e814796be5/libs/checkpoint/langgraph/store/base/__init__.py#L700"><code class="language-plaintext highlighter-rouge">store/base/__init__.py:700</code></a>; ADK’s prefix-scoped state: <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/sessions/state.py#L64"><code class="language-plaintext highlighter-rouge">sessions/state.py:64</code></a>. <a href="#fnref:22" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:23" role="doc-endnote">
      <p>Mem0 calls itself a “universal memory layer for AI agents” (<a href="https://github.com/mem0ai/mem0">github.com/mem0ai/mem0</a>, <a href="https://arxiv.org/abs/2504.19413">Chhikara et al., 2025</a>); Letta is the company behind MemGPT (<a href="https://arxiv.org/abs/2310.08560">Packer et al., 2023</a>). <a href="#fnref:23" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:24" role="doc-endnote">
      <p><code class="language-plaintext highlighter-rouge">PrebuiltMetrics</code>: <a href="https://github.com/google/adk-python/blob/03671c63f09c/src/google/adk/evaluation/eval_metrics.py#L43"><code class="language-plaintext highlighter-rouge">evaluation/eval_metrics.py:43</code></a>; OpenTelemetry instrumentation: <a href="https://github.com/google/adk-python/tree/03671c63f09c/src/google/adk/telemetry"><code class="language-plaintext highlighter-rouge">src/google/adk/telemetry/</code></a>. <a href="#fnref:24" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:25" role="doc-endnote">
      <p>Pi’s <a href="https://github.com/earendil-works/pi/blob/406a2214aa1d/packages/agent/docs/observability.md"><code class="language-plaintext highlighter-rouge">observability.md</code></a> states the goal: observable “without depending on OpenTelemetry, Sentry,” via a typed <code class="language-plaintext highlighter-rouge">AgentEvent</code> stream. <a href="#fnref:25" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:26" role="doc-endnote">
      <p>MAF caps model round-trips at <code class="language-plaintext highlighter-rouge">DEFAULT_MAX_ITERATIONS = 40</code>: <a href="https://github.com/microsoft/agent-framework/blob/3753d938f5c3/python/packages/core/agent_framework/_tools.py#L90"><code class="language-plaintext highlighter-rouge">_tools.py:90</code></a>. Strands’ loop is the recursive <code class="language-plaintext highlighter-rouge">recurse_event_loop</code>: <a href="https://github.com/strands-agents/sdk-python/blob/ca9569dbabdf/strands-py/src/strands/event_loop/event_loop.py#L400"><code class="language-plaintext highlighter-rouge">event_loop/event_loop.py:400</code></a>. The ADK core package is 132,900 lines across 610 files. <a href="#fnref:26" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="agents" /><category term="ai" /><category term="ambiguity" /><category term="explainer" /><category term="trends" /><category term="trustworthy" /><summary type="html"><![CDATA[Every company, big or small, currently has a mandate to lean into the AI future and provide some offering around agentic AI. Stripped down to the essentials though, an agent is just a while loop with some tool calls. It can’t be that complicated, right? Given the simplicity, one might expect these agent offerings to be relatively homogenous, sharing roughly the same abstractions under different brand names. After reading through the source code of a dozen-plus agent SDKs, this turns out not to be the case. Every company carries along unique biases and incentives, leading to a proliferation of different philosophies when designing an AI Agent. Choosing the right SDK for your own purposes actually comes down to asking, “How AGI-pilled have you become?”]]></summary></entry><entry><title type="html">Mathematicians and Fruit</title><link href="https://derekchen14.github.io/2026/05/24/mathematicians-and-fruit.html" rel="alternate" type="text/html" title="Mathematicians and Fruit" /><published>2026-05-24T00:00:00-04:00</published><updated>2026-05-24T00:00:00-04:00</updated><id>https://derekchen14.github.io/2026/05/24/mathematicians-and-fruit</id><content type="html" xml:base="https://derekchen14.github.io/2026/05/24/mathematicians-and-fruit.html"><![CDATA[<p>A modern LLM recently disproved an Erdős conjecture which specialists previously had been unable to crack despite decades of human effort.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> Mathematicians around the world sat in awe as their careers flashed before their eyes, wondering if their job might be the next one to be taken down by AI. Interestingly, that same model still struggles when asked how many times the letter <code class="language-plaintext highlighter-rouge">r</code> appears in the word “strawberries” – sometimes telling you there are ‘two’ with full confidence.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup> Models which have been RLHF’ed to death have learned to always say ‘three’. In that case, you can ask for the number of <code class="language-plaintext highlighter-rouge">r</code>s in ‘blueberry’, and it will continue to (incorrectly) return ‘three’. Training with more parameters, more data, or more layers does not fix this. If anything, the failure mode tends to become worse as the souped up model simply wraps more elegant prose around the answer without actually changing its stance.<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup></p>

<!--more-->

<p>The failure is structural rather than incidental because the LLM architecture has no means to perform the appropriate kind of computation for the question being asked. In the specific case of letter counting, the technical reason has to do with tokenization, but the detail matters less than the broader pattern though since the solution here is to wrap the model in a harness that contains access to a calculator. The real issue is when the mismatch between the model’s skills and the demands of the real world cannot be solved by simply handing a tool to the agent.</p>

<p>These systems were not trained to think for themselves in any rigorous sense. The apparent reasoning we observe is largely an emergent property that mimics reasoning rather than performs it.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> Shojaee and colleagues showed that Claude 3.7, DeepSeek-R1, and o3-mini all dropped to zero accuracy on Tower of Hanoi once the puzzle exceeded roughly eight disks, and the models actually spent fewer reasoning tokens as the problems grew harder even with budget remaining.<sup id="fnref:4:1" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> On one reading, the fact that this works at all is genuinely magical. On the other hand, the magic itself is what should worry us, since we have no settled account of why it works or when it will break on any given query. A system that is confidently wrong counting letters is also the system being sold as the foundation of AGI. Given the billions of real dollars being poured in, shouldn’t such outsized claims deserve a bit more scrutiny?</p>

<h2 id="the-jagged-frontier-of-ai">The Jagged Frontier of AI</h2>

<p>At first glance, the growth of AI looks phenomenal. Frontier models have effectively saturated MMLU and SWE-bench, with the leaderboards bunched together in the high eighties and low nineties, while GPQA still offers some discrimination between models at the top.<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup> ARC-AGI-2 scores climbed from 0% at the March 2025 launch to past 85% on frontier systems by April 2026, surpassing the threshold François Chollet originally proposed when he introduced the benchmark.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup> Let’s not forget about METR’s benchmark which found that the task length which can be independently handled has been doubling roughly every seven months over the last six years.<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup> All these results portend an AGI future that is right around the corner.</p>

<p>Upon inspection though, we notice widespread benchmark contamination, with GPT-4 exposed to roughly 4.7 million samples across 263 benchmarks during their first year of release alone.<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup> When models were exposed to answers during training, leaderboards measure memorization more than generalization. ARC-AGI tasks are about moving around in a grid world, which bear no resemblance to the work agents actually need to do in production. ARC-AGI-3 continues on this toy-task trend.<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup> The caveat with the METR result is that the tasks must be operated at <em>fifty percent</em> reliability. Can you imagine deploying any app or service which only does the right thing 50% of the time?! At eighty percent reliability the time horizon is much shorter, and the doubling curve is considerably less flattering. A separate randomized trial from METR also found that a group of test subjects consistently predicted speed-ups with AI tooling around 20%, when in fact their progress had <em>slowed down</em> by that amount! This cuts against the narrative, so it didn’t make quite the splash that the other results did.<sup id="fnref:14" role="doc-noteref"><a href="#fn:14" class="footnote" rel="footnote">10</a></sup></p>

<p>AI capability is sharply uneven across tasks that look superficially similar. The picture worth holding in mind is a map rather than a single number on a leaderboard. Some regions sit above sea level as islands of competence, where the model performs at expert human level or better. Other regions sit underwater, where the same model fails at tasks a child could solve. The coastline between the two is irregular and impossible to predict from first principles, which is the unevenness the jagged frontier conveys. The islands surfacing in random order break conventional wisdom which predicts that harder problems must follow behind easier ones. At the moment, islands get demoed during the sales call, but real user requests in production often end up appearing below sea level.</p>

<p>The amount of money flowing into AI data centers and other infrastructure is enough to rebuild the entire US interstate highway system, and they largely rest on the assumption that the underwater regions will surface into islands in just a few years. Companies are cutting jobs with explicit reference to AI as the cause and to the spending it has unlocked.<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">11</a></sup> MIT’s State of AI in Business report tracked hundreds of enterprise deployments, and found that 95% of Gen AI pilots delivered no measurable profit-and-loss impact, against an enterprise AI spend that the same report estimated at $30 to $40 billion.<sup id="fnref:15" role="doc-noteref"><a href="#fn:15" class="footnote" rel="footnote">12</a></sup> Real money is being spent and real jobs cut for a return that the most rigorous measurement available cannot yet find.</p>

<h2 id="are-you-thinking-what-im-thinking">Are You Thinking What I’m Thinking?</h2>

<p>Researchers tracking the structural limits of current systems point to two architectural capabilities that LLMs lack and that scaling alone will not deliver. The first is Theory of Mind, the ability to reason about the user’s beliefs and intentions as distinct from one’s own. The standard test is the Sally-Anne false belief task, where Sally puts a marble in a basket, leaves the room, and Anne moves it to a box; the question is where Sally will look when she returns. Children pass this task around age four. On ToMBench, an evaluation framework of eight tasks covering thirty-one social cognition abilities, even GPT-4 lags adult human performance by more than ten percentage points,<sup id="fnref:16" role="doc-noteref"><a href="#fn:16" class="footnote" rel="footnote">13</a></sup> and Ullman’s variations show that models which pass the classic formulation often fail when minor surface details are changed, which is the signature of pattern matching rather than the underlying capability.<sup id="fnref:17" role="doc-noteref"><a href="#fn:17" class="footnote" rel="footnote">14</a></sup></p>

<p>Separate from tracking a belief about the user is the importance of tracking a belief about the self. At the current moment, this concept is referred to as a ‘world model’: a persistent internal representation of how the environment behaves. This state is distinct from the context window, and the agent can use this to query, update, or plan about future actions. Yann LeCun has spent several years arguing that autoregressive token prediction cannot get there, captured in his line “we need world models, not word predictors”.<sup id="fnref:18" role="doc-noteref"><a href="#fn:18" class="footnote" rel="footnote">15</a></sup> His current efforts at AMI Labs are betting on the claim that current architectures cannot get to AGI no matter how much compute they consume.<sup id="fnref:19" role="doc-noteref"><a href="#fn:19" class="footnote" rel="footnote">16</a></sup></p>

<p>Catastrophic forgetting wouldn’t be such a big deal if we could throw everything into the context window, but the measurements here aren’t reassuring. Studies of effective context length find that frontier models often use only a fraction of their advertised window before performance collapses, with accuracy dropping by 30%+ for long prompts. Effective context length on hard tasks is even worse.<sup id="fnref:20" role="doc-noteref"><a href="#fn:20" class="footnote" rel="footnote">17</a></sup> While the current hype cycle is on agent while-loops and token-maxxing<sup id="fnref:21" role="doc-noteref"><a href="#fn:21" class="footnote" rel="footnote">18</a></sup>, the system being sold remains the same autoregressive predictor underneath, with scaffolding standing in for a shiny, new architecture. An LLM that fails at understanding users, understanding itself, and fails to learn will not generalize any more than a sufficiently advanced autocomplete.</p>

<h2 id="the-show-must-go-on">The Show Must Go On</h2>

<p>Model labs, hyperscalers, and analysts all share an incentive to persist the hype and keep the AGI clock running. The roughly $600 billion in hyperscaler capex committed for 2026 needs a story that justifies it, and the story has to be told until either the spending pays off or the music stops.<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">19</a></sup> Goldman Sachs’s own research shows the infrastructure-stock basket up around 44% YTD against a 9% rise in 2-year forward earnings estimates for the same group. When stock prices are rising nearly 5x faster than the earnings beneath them, you can be sure that the balloon is full of hot air.</p>

<p>The dot-com era promised that the internet would change everything by the turn of the century, and while this did come to fruition, the timeline was closer to 15 years than 15 months. Tesla has loudly proclaimed full self-driving (FSD) autonomy in the next few years … for every year since 2015. The reality in 2026 is geofenced robotaxis operating in a handful of cities.<sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">20</a></sup> Meta renamed the company around the metaverse, sold ~20 million headsets, and then decided to watch the whole business line fade into the sunset as the term barely even registered in recent earnings calls.<sup id="fnref:13" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">21</a></sup> Let’s not even get started on Web3 and crypto. The movie script is the same each time: flashy demo, scale to infinity proposed, capex needed for growth, and then it turns out the narrow case that was shown earlier is the <em>only</em> case that is solved.</p>

<p>Like the World Wide Web before it, Gen AI will produce real and durable gains. ChatGPT is not so much the iPhone moment though as it is the Crack-berry phenomenon.<sup id="fnref:22" role="doc-noteref"><a href="#fn:22" class="footnote" rel="footnote">22</a></sup> We are soon to peak in the middle of all the hype, which means the next step in the cycle is the inevitable trough of disillusionment. By staying grounded about what these systems can actually do, we can benefit through the turbulent period when the bubble decides to give back some of its altitude on the way to the plateau where the real value finally gets built.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p><a href="https://www.scientificamerican.com/article/ai-just-solved-an-80-year-old-erdos-problem-and-mathematicians-are-amazed/">AI Just Solved an 80-Year-Old ‘Erdős Problem,’ and Mathematicians Are Amazed</a>, Scientific American <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p><a href="https://venturebeat.com/ai/the-strawberrry-problem-how-to-overcome-ais-limitations">The ‘strawberry’ problem: How to overcome AI’s limitations</a>, VentureBeat; The standard ‘strawberry’ has been fixed in 2026, but the example above uses ‘strawberries’ instead. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>Especially on complex topics outside your own domain, the model’s answer is given with such confidence that you start to question your own conviction. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>(Shojaee et al., 2025) <a href="https://machinelearning.apple.com/research/illusion-of-thinking">The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity</a>, Apple Machine Learning Research <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:4:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p><a href="https://benchlm.ai/blog/posts/state-of-llm-benchmarks-2026">State of LLM Benchmarks 2026: Rankings, Trends, and What Actually Changed</a>, BenchLM <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>(Chollet et al., 2026) <a href="https://arxiv.org/html/2601.10904v1">ARC Prize 2025: Technical Report</a> <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>(METR, 2025) <a href="https://metr.org/blog/2025-03-19-measuring-ai-ability-to-complete-long-tasks/">Measuring AI Ability to Complete Long Tasks</a> <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>(Balloccu et al., 2024) <a href="https://arxiv.org/pdf/2402.03927">Leak, Cheat, Repeat: Data Contamination and Evaluation Malpractices in Closed-Source LLMs</a> <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p><a href="https://labs.adaline.ai/p/what-is-the-arc-agi-benchmark-and">ARC-AGI In 2026: Why Frontier Models Still Don’t Generalize</a>, Adaline Labs <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14" role="doc-endnote">
      <p>(METR, 2025) <a href="https://arxiv.org/abs/2507.09089">Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity</a> <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10" role="doc-endnote">
      <p><a href="https://www.techspot.com/news/112493-tech-layoffs-pass-100000-2026-tracker-points-ai.html">Tech layoffs have already passed 100,000 in 2026 as the industry cuts jobs to fund AI</a>, TechSpot <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15" role="doc-endnote">
      <p><a href="https://fortune.com/2025/08/18/mit-report-95-percent-generative-ai-pilots-at-companies-failing-cfo/">MIT report: 95% of generative AI pilots at companies are failing</a>, Fortune <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:16" role="doc-endnote">
      <p>(Chen et al., 2024) <a href="https://arxiv.org/abs/2402.15052">ToMBench: Benchmarking Theory of Mind in Large Language Models</a> <a href="#fnref:16" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:17" role="doc-endnote">
      <p><a href="https://arxiv.org/pdf/2406.14737">Dissecting the Ullman Variations with a SCALPEL: Why do LLMs fail at Trivial Alterations to the False Belief Task?</a> <a href="#fnref:17" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:18" role="doc-endnote">
      <p>(LeCun, 2022) <a href="https://openreview.net/pdf?id=BZ5a1r-kVsf">A Path Towards Autonomous Machine Intelligence</a> <a href="#fnref:18" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:19" role="doc-endnote">
      <p><a href="https://futurumgroup.com/insights/yann-lecuns-ami-raises-1bn-seed-round-is-the-world-model-era-finally-here/">Yann LeCun’s AMI Raises $1BN Seed Round, Is the World Model Era Finally Here?</a>, Futurum Group <a href="#fnref:19" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:20" role="doc-endnote">
      <p><a href="https://rewire.it/blog/why-your-llm-only-uses-10-20-percent-of-its-context-window-and-how-titans-fixes-it/">Why Your LLM Only Uses 10-20% of Its Context Window (And How TITANS Fixes It)</a>, rewire.it <a href="#fnref:20" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:21" role="doc-endnote">
      <p><a href="https://www.nature.com/articles/s42256-026-01253-5">Stop ‘tokenmaxxing’ and deploy AI sensibly instead</a>, Nature Machine Intelligence <a href="#fnref:21" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11" role="doc-endnote">
      <p><a href="https://www.goldmansachs.com/insights/articles/tracking-trillions-the-assumptions-shaping-scale-of-the-ai-build-out">Tracking Trillions: The Assumptions Shaping the Scale of the AI Build-Out</a>, Goldman Sachs <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12" role="doc-endnote">
      <p><a href="https://en.wikipedia.org/wiki/List_of_predictions_for_autonomous_Tesla_vehicles_by_Elon_Musk">List of predictions for autonomous Tesla vehicles by Elon Musk</a>, Wikipedia <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13" role="doc-endnote">
      <p><a href="https://www.roadtovr.com/quest-sales-20-million-retention-struggles/">Meta Has Sold Nearly 20 Million Quest Headsets, But Retention Struggles Remain</a>, Road to VR <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:22" role="doc-endnote">
      <p><a href="https://crackberry.com/crackberry-2006-word-year">Crackberry: 2006 Word of the Year</a>, CrackBerry.com. The term captured the addictive peak of BlackBerry adoption a year before the iPhone began the displacement that would erase BlackBerry’s market share over the next several years. <a href="#fnref:22" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="agents" /><category term="ideas" /><category term="ai" /><category term="trends" /><category term="memory" /><summary type="html"><![CDATA[A modern LLM recently disproved an Erdős conjecture which specialists previously had been unable to crack despite decades of human effort.1 Mathematicians around the world sat in awe as their careers flashed before their eyes, wondering if their job might be the next one to be taken down by AI. Interestingly, that same model still struggles when asked how many times the letter r appears in the word “strawberries” – sometimes telling you there are ‘two’ with full confidence.2 Models which have been RLHF’ed to death have learned to always say ‘three’. In that case, you can ask for the number of rs in ‘blueberry’, and it will continue to (incorrectly) return ‘three’. Training with more parameters, more data, or more layers does not fix this. If anything, the failure mode tends to become worse as the souped up model simply wraps more elegant prose around the answer without actually changing its stance.3 AI Just Solved an 80-Year-Old ‘Erdős Problem,’ and Mathematicians Are Amazed, Scientific American &#8617; The ‘strawberry’ problem: How to overcome AI’s limitations, VentureBeat; The standard ‘strawberry’ has been fixed in 2026, but the example above uses ‘strawberries’ instead. &#8617; Especially on complex topics outside your own domain, the model’s answer is given with such confidence that you start to question your own conviction. &#8617;]]></summary></entry><entry><title type="html">Reliable Agents from Unreliable Parts</title><link href="https://derekchen14.github.io/2026/05/18/reliable-agents-from-unreliable-parts.html" rel="alternate" type="text/html" title="Reliable Agents from Unreliable Parts" /><published>2026-05-18T00:00:00-04:00</published><updated>2026-05-18T00:00:00-04:00</updated><id>https://derekchen14.github.io/2026/05/18/reliable-agents-from-unreliable-parts</id><content type="html" xml:base="https://derekchen14.github.io/2026/05/18/reliable-agents-from-unreliable-parts.html"><![CDATA[<p>AI agents live on a jagged frontier where some days entire features are built while you’re on a coffee break, and other days they spin for an hour only to confidently delete a file you explicitly told not to touch. Furthermore, modern agents are composed of many parts, each one expanding the surface area of compounding failure. While a 95%-reliable component sounds fine, chaining ten of them together results in something closer to a coin flip than a finished product. Given such probabilistic components, is it possible to increase the trustworthiness of an agent when each part is so decidedly untrustworthy?</p>

<!--more-->
<p>Naive approaches (ie. eat more tokens, revise the prompt) struggle because per-step gains run into diminishing returns before the agent as a whole becomes reliable. Instead, the solution is structural. While our task may seem daunting, it turns out to be a problem we have solved before. We just need to disconnect ourselves from the software setting.</p>

<p>Organizations must routinely produce output from people who are themselves unreliable. Individual employees get tired, miss details, misunderstand instructions, take vacations, and eventually leave for other jobs, and yet the company as a whole keeps shipping work that customers depend on. When it works, it may seem like magic, but the reality can be pretty mundane. Well-run orgs have accumulated decades of best practices around hiring, workflows, audits, hand-offs, and escalation paths. This same playbook translates surprisingly well to agents built from unpredictable models. Rather than trying to perfect each part, we can engineer the workplace as a whole.</p>

<h2 id="hiring-and-onboarding">Hiring and Onboarding</h2>

<p>Let’s walk through the lifecycle of bringing a single employee (ie. single model) up to speed within an organization.</p>

<h3 id="recruiting">Recruiting</h3>

<p>Companies don’t pin their hopes on a single hire. When a job is critical, they staff multiple people (and possibly even redundant teams) to work on the same project. Having more than one person doing the same thing is somewhat wasteful, but what we lose in headcount efficiency we make up for in fault tolerance. Any individual hire can take a vacation, miss a meeting, or pursue a bad idea. A resilient org must be able to absorb such events to stay productive. Separately, strategic hiring involves recruiting qualified employees at different salary bands who take on varying levels of responsibility. A single project might have junior workers and senior managers, along with a director, and maybe a handful of interns.</p>

<p>Reliable AI agents run multiple instances of the same model on the same input and combine the results through voting, consensus sampling, or ensemble judgment. This same high-level idea drives error-correcting methods such as Hamming codes, where multiple noisy signals are combined to recover a more reliable answer. Concretely, suppose we want to classify the user’s intent for sub-agent routing. We can have 5 models vote rather than relying on a single model, and then combine those votes in an intelligent manner. Applying a weighted voting structure for <a href="https://www.assistantfactory.io">Assistant Factory</a> led to accuracy gains of 15-20% during evaluation. The other half of the hiring decision is choosing the right base model for each role, with frontier models reserved for steps that genuinely require strong reasoning and smaller, faster models used for high-volume routine work. Over-hiring is expensive and under-hiring is unreliable, so the dial worth tuning is which roles deserve the budget and which can turn to a more junior worker.</p>

<h3 id="training">Training</h3>

<p>Even a capable hire performs better as a specialist than as a generalist, and the companies that take employee growth seriously invest here deliberately. Some of this investment is direct, in the form of an onboarding program, whereas some of it is ongoing: stipends for conferences and seminars, internal training guides, time set aside for tinkering or hackathons. The reasoning is simple. Given enough practice in a narrower domain, the same person makes fewer mistakes and recovers faster when something does go wrong. They don’t need to start from scratch for every new task. Dedicated focus compounds in a way that simply providing better instructions never will.</p>

<p>AI models can undergo supervised fine-tuning on domain-specific data, which shapes the model toward the behaviors the role actually demands. Reinforcement learning or preference optimization with task-specific reward signals refines decision-making in ways that context engineering cannot reach, since the weights themselves are changing in response to outcomes. Distillation belongs in this same family, where a frontier model that already performs the role well is compressed into a smaller, faster specialist that runs at a fraction of the cost. The reliability gain from specialization opens access to behaviors the generalist simply cannot produce, which is the kind of return that even sophisticated prompt tuning has no path to matching. Dedicated focus compounds in a way that simply writing better prompts never will.</p>

<h3 id="equipping-for-the-unknown">Equipping for the Unknown</h3>

<p>No training program covers every situation, and even the most thoroughly prepared employee will eventually run into a situation they’ve never seen. The companies that ship reliably under those conditions teach their people what to do when this happens. The skill in question is self-awareness, specifically the ability to recognize the edge of one’s own competence and respond appropriately. An employee who admits when something is unfamiliar, takes the time to look it up, asks a colleague, or escalates to a manager produces more reliable outcomes than one who fills the gap with confident guessing. Organizations that reward this behavior outperform those that punish it, since punishment teaches employees to hide uncertainty when surfacing it would have been the safer move.</p>

<p>The agent translation begins with the model’s ability to recognize uncertainty in its own outputs, through calibration techniques, abstention training, or explicit confidence estimation. Assistants built at Assistant Factory attach a confidence score to every model prediction for exactly this reason. Once ambiguity is detected, the worker has options that look very much like the ones a junior employee would reach for, including spending more compute on the same problem through extended reasoning, looking up documentation through retrieval, handing off to a separate sub-agent better suited to handling the task, or escalating to a manager for clarification (ie. human-in-the-loop). Agent architectures that explicitly handle ambiguity outperform those that assume LLMs can simply handle anything, since ignoring the problem teaches models to fill the gap with confident guessing when surfacing it would have been the safer move.</p>

<h2 id="rules-of-engagement">Rules of Engagement</h2>

<p>Hiring well is only a piece of the reliability equation. Even capable employees benefit from processes that make the right action easy and the wrong action hard to attempt.</p>

<p>Department feedback and 360 Reviews are collected through forms and surveys with consistent fields. Timesheets, expense reports, and bug tickets all use predefined templates so the organization or CRM can process them without worry. Rigid reports eschew free-form responses, but the benefit is that every downstream consumer can rely on it without layers of checks, which removes a substantial class of errors before they ever occur. Structured generation through JSON schemas and typed function calls are a good start. An even better practice is to figure out how two sub-agents engage with each other. While the <a href="https://a2a-protocol.org/latest/">A2A protocol</a> provides a high-level structure, it’s still up to the agent developer to decide what goes into the task or message payload. It <em>does</em> take upfront investment to design this dialogue state: What exactly is the contract that two sub-agent components can expect? But the pay-off is worth it. Guardrails can reject malformed outputs on sight; post-policy hooks can validate artifacts before passing off to the next agent. Problems are resolved before the user even knows they existed.</p>

<p>When the stakes of a single action are high enough, companies require more than one set of eyes before the action can be authorized. Wire transfers above a threshold require sign-off, production deploys require code review, hiring decisions go through a committee, and significant contracts require approval from legal and finance before they are executed. No single moment of poor judgment can bring down the house. The same principle appears in agent design as scoped tool permissions, multi-step authorization flows, and verifier agents that check the work of other agents before any irreversible action is committed. Recognizing the <a href="https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/">lethal trifecta</a> means no single agent should ever simultaneously hold access to private data, untrusted content, and external communication. The defense lives across models, rather than depending on the individual brilliance of any one LLM call.</p>

<p>Beyond single actions, companies also impose structure on sequences of actions. Hiring has a known process (phone screen -&gt; technical interview -&gt; team-fit), customer outreach has a playbook (prospecting -&gt; discovery call -&gt; product demo -&gt; close the sale), and incident response has a runbook (paging on-call -&gt; triage -&gt; mitigation -&gt; postmortem). The reason for enforcing these sequences is that order of operations matters. A technical interview before the phone screen wastes senior eng time on weak candidates; skipping triage produces fixes for the wrong problem. The same idea carries over to agents through deterministic policies and scripted multi-step flows, where the agent advances through well-defined transitions and an LLM is consulted only if its judgment is genuinely needed. A policy that wants to skip a step or move out of order can be denied by the orchestrator, keeping the trajectory predictable even when individual model outputs are not.</p>

<h2 id="standard-operating-procedure">Standard Operating Procedure</h2>

<p>We shouldn’t forget about standard reliability best practices for AI agents, which are all around observability and monitoring. These also align with the organization analogy. Just as well-designed agents are tested thoroughly well before reaching prod, good companies do not assess employees only during end-of-year performance reviews.</p>

<p>Strong managers define metrics tied to the work itself (revenue closed, tickets resolved, code reviews completed, customer satisfaction scores), track those metrics over time, and use the trend lines to decide who gets a raise or who needs more support. Explicit measurement provides crucial information about what is going well and what needs attention. Agents earn the same kind of discipline through evals at three levels of granularity. The narrowest is the individual model prediction, where <strong>model unit tests</strong> measure intent classification accuracy, entity extraction precision, or sub-agent routing decisions. The middle level includes <strong>traces and trajectories</strong>, which captures a full series of decisions across tool calls, retrievals, and intermediate steps within a single task. The widest level is the <strong>E2E agent evaluation</strong> that collapses the intermediate decisions and asks only whether the agent produced the right outcome for the task given the user utterance. Each level catches a different class of failure: unit tests catch regressions on a specific skill, traces catch compounding errors, and end-to-end evals catch agents that fail to satisfy the user request even when every intermediate step looked plausible.</p>

<p>Beyond the periodic review cycle, companies also invest in continuous monitoring through internal audit teams, executive dashboards, weekly business reviews, and exception reports that flag transactions outside the usual pattern. The point is to surface a problem early enough that someone can intervene before it’s too late. Live telemetry plays the same role for an agent: capturing each trajectory of tool-calls, tracking token costs, and storing structured states that make a single bad run reconstructible after the fact. A dashboard that shows cost per session, success rate per workflow, and latency at each step is straightforward to create, but provides critical visibility needed to trust the system enough to leave it running with minimal supervision.</p>

<h2 id="beyond-the-call-of-duty">Beyond the Call of Duty</h2>

<p>Sometimes AI can go Super Saiyan. As the agent leans towards the deterministic side of its neuro-symbolic nature, it remembers that certain pathways can produce the same output every time, without ever making a mistake. Parsing, persistence, validation, retry logic, and tool execution can all follow this pattern. Every step you move from model into code is a step that stops contributing to compounding error probability, and into rock-solid predictability. Code does not have an off day, does not need to be persuaded, and does not need to be recognized with a little awards ceremony at the end of the quarter for their hard work.</p>

<p>Human committees coordinate projects over the course of weeks. Reviewers for a single document schedule meetings, reconcile notes, and haggle over the final wording. An agent can run three independent LLMs-as-judges on the same input in parallel: no scheduling overhead, no inter-reviewer dynamics, and a verdict in seconds. If three models in parallel aren’t enough, we can go with brute force. Finding a specific data point across 25 tables, with 40 columns and 10,000 rows would take months for a human. Exhaustively trying every option is a legitimate technique for an agent swarm. Ten million cells get searched in minutes.</p>

<p>A final advantage is that the environment in which an agent operates is controllable. The most stubborn problem in a company is rarely caused by lack of skill. Politics cause ego-based coalitions, bias toward manager preferences, and distorted news as information is passed along in a drawn-out game of telephone. The cost of this distortion is especially hard to quantify when the people in the meeting don’t even agree on a shared goal. Analogously, agents face context poisoning, where irrelevant documents, contradictory instructions, or adversarially injected content leak into the prompt. But the agent designer holds the lever directly, since retrieval, memory, and explicit validation are all within their control. Agent settings can be configured once and reliably enforced everywhere. If only human co-workers behaved the same!</p>

<hr />

<p>So yes, we <em>can</em> make agents much more reliable in as far as organizations composed of unreliable employees has always been achievable. Neither produces perfection, and neither needs to. Both produce an outcome you can depend on which is what really matters.</p>]]></content><author><name></name></author><category term="agents" /><category term="reliability" /><category term="ai" /><category term="trustworthy" /><category term="product-strategy" /><category term="ideas" /><summary type="html"><![CDATA[AI agents live on a jagged frontier where some days entire features are built while you’re on a coffee break, and other days they spin for an hour only to confidently delete a file you explicitly told not to touch. Furthermore, modern agents are composed of many parts, each one expanding the surface area of compounding failure. While a 95%-reliable component sounds fine, chaining ten of them together results in something closer to a coin flip than a finished product. Given such probabilistic components, is it possible to increase the trustworthiness of an agent when each part is so decidedly untrustworthy?]]></summary></entry><entry><title type="html">Beyond Guardrails: Why Understanding Users Still Matters</title><link href="https://derekchen14.github.io/2026/03/23/beyond-guardrails.html" rel="alternate" type="text/html" title="Beyond Guardrails: Why Understanding Users Still Matters" /><published>2026-03-23T00:00:00-04:00</published><updated>2026-03-23T00:00:00-04:00</updated><id>https://derekchen14.github.io/2026/03/23/beyond-guardrails</id><content type="html" xml:base="https://derekchen14.github.io/2026/03/23/beyond-guardrails.html"><![CDATA[<p>The market for AI agent toolkits in 2026 is booming. LangGraph, CrewAI, Agno, Claude Agent SDK, Google ADK: the list just keeps growing. Whether you want to call it an agent framework, an orchestration engine, or agent harness, they all share a common goal: to make it easy for <em>developers</em> to build agents. They compete on aspects such as the number of tool integrations, how to manage guardrails against prompt injection, and time-to-first-demo. The engineering is undoubtedly impressive. But what about optimizing for the <em>end user</em>? After a deep code review of the leading frameworks, I found a gap that none of them address. What happens when facing requests that are <strong>vague, incomplete, or just plain confusing?</strong></p>

<!--more-->

<p>The popular tools optimize for the happy path: clear input, well-structured requests, cooperative users. But equally important is optimizing for the <em>unhappy</em> path. The reality is that most people won’t learn to prompt, won’t read the documentation, and will probably just bail when the agent gets confused.  A solution to this has been hiding under our nose for years: <strong>Natural Language Understanding</strong> (NLU). This post examines whether taking an explicit NLU approach is a relic of the pre-LLM era or whether it’s solving problems the rest of the industry is ignoring.</p>

<h2 id="trending-ai-agent-architectures">Trending AI Agent Architectures</h2>

<p><strong><a href="https://github.com/langchain-ai/langgraph">LangGraph</a></strong> (by LangChain) is a graph execution engine. You define nodes, edges, and typed state channels. A Pregel-inspired runtime executes nodes in supersteps. Your agent <em>is</em> a state machine. Maximum control over execution topology, but no built-in concept of what the user is trying to do.</p>

<p><strong><a href="https://github.com/crewAIInc/crewAI">CrewAI</a></strong> is a role-based orchestrator. You define agents with role, goal, and backstory, then assign them tasks. A “Crew” runs tasks sequentially or hierarchically. Flows (added later) provide event-driven workflow control. It has the strongest output validation system of the three: guardrails can catch bad agent output and retry automatically. But no input validation or ambiguity detection.</p>

<p><strong><a href="https://github.com/agno-agi/agno">Agno</a></strong> (formerly Phidata) is a batteries-included agent framework. You configure an Agent with a model, tools, knowledge base, memory, and guardrails. It handles the internal ReAct loop. 20+ vector database backends, 100+ built-in tools, and the fastest instantiation benchmarks. But the guardrails are binary (pass or halt) with no retry, no escalation, and no mechanism to ask the user for clarification.</p>

<p><strong><a href="https://github.com/derekchen14/personal_assistants">Assistant Factory</a></strong> (AF) takes a different approach. It models the conversation as a structured prediction problem: classify the user’s intent, detect which workflow (“flow”) to activate, fill typed parameter slots, validate entities, and only then execute. An Ambiguity Handler tracks uncertainty at four graded levels and generates level-appropriate clarification questions. Multi-model ensemble voting produces calibrated confidence scores. Entity repair tries to fix misspelled or malformed values before asking the user to repeat themselves. This implements explicit methods of natural language understanding and traditional conversational AI techniques.</p>

<p>But is AF carrying forward valuable ideas, or is it clinging to an outdated approach like a high school football star reminiscing about the good ole days?</p>

<h2 id="the-case-against-nlu">The Case Against NLU</h2>

<p>AF looks like what happens when a dialogue systems researcher encounters LLMs and says “I’ll use these as components in my existing architecture” instead of asking “does my architecture still make sense?” The entire machinery (slot-filling with inheritance hierarchies, multi-model ensemble voting, four-level ambiguity handlers, flow stacks with lifecycle states) exists to compensate for models that were bad at understanding language. Modern LLMs are not bad at understanding language. In fact, they’re incredible.</p>

<p>Consider the cost. NLU requires running 3 parallel LLM calls just to detect which flow to activate, potentially 3 more for entity repair, plus calls for slot-filling, skill execution, and response naturalization. A single well-prompted agent with tool calling could handle the same request in one or two calls. The multi-model voting buys maybe 2–3 percentage points of accuracy over a single strong model,<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">1</a></sup> at 3× the cost and latency. In 2018, when individual models were 70–80% accurate on intent classification,<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">2</a></sup> ensembles were essential. In 2026, they look like gold-plating.</p>

<p>The slot-filling system is particularly suspect. AF defines 16 typed slot classes with inheritance hierarchies, validation logic, and priority levels. Modern toolkits handle this with a Pydantic model and structured output: the LLM extracts parameters directly into a typed schema. No SourceSlot, no GroupSlot, no distinction between fill-by-label and fill-by-values. It just works.</p>

<p>The ambiguity handler’s four levels seem like over-engineering for a problem that good prompting solves. Tell the LLM “if you’re not sure what the user wants, ask a clarifying question” and it will. You don’t need a stateful component with declare/ask/resolve lifecycle methods.</p>

<p>The flow stack with its lifecycle states (Pending, Active, Completed, Invalid), deduplication, and mid-plan replanning faces the same objection. An LLM with good instructions and conversation history can manage multi-step tasks naturally. It remembers what it was doing. It can course-correct. It doesn’t need a finite state machine to track where it is in a conversation.</p>

<h2 id="is-any-of-that-true">Is Any of That True?</h2>

<p>While some of those criticisms are valid, the core critiques don’t hold up when you look at what actually happens with real users.</p>

<h3 id="llms-have-poorly-calibrated-confidence">LLMs have poorly calibrated confidence</h3>

<p>LLMs are excellent at understanding well-formed requests from cooperative users. They are subtly bad in ways that don’t readily surface in demos.</p>

<p>LLMs don’t just signal confidence. They exude absolute certainty. When an LLM isn’t sure what the user means, it often guesses and proceeds with full apparent confidence. Every once in awhile, it may asks a clarification question, but really only when prompted to do so. There is no downstream signal you can use to decide whether to proceed, clarify, or try a different approach. AF’s multi-model voting produces a real number, and model disagreement is more informative than any single model’s self-reported uncertainty.<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup> This is the only reliable way to get a confidence signal from LLMs, which are notoriously miscalibrated when asked to rate their own certainty.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup><sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup></p>

<p>LLMs fail silently on vague input. Tell an LLM “make it better” and it will produce <em>something</em> without hesitation just to please the user. It won’t tell you it doesn’t know what ‘it’ refers to or what ‘better’ means. It will infer, often incorrectly, yet will go on to produce a reasonable sounding result. AF’s slot-filling catches this structurally: if the “source” slot (which post are we talking about?) isn’t filled, execution doesn’t proceed. The LLM never gets the chance to silently guess wrong. This is not a problem that prompting reliably solves, because the failure mode of prompting is exactly that the LLM follows the instruction to ask for clarification <em>sometimes</em> and silently guesses <em>other times</em>, with no structural guarantee about which behavior you’ll get on any given turn.</p>

<p>LLMs are inconsistent across turns. An LLM with conversation history can usually remember what it was doing. But “usually” isn’t “always,” and the failure mode is catastrophic: the agent suddenly acts as if the previous three turns didn’t happen.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup> AF’s dialogue state, flow stack, and context coordinator provide structural guarantees: the active flow, its filled slots, and the conversation history are explicit state, not implicit in the LLM’s attention pattern over a growing context window.</p>

<h3 id="slot-filling-is-not-the-same-as-structured-output">Slot-filling is not the same as structured output</h3>

<p>The comparison to Pydantic models misses the fundamental distinction. Structured output validates <em>syntax</em>: “topic must be a string, length must be an integer.” AF’s slots validate <em>semantics</em>: “topic must refer to something the user actually mentioned, not something the LLM inferred; the source post must exist in the database.”</p>

<p>But AF’s real aim goes even further than semantics. The architecture is designed to resolve the <em>pragmatics</em> of a conversation, understanding what the user wants beyond what they explicitly stated. When a user says “make the intro punchier,” the semantic content is about modifying an introduction. The pragmatics include: which post’s introduction (resolved via the active entity in the source slot), what “punchier” means for this user (resolved via user preferences in the memory manager), and whether this is a revision to the current draft or a new direction entirely (resolved via the flow stack’s lifecycle state). These are inferences that require grounding to specific entities, memory of user patterns, and awareness of conversational context. This is exactly the machinery NLU provides, which are missing from most frameworks.</p>

<p>A Pydantic model can enforce that <code class="language-plaintext highlighter-rouge">topic</code> is a non-empty string. It cannot enforce that <code class="language-plaintext highlighter-rouge">topic</code> refers to something grounded in the conversation, and it cannot infer what the user <em>meant</em> from what they <em>didn’t say</em>.</p>

<h3 id="just-prompt-the-llm-to-ask-for-clarification">“Just prompt the LLM to ask for clarification”</h3>

<p>Asking the LLM to ask clarifying questions produces three consistent failure modes across every standard agent framework. First, the LLM asks clarifying questions even when the request is clear, irritating the user. Second, it proceeds with vague input when it should clarify, producing wrong results. Third, it generates open-ended “could you tell me more?” when a specific “which of these three posts did you mean?” would resolve the ambiguity in one click.</p>

<p>AF’s four-level ambiguity handler addresses all three. It only fires when confidence is below a threshold (preventing over-asking). It fires structurally when required slots are unfilled (preventing under-asking). And it generates level-appropriate questions: General offers a menu of concrete options, Partial acknowledges what was understood and asks about what wasn’t, Specific requests exactly one missing value, and Confirmation presents the best guess for one-click approval. The <em>shape</em> of the clarification matches the <em>type</em> of the uncertainty.</p>

<h3 id="entity-repair-for-semantic-normalization">Entity repair for semantic normalization</h3>

<p>When a user types “my blgo post about ambiguty” (two typos), modern tools pass this to the LLM, which might or might not correct the spelling, and then to a tool call, which will fail because no post matches. The user sees an error. A properly designed NLU contains a post-hook to try case normalization, then fuzzy string matching (<code class="language-plaintext highlighter-rouge">difflib.get_close_matches</code>), then an LLM call asking “the user said X, valid options are Y: what did they mean?” Only if all three fail does it ask the user. Most typos and misnamings are resolved without the user ever knowing there was a problem.</p>

<p>This is a small feature that produces an outsized UX improvement. Every other toolkit treats the gap between what the user typed and what the system needs as the user’s problem to fix. The Personal Assistant framework treats it as the system’s problem to solve.</p>

<h3 id="where-the-criticism-genuinely-sticks">Where the criticism genuinely sticks</h3>

<p>NLU does carry some real baggage. The POMDP framing (observations, hidden states, belief tracking) adds academic weight to what is, in engineering terms, a straightforward classify → route → execute → respond pipeline. The math isn’t wrong, but nobody is computing belief distributions, so the language obscures more than it clarifies. Some of the slot type hierarchy is over-specified for current needs. And the multi-model voting is the most expensive way to get a confidence signal. A single strong model with a calibrated follow-up call could deliver 80% of the benefit at a third of the cost. But these are trimming problems, not foundation problems. The academic language doesn’t affect the engineering. The extra slot types don’t block progress. These are things you’d simplify over time, not reasons to abandon the architecture.</p>

<hr />

<h2 id="the-verdict">The Verdict</h2>

<p>The popular agent frameworks in 2026 are solving a real problem: making it easy for developers to build agents that call tools, follow workflows, and produce results. They solve it well. If your users are developers, power users, or anyone who can articulate a clear request, these frameworks will serve you.</p>

<p>But there’s a different problem that almost nobody is working on: users who can’t articulate clear requests, who provide half the information, and then contradict themselves. Real users will say ‘fix it’ and expect the agent to know what ‘it’ means without providing any context. For any agent that serves the general public, this <em>is</em> the primary use case. Understanding the user suddenly becomes incredibly difficult, and tackling ambiguity becomes a primary concern, rather than an afterthought.</p>

<p>The 2018-era conversational AI systems (Rasa, Dialogflow, Watson) learned this the hard way and built machinery to handle it: intent classification, slot-filling, dialogue state tracking, conversation repair. Then LLMs arrived, the industry decided that machinery was obsolete, and a new generation of frameworks started from scratch. The issues it solved never went away. The industry just stopped noticing them in favor of newer, shinier problems. They threw out the baby with the bathwater.</p>

<p>AF carries those lessons forward while using modern LLMs as the execution engine. Far from being relics of a weaker era, NLU   provide solutions to problems that LLMs have quietly swept under the rug. When the user is cooperative, the results are identical whether or not you model the user’s intent because easy is easy. But the unhappy path is where the architecture earns its keep. If your goal is to ship a demo or win a hackathon, use any of the popular frameworks. If your goal is to build an agent that ordinary people can actually rely on, then you need the kind of structured understanding that NLU provides.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:2" role="doc-endnote">
      <p>Wang et al. (2023) <a href="https://openreview.net/forum?id=1PL1NIMMrw">Self-Consistency Improves Chain of Thought Reasoning in Language Models</a> — Majority voting across multiple model samples yields modest accuracy gains (1–4 percentage points) over single-sample decoding. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:1" role="doc-endnote">
      <p>Larson et al. (2019) <a href="https://aclanthology.org/D19-1131/">An Evaluation Dataset for Intent Classification and Out-of-Scope Prediction</a> — The CLINC150 benchmark showed models ranging from 75–86% accuracy across 150 intents with out-of-scope detection, representative of the 2018-era difficulty. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>Lakshminarayanan et al. (2017) <a href="https://proceedings.neurips.cc/paper/2017/hash/9ef2ed4b7fd2c810847ffa5fa85bce38-Abstract.html">Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles</a> — Showed that ensemble disagreement produces better-calibrated uncertainty estimates than any single model’s confidence scores. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>Kadavath et al. (2022) <a href="https://arxiv.org/abs/2207.05221">Language Models (Mostly) Know What They Know</a> — Found that LLMs are systematically overconfident on incorrect answers and that self-reported probabilities are poorly calibrated. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>Xiong et al. (2024) <a href="https://openreview.net/forum?id=gjeQKFxFpZ">Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMs</a> — Showed that verbalized confidence from LLMs correlates poorly with actual accuracy, confirming miscalibration in the conversational setting. <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>Liu et al. (2024) <a href="https://aclanthology.org/2024.tacl-1.9/">Lost in the Middle: How Language Models Use Long Contexts</a> — Demonstrated that LLMs degrade at retrieving and reasoning over information positioned in the middle of long contexts, a failure mode that compounds across multi-turn conversations. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="ambiguity" /><category term="dialogue" /><category term="trends" /><category term="ai" /><category term="product-strategy" /><summary type="html"><![CDATA[The market for AI agent toolkits in 2026 is booming. LangGraph, CrewAI, Agno, Claude Agent SDK, Google ADK: the list just keeps growing. Whether you want to call it an agent framework, an orchestration engine, or agent harness, they all share a common goal: to make it easy for developers to build agents. They compete on aspects such as the number of tool integrations, how to manage guardrails against prompt injection, and time-to-first-demo. The engineering is undoubtedly impressive. But what about optimizing for the end user? After a deep code review of the leading frameworks, I found a gap that none of them address. What happens when facing requests that are vague, incomplete, or just plain confusing?]]></summary></entry><entry><title type="html">Ambiguity is the Bottleneck</title><link href="https://derekchen14.github.io/2025/08/07/ambiguity-is-the-bottleneck.html" rel="alternate" type="text/html" title="Ambiguity is the Bottleneck" /><published>2025-08-07T00:00:00-04:00</published><updated>2025-08-07T00:00:00-04:00</updated><id>https://derekchen14.github.io/2025/08/07/ambiguity-is-the-bottleneck</id><content type="html" xml:base="https://derekchen14.github.io/2025/08/07/ambiguity-is-the-bottleneck.html"><![CDATA[<p>The prevailing trend on social media is that AGI is right around the corner, but cracks begin to appear as soon as we consider the type of progress we have made and just how far we have to go to create something useful for <a href="https://derekchen14.substack.com/p/agi-for-the-rest-of-us">most people</a>. Let’s examine the evidence. Many researchers base their super-intelligence <a href="https://ai-2027.com/">timelines</a> on the compounding growth in benchmark progress. But benchmarks aren’t real life. OK, then what about AI systems from <a href="https://deepmind.google/discover/blog/advanced-version-of-gemini-with-deep-think-officially-achieves-gold-medal-standard-at-the-international-mathematical-olympiad/">big</a> (and <a href="https://arxiv.org/abs/2507.15855!">small</a> labs winning IMO gold medals.  Or what about coding agents deployed in production building entire applications in one shot? Surely, these are pretty real right?</p>

<p><!--more--></p>

<p>Before we dive deeper, let’s level set on definitions. My version of AGI is not human-level consciousness or sci-fi superpower, but simply a practically useful AI agent that can complete junior employee tasks from end-to-end. And even then, the idea that we will start to see such agents replacing entire industries in just 1-2 years feels preposterous. This progress we’ve made so far in verifiable domains is genuinely impressive and already impactful<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>, but I would argue that these gains will not generalize to other domains. Concretely, practical intelligence cannot be achieved by just turning a few more knobs or optimizing a few more parameters, but instead requires a different approach which embraces uncertainty by explicitly accounting for and dealing with the intrinsic ambiguity of the real world.</p>

<p>Math and coding have inherent advantages that make them easier to solve. To start, pre-training data is readily available with millions of solved problems, documented algorithms, and open-source repositories to draw from. Additionally, these domains offer verifiable rewards: code either runs or it doesn’t, mathematical proofs are either valid or they aren’t. Perhaps most importantly, the audience is forgiving. Developers and mathematicians are willing to fill in the gaps when the model fails because even partial success can be tremendously helpful. Junior programmers exist (for now) despite their constant mistakes because taking a first stab at larger task still ends up saving time and effort that would otherwise have to be spent by someone more senior.</p>

<p>Dealing with the real world is significantly harder. We can see this empirically in that agents outside technical domains consistently underperform their hyped claims. This is due to the latent complexity of the real world which is hard to overcome by simply adding more training data or compute. In other words, the nuances of reality are difficult to capture because it behaves like an iceberg where most details appear beneath the surface, leading to fundamental ambiguity about what to do in any given situation. In theory, this ambiguity can be resolved by providing more data during training or additional context during inference. But in practice, the amount of data and context required is far more than anyone expects.</p>

<p>The problem with all this ambiguity is that it destroys all the advantages we have when buildings agent for coding. For most domains, there aren’t piles of training data just sitting around because unwritten rules and tacit knowledge drive the engine of productivity in human organizations. The blueprint to this social operating system doesn’t exist in any training corpus, which produces ongoing contextual ambiguity. Furthermore, most domains don’t have stable, verifiable answers which can be scalably generated and confirmed. Instead, the correct answer is often time and situation dependent, which we can categorize as temporal ambiguity. Finally, communication ambiguity arises as a result of poor transmission of intent when humans provide instructions. And the average consumer isn’t so forgiving when the AI inevitably makes mistakes due to their own poor communication.</p>

<h2 id="contextual-ambiguity">Contextual Ambiguity</h2>

<p>Whenever any collection of humans gather together to form a group, a social contract soon appears which governs how members of the organization interact with each other and how they prioritize which activities to pursue. Within the modern workplace, some of this knowledge lives in Slack threads, some in Notion pages, some in email chains, and yet more in other tools. Bringing together these scattered pieces is already challenging, but the real problem is that most tribal knowledge is tacit.  The majority of the norms and values of the group remain unwritten, and sometimes are simply unwriteable in nature.</p>

<p>Consider interpersonal dynamics, the kind of common sense that exists on a personal level but never appears in any document. Brian doesn’t want to talk anymore because he’s hungry and lunch just arrived. Sarah seems off because her kid was sick all night, so you postpone difficult conversations. Jacob the CTO is not a morning person, so you never schedule meetings with him before 10am. Colleague moods determine how you should approach them, when to push forward with an idea, when to table a discussion. This information certainly isn’t written down anywhere, yet it’s crucial for effective workplace interaction.</p>

<p>Scale this up to company-level culture and the complexity multiplies. Professional norms that seem obvious are actually learned behaviors that vary dramatically between organizations. Meeting hierarchies differ by company — in some, junior employees speak first to avoid anchoring bias, while in others they defer until seniors have shared their thoughts. “End of day” means 5 PM sharp at law firms but stretches to midnight at startups, or really means “before tomorrow’s 9 AM standup.” Reply All might signal transparency at one company and obnoxiousness at another. The choice of medium (Discord vs. formal email) encodes urgency, hierarchy, and political sensitivity. When the CEO says “interesting idea,” it means “drop everything and work on this,” but that translation appears in no employee handbook.</p>

<p>The water we swim in provides context so pervasive we forget to mention it. Humans acquire these details through micro-interactions accumulated over months and years. We browse company websites absorbing tone and values. We attend all-hands meetings noting not just what was said, but how it was stated. We have lunch conversations, read facial expressions, and observe speaking patterns that surface someone’s real priorities. Even perfect user articulation can’t capture social context that’s so omnipresent people don’t recognize its existence. This invisible infrastructure that humans absorb through osmosis remains opaque to systems trained on text because you can’t post-train on what was never written down.</p>

<p>If we were to take a stab at a solution, a pre-requisite includes multimodal perception combined with persistent memory to build accurate social models. These contexts demand systems that observe meetings through audio, interpret body language through video, and parse unstructured data from PDFs to company memos. We need agents with persistent organizational memories that capture tacit knowledge and make sense of it even when users aren’t actively chatting. The agent must see Pamela’s eye roll at Friday afternoon meetings, hear the CEO’s tone shift when discussing certain topics, and remember that Brian gets hangry at 12:30. Even as we solve for static hidden context, we face further challenges.</p>

<h2 id="temporal-ambiguity">Temporal Ambiguity</h2>

<p>Ground truth in the real world is a moving target, and a fast one at that. Often the “correct” answer is unknowable because even human experts disagree — should we enter a new market, approve the candidate hire for this role, or add a particular product feature? How my particular company calculates conversion rates differs from yours, and no amount of extended reasoning, test-time compute, or web searches will uncover our specific formula.  These correctness of these decisions cannot verified because what works in one case does not apply in another. Reality shifts based on timing, circumstances, and the very act of decision-making itself.</p>

<p>Time destroys solutions in ways static models can’t handle. Market dynamics illustrate this perfectly: the ideal house you identify today is gone before the decision gets approved. Human preferences also evolve constantly: last year’s perfect birthday gift for my nephew (dinosaur encyclopedias) has now become this year’s embarrassment because space is cool now and dinosaurs are for babies. The system must track not just changing preferences but the social dynamics of maturation, which means understanding when interests become “uncool” and why that matters. Consider something as simple as choosing lunch. What I want to eat evolves throughout the week, conditional on what I ate the day before. A successful prediction for Tuesday invalidates itself for Wednesday because I already had that meal. Some predictions are ruined by timing issues, while others create their own invalidity through succeeding.</p>

<p>This self-invalidation problem extends far beyond personal preferences. Strategic decisions alter the landscape they analyze. Netflix’s algorithm correctly identifying demand for true crime documentaries could flood the platform with similar content, changing brand perception and driving away users who valued catalog diversity. Success changes the game itself. Teaching AI to direct Vogue photo shoots illustrates this perfectly. Fashion operates through counter-trend movements. If AI-generated covers become ubiquitous, the cutting edge shifts to deliberately amateur, hand-crafted aesthetics. The “correct” output inverts based on AI prevalence itself. Today’s innovation becomes tomorrow’s cliché precisely by succeeding.</p>

<p>Training on yesterday’s data to solve tomorrow’s problems is like using last year’s map to navigate a city under construction. This volatility means benchmarks measuring static capabilities miss the point entirely because success requires navigating uncertainty, not optimizing accuracy. An AI might correctly analyze market entry profitability, but the announcement triggers competitive responses that invalidate every calculation. Since there can never be a single “correct” answer to many real-world questions, writing a verifier is impossible.</p>

<p>What we’re dealing with is an ever-changing environment whereby the actions of the actor also influence the state of the world. The shift from a multi-arm bandit into reinforcement learning precisely captures this changing paradigm. To put it more plainly, this complexity is something we’re already used to dealing with in machine learning. The gap in performance appears though because true adaptability requires continual learning that updates understanding in real-time, transcending off-policy rewards for dynamic evolution. The system must fundamentally reconceptualize its approach as contexts shift. Adaptation means not just updating weights but developing new strategies that recognize when the rules of the game have changed.</p>

<h2 id="communication-ambiguity">Communication Ambiguity</h2>

<p>Perhaps the biggest hindrance to general purpose agents isn’t a lack of technology, but rather a contradiction in how humans naturally operate. Whereas instructing a model requires spending time carefully crafting the perfect prompt, most humans won’t adapt their speaking style for friends or colleagues, much less for random machines they have never interacted with before. Despite what AI enthusiasts claim, prompt engineering is not natural language — it’s engineering. Natural language evolved for humans who share massive amounts of context which creates fundamental uncertainty for systems that don’t.</p>

<p>This becomes an insurmountable barrier because humans are unwilling to change. Human inflexibility and stubbornness surrounds us every day. After 40 years of keyboards being ubiquitous, millions still hunt and peck with two fingers. Behavioral change at scale is nearly impossible. People regularly fall for phishing emails despite mandatory security training that explicitly warns against them. Office workers don’t know keyboard shortcuts like Ctrl+C, instead navigating through right-click menus for every copy-paste operation. Some print emails to read them. Others write passwords on sticky notes. If we can’t get people to learn basic computer skills after decades, expecting them to master prompt engineering is a non-starter.</p>

<p>But the problem runs deeper than unwillingness.  Sometimes, users literally can’t provide the right information for agents to succeed. Even motivated users fail because they don’t know which details are relevant. When someone says “make it pop” in a design review, those three words carry entirely different meanings at a minimalist tech startup versus a children’s toy company. At the startup, it might mean subtle animation or increased white space. At the toy company, it means rainbow colors and cartoon characters. A non-designer lacks the vocabulary to articulate what they actually want.</p>

<p>This is the “unknown unknowns” problem that emerges whenever we expand into new domains. When asked to “run the numbers on this campaign,” a human expert intuitively knows whether to focus on ROI, engagement rates, or customer acquisition cost based on who’s asking and what meeting it’s for. An AI agent receiving the same request has no such context. Furthermore, natural language itself is lossy compression that assumes shared understanding. This is why we have so many words for similar concepts—ambiguity is baked into human communication.</p>

<p>Human nature represents the ultimate showstopper for AGI in the near future. Expecting average users to change their communication habits is futile. The gap between technical and non-technical domains creates asymmetric expectations that doom general-purpose agents. Unlike coding environments where partial solutions have value, real-world tasks often have binary success criteria. The email is sent to the right user or its not. The numbers presented in the dashboard are either correct or they’re not. This fundamental difference in forgiveness means that the successes in technical domains won’t translate to general use.</p>

<p>The only viable solution requires agents that proactively extract missing context through intelligent questioning. An agent must know to ask “Is this for the quarterly board review or the team standup?” without being prompted, and also to know when to abstain from asking to avoid becoming annoying.  Consequently, we need agents who exhibit agency towards figuring out what information is missing to successfully complete a task through explicit dialogue states rather than probabilistic guesses.  When we imbue agents with built-in priors about common scenarios, we enable proactive clarification rather than guessing or failing silently because now the agent can go into a situation with a point of view on what to expect. Building such systems requires a different mindset that embraces the human-in-the-loop rather than seeing it as a blocker to scale.</p>

<h2 id="achieving-useful-ai-requires-a-pivot">Achieving Useful AI Requires a Pivot</h2>

<p>While progress is possible on all the problems above, we won’t get there without fundamentally changing our approach — mainly a recognition that there are still substantial missing pieces to the puzzle which require attention. We move closer to success as we integrate multiple capabilities that in total can address the three massive unsolved challenges.  First, proactive clarification that goes beyond answering what’s asked to understanding what should be asked. Agents must know to ask “Is this presentation internal or client-facing?” unprompted, reconstructing context from minimal cues. Second, multi-modal perception with persistent memory capturing full work context. Systems must attend meetings, interpret body language, remember interactions, and model organizational culture over time. Third, RL-based agents must exhibit continual learning that enables real-time adaptation to shifting circumstances and changing contexts.</p>

<p>The integration challenge is that we need all three solutions working together, not separately. For AI agents to work, most enterprises will require a bridge between the AI and their specific workflows. This means tooling to connect different systems, pulling in the right amount of data rather than all of it, handling security and permissions properly for software development, and having deep domain knowledge tied to specific use cases. The last mile of making AI agents work in real, highly variable and hostile environments is incredibly hard, and it’s increasingly the most valuable part of the whole process. Going beyond technology, we must consider customer support tailored to each domain, service-level agreements, liability clauses, customized sales motions, and aligned partnerships. And everyone one of these steps faces uncertainty in an ever-changing environment that isn’t captured by benchmarks.</p>

<p>The path forward requires us to shift our focus from climbing leaderboards to navigating ambiguity. Instead of celebrating another percentage point on standardized tests, we should be building systems that can handle the messy, implicit, and frankly brokenness nature of human work. Until we acknowledge that there are always more unknown details in reality, we will fail to address this complexity, and AGI will remain a distant dream rather than an imminent reality. Progress is possible though when we realize that our goal is not to solve all tasks, but just to make helpful progress on specific tasks. Ultimately, real breakthroughs will come from those willing to grapple with the full complexity of the challenge.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Who among us isn’t using AI assistance for coding? Personally, I hit up against credit limits at least once a week. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="ai" /><category term="dialogue" /><category term="startups" /><summary type="html"><![CDATA[The prevailing trend on social media is that AGI is right around the corner, but cracks begin to appear as soon as we consider the type of progress we have made and just how far we have to go to create something useful for most people. Let’s examine the evidence. Many researchers base their super-intelligence timelines on the compounding growth in benchmark progress. But benchmarks aren’t real life. OK, then what about AI systems from big (and small labs winning IMO gold medals. Or what about coding agents deployed in production building entire applications in one shot? Surely, these are pretty real right?]]></summary></entry><entry><title type="html">Solving the Long Tail of Data Acquisition</title><link href="https://derekchen14.github.io/2022/10/24/long-tail-of-data-acquisition.html" rel="alternate" type="text/html" title="Solving the Long Tail of Data Acquisition" /><published>2022-10-24T00:00:00-04:00</published><updated>2022-10-24T00:00:00-04:00</updated><id>https://derekchen14.github.io/2022/10/24/long-tail-of-data-acquisition</id><content type="html" xml:base="https://derekchen14.github.io/2022/10/24/long-tail-of-data-acquisition.html"><![CDATA[<div class="hidden">The deep learning revolution was initiated not by intelligent algorithms alone, but with the help of powerful compute and access to data. While models have continued to improve and compute power has continued to advance, progress on data collection has not been so fortunate.  Data labeling companies would have you believe that they alone are the solution to all our data problems - provided, of course, that we pay their exorbitant fees.  However, relying on vendors avoids the core issue since the underlying cost and complexity of gathering high quality data remains untouched.  As things currently stand, the effort needed to annotate each additional batch of data increases over time as the examples reach the long tail of the distribution. Any company able to figure out a way to transform data annotation from a cost-center into an area of innovation gains an enviable competitive advantage. But how?</div>

<p><!--more--></p>

<p>The deep learning revolution was initiated not by intelligent algorithms alone, but with the help of powerful compute and access to data.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> While models have continued to improve and <a href="https://blogs.nvidia.com/blog/2022/09/20/keynote-gtc-nvidia-ceo/">compute power has continued to advance</a>, progress on data collection has not been so fortunate.  Data labeling companies would have you believe that they alone are the solution to all our data problems – provided, of course, that we pay their exorbitant fees.  However, relying on vendors avoids the core issue since the underlying cost and complexity of gathering high quality data remains untouched.  As things currently stand, the effort needed to annotate each additional batch of data <em>increases</em> over time as the examples reach the long tail of the distribution. Any company able to figure out a way to transform data annotation from a cost-center into an area of innovation gains an enviable competitive advantage. But how?</p>

<h2 id="the-long-tail-of-data-annotation">The Long Tail of Data Annotation</h2>

<!-- ![Jedi IQ on Labeled Data](/assets/img/jedi_labeled_data.png) -->

<p>Given the obvious dependence on labels to perform supervised learning, even newcomers to AI recognize the necessity of annotated data.  It doesn’t take much longer though to realize just how hard it is to collect those labels, so the conversation quickly shifts to the brighter and shinier parts of machine learning — the modeling.  But as alluded to earlier, this attitude just doesn’t cut it though when an organization must face the reality that their raison d’être is to satisfy customer needs and not to play with cutting-edge toys.</p>

<p>In a <a href="https://future.com/new-business-ai-different-traditional-software/">thought-provoking review</a> of the AI landscape, Martin Casado and Matt Bornstein from A16Z called out the fundamental flaws that prevented AI companies from enjoying the typical returns found in their SaaS counterparts.  They noted, in Feb 2020, that “scaling AI systems can be rockier than expected, because AI lives in the long tail.”  The boost provided to the ML system by the first 10,000 training examples is significantly greater than the boost seen when adding data in later on.  Furthermore, the cost of labeling examples 100,000 to 110,000 has also increased exponentially along the way.  Instead of getting stronger, the <a href="https://a16z.com/2019/05/09/data-network-effects-moats/">data moat erodes as the corpus grows</a>.  The result: a negative fly-wheel where more customers means higher costs to serve them. The exact opposite effect that a scaling start-up wants to experience.</p>

<p>The same authors <a href="https://a16z.com/2020/08/12/taming-the-tail-adventures-in-improving-ai-economics/">provide some hints</a> at improving the unit economics of such a business model.  Use the right tool for the job (ie. not deep learning).  Narrow the focus of the system into something manageable.  Consider the benefits of transfer learning.  These points are all correct, but they’re mostly just bandages on a fundamentally difficult situation.  How exactly does transfer learning solve the long tail of data labeling?  It doesn’t. So, where do we look to find the AI revolution we so desperately seek?</p>

<h2 id="machine-in-the-loop-annotation">Machine-in-the-Loop Annotation</h2>

<p>A sizable number of incumbents already exist in the data labeling industry, providing annotations for self-driving cars, named entity recognizers and everything in between.  Millions of dollars have been poured in to prop these companies up into unicorn status.  If lack of labeled data is the sin, might these companies be our saviors?</p>

<p>At first glance, it does seem like such businesses should play an important role in moving the field forward.  They have invested heavily into streamlining their processes, in addition to designing high-usability platforms to make the annotation experience as smooth as possible.  There is no doubt that they will eventually build ML driven data augmentation right into the annotation process if they haven’t already done so.  And there’s a growing body of research to suggest that such machine-assisted labeling is indeed the way of the future.</p>

<p>As a quick aside, let’s visit just a handful of examples.  To start, it might not be surprising that if you “Want To Reduce Labeling Costs, GPT-3 Can Help” through pseudo-labeling.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup>  You can also use the model to generate the datasets, including synthesized inputs and outputs.<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup>  Others have showed that using GPT-3 followed by human verification improves Extractive QA.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> You can even use models to help with the verification process as well.<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup></p>

<p>Now, back to the data labeling effort.  Does machine-in-the-loop annotation solve our problem?  <a href="https://twitter.com/arankomatsuzaki/status/1529278580189908993">Let’s think step-by-step</a>.  An AI revolution requires scalable access to labeled data.  Data labeling companies outsource the effort to overseas workers, lowering their costs.  They employ technology to lower the costs further.  Now the cost of dealing with the long-tail is much lower than before. But the negative feedback cycle still remains.</p>

<p>The issue has been mitigated, but not eliminated.</p>

<p>Now, let’s be clear.  If you are running a firm or department in charge of annotating large amounts of data, you should certainly make an effort to take full advantage of the current state-of-the-art techniques.  The point is not that machine-assistance is bad, but more that machine-assistance is not enough.</p>

<blockquote>
"We must flip the script such that the burden of annotation is placed on the machine, with humans merely assisting."
</blockquote>

<p>Data labeling firms generate a profit by farming tasks out to lower paid crowdsource workers, taking advantage of labor arbitrage.  Notably, they are <em>not</em> taking advantage of economies of scale since the cost of annotating each marginal data point doesn’t budge.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup>  AI-assisted annotations certainly helps, but improved GUIs and task reformulation are likely to help just as much.</p>

<p>In order for an AI-first company to survive, we have to move from a <em>machine-assisted</em> data labeling process to a <em>machine-driven</em> one. At the moment, humans still bear the bulk of the annotation effort, and machines just help where possible. Instead, we must flip the script such that the burden of annotation is placed in the machine, with humans merely assisting.  Only then would we be able to invert the negative flywheel into a positive loop.</p>

<h2 id="towards-a-human-in-the-loop-paradigm">Towards a Human-in-the-Loop Paradigm</h2>

<p>A fully automated annotation system that can operate without any intervention is essentially AGI.  To expect such an outcome is unrealistic.  However, we can ask ourselves if it is possible to reach a reality where human intervention is minimized, or perhaps even where the amount of data being labeled is decoupled from the level of human involvement.</p>

<p>To see how a sustainable business might operate in this world, we can consider how building in the cloud has evolved.  Let’s define Software 1.0 as a process whereby a number of software developers write a bunch of code instructing the machine on what do to.  In contrast, machines in Software 2.0 learn what to do for themselves by training on a bunch of labeled data. Now if it weren’t for that pesky step of manually labeling the data, we would have a completely machine-driven process.  That’s not the case at the moment, but let’s suppose it were.  Assume the data labelers were replaced by a magical technology fairy.  Would humans still be involved at all?</p>

<p>If we were to replace software developers in the same manner (🤨 <a href="https://betterprogramming.pub/github-copilot-a-tool-or-doom-for-programmers-dfa79ba84bbc?gi=b2851c166d2a">CoPilot</a>?), we would see that there are still many humans involved with launching new features.  Even discounting the product managers, designers and business analysts outside the development process, there already exist a number of programmers helping with code review, QA and IT Ops.</p>

<p>As more code is deployed, the more QA is needed to review the code.  This level of human intervention is acceptable though because there isn’t a long tail effect where the amount of code written exacerbates the amount of QA needed.  The increase in effort is linear rather than exponential.  Moreover, the degree of QA controls the likelihood of the bugs in production, and not the lines of code being written.  This decoupling means the human QA effort does not bottleneck the coding effort.
Arguably, there is even a positive feedback loop.  As the programmer writes more code, the more feedback they receive from QA and the better code they write as they learn to avoid common mistakes over time.</p>

<p>How does this translate to a Software 2.0 environment?  If the data labeling pipeline is managed in the same manner, then the humans-in-the-loop are there simply to QA the quality of the data.  Model deployments (ie. feature releases) are no longer blocked by manual exercises, yet model accuracy improves when more human effort is applied.  We have effectively transformed heavy human involvement into lightweight human verification, letting the machine perform the bulk of the work instead.  The development process has shifted into something safe and reliable, almost mundane, in its implementation.</p>

<p>Why hasn’t this already happened?  Looking back, we notice that this world starts with the assumption of a technology fairy.  What we need to now is figure out how to engineer such a system capable of generating labeled data.</p>

<h2 id="controllable-reliable-explainable">Controllable, Reliable, Explainable</h2>

<p>Large, pre-trained LMs are capable of generating high quality, high fluency text.  Fantastic performance is possible even without explicit training through in-context learning.  But their gargantuan size can make them hard to control,<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup> lexically or semantically.  When they work well, all is fine, but when predictions are incorrect or generations are toxic, there’s not much that can be done about it.  Fine-tuning is impractical at best, and unattainable at worst since the model is hidden behind a pay-to-play API.  With training already this difficult, probing for explanations is effectively impossible.</p>

<p>Human annotators on the other hand are also able to produce fluent and coherent text.  They are relatively easy to control through guidelines and training manuals.  They behave in well understood ways and often make a good faith effort to be correct.  Critically, when mistakes are inevitably made, human annotators can easily explain their thought process and quickly adapt to changing circumstances.</p>

<p>If we’re willing to look past the hype, we see that LLMs still have a way to go before matching human performance on data labeling.  They fall short on three key desiderata: controllability, reliability and explainability.</p>

<blockquote>
"By leveraging large LMs as data generators rather than directly as classifiers, a number of strategic benefits are now unlocked."
</blockquote>

<p>Is there a way out?  The key insight is to control the output of the LLM enough to be able to generate label-preserving training data.  We then fine-tune smaller, more manageable models on this data for downstream applications.  By leveraging large LMs indirectly as data generators rather than directly as classifiers, a number of strategic benefits are now unlocked.</p>

<p>Rather than using the model directly for prediction, we now have access to tangible data which can be further molded and manipulated as desired.  If the diversity generated data is too low, we can apply additional data augmentation procedures.  If the noise of the generated data is too high, we can apply data denoising or data filtering techniques.  This format allows us to reliably produce high quantity and high quality data since we can repeat the process indefinitely until we have converged on a result we are satisfied with.</p>

<p>The discrete nature of the outputs means we can also directly observe what the large LM is thinking (to a certain extent).  If it starts to generate biased text, we can deal with it right away before feeding to the downstream model.  If we’re exploring a new area due to domain shift, we can see interpretable examples of what the LLM believes is right.  This gets us the best of both worlds - automated, scalable data annotation leading directly to improved downstream model performance.</p>

<p>But where did the control of the large model come from?  While it’s true that we can’t fine-tune the entire model (ie. CTRL),<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup> we can nudge it in the right direction using soft-prompting and adapters. The outputs aren’t perfect, but they don’t have to be.  The augmented data is directly manageable so we can clean and denoise until it fits our goals.  The research on how to make this happen is an active, ongoing direction.<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup></p>

<p>Finally, and maybe most critically, we can use the improved data to train better models.  The improved models interact with humans, collecting more real-world cases that are then fed back to the large LM for labeling.  For the first time, we have a truly positive feedback loop, where AI genuinely gets better the more it is used.</p>

<h3 id="conclusion">Conclusion</h3>

<p>Machine-assisted data labeling naturally hit limitations due to the complexities of real-life scenarios.  Machine-driven data labeling is required instead to cover the long tail, where humans are in the loop simply to verify.  This allows AI-first companies to scale into the future long after the funding and hype have faded away.</p>

<!-- Large language models are Few-Shot Learners.[^1] And Zero-Shot Learners.[^2] And Zero-shot Reasoners too, why not?[^3]  So why hasn't AI [taken over the world](https://www.gwern.net/fiction/Clippy) yet? Well, apocalyptic scenarios aside, applying AI to real world problems just isn't that simple. -->

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>(Sun et al., 2017) <a href="https://arxiv.org/abs/1707.02968">Revisiting Unreasonable Effectiveness of Data in Deep Learning Era</a> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>(Wang et al., 2021) <a href="https://aclanthology.org/2021.findings-emnlp.354/">Want To Reduce Labeling Costs, GPT-3 Can Help</a> <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>WANLI (Liu et al., 2021) <a href="https://arxiv.org/abs/2201.05955">Worker and AI Collaboration for NLI Dataset Creation</a> <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>DADC (Bartolo et al., 2022) <a href="https://aclanthology.org/2022.naacl-main.275.pdf">Models in the Loop: Aiding Crowdworkers with Generative Annotation Assistants</a> <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>(Wiegreffe et al., 2022) <a href="https://aclanthology.org/2022.naacl-main.47/">Reframing Human-AI Collaboration for Generating Free-Text Explanations</a> <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>Data labeling companies are possibly the <em>least</em> likely group to innovate a novel method of data annotation.  Their business model incentives them to maintain the status quo since any deviation risks depreciating the tremendous investment poured into their current infrastructure, including their network of crowdworkers, optimized onboarding routines and refined sales copy.  This pushback is common whenever a new way of doing things makes the old way obsolete. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>Prefix-tuning (Li and Liang, 2021) <a href="https://aclanthology.org/2021.acl-long.353/">Prefix-Tuning: Optimizing Continuous Prompts for Generation</a> <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>CTRL (Keskar et al., 2019) <a href="https://arxiv.org/abs/1909.05858">A Conditional Transformer Language Model for Controllable Generation</a> <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p>Driven by yours truly <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="data-strategy" /><category term="product-strategy" /><category term="research" /><category term="startups" /><summary type="html"><![CDATA[The deep learning revolution was initiated not by intelligent algorithms alone, but with the help of powerful compute and access to data. While models have continued to improve and compute power has continued to advance, progress on data collection has not been so fortunate. Data labeling companies would have you believe that they alone are the solution to all our data problems - provided, of course, that we pay their exorbitant fees. However, relying on vendors avoids the core issue since the underlying cost and complexity of gathering high quality data remains untouched. As things currently stand, the effort needed to annotate each additional batch of data increases over time as the examples reach the long tail of the distribution. Any company able to figure out a way to transform data annotation from a cost-center into an area of innovation gains an enviable competitive advantage. But how?]]></summary></entry><entry><title type="html">Is Reinforcement Learning a Good Fit for Dialogue?</title><link href="https://derekchen14.github.io/2022/07/28/is-rl-a-good-fit-for-dialogue.html" rel="alternate" type="text/html" title="Is Reinforcement Learning a Good Fit for Dialogue?" /><published>2022-07-28T00:00:00-04:00</published><updated>2022-07-28T00:00:00-04:00</updated><id>https://derekchen14.github.io/2022/07/28/is-rl-a-good-fit-for-dialogue</id><content type="html" xml:base="https://derekchen14.github.io/2022/07/28/is-rl-a-good-fit-for-dialogue.html"><![CDATA[<p>On the surface, reinforcement learning (RL) seems like a great method for solving dialogue tasks.  We can easily model the problem as a POMDP where the partially observed state represents the user’s intent.  During each turn, the dialogue agent must make a decision about how to respond. This action space is represented as either a series of tokens or simplified even further into a single dialogue act.  Lastly, task-oriented dialogue offers a natural reward — whether or not the dialogue succeeded.  And yet, we don’t see (m)any deployed dialogue systems trained with RL.  Why is that?
 <!--more--></p>

<h2 id="rl-as-supervised-learning-in-sheeps-clothing">RL as Supervised Learning in Sheep’s Clothing</h2>

<p>In order to apply RL in realistic environments, a number of adjustments are often made to make the training tractable. While classic RL operates in an online setting, training an agent in such a manner quickly becomes impractical (ie. customer service), costly (ie. robotics), or even downright unethical (ie. healthcare).  So as a simplification, trajectories from a human agent are stored in an experience replay buffer for offline training.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> Since the target policy \(\pi_g\) is obviously not the same as the behavioral policy \(\pi_b\) used to collect the data, off-policy evaluation methods are also applied.<sup id="fnref:2" role="doc-noteref"><a href="#fn:2" class="footnote" rel="footnote">2</a></sup> Conversations within even a narrow domain are hard to model completely, so now we must adopt model-free RL.<sup id="fnref:3" role="doc-noteref"><a href="#fn:3" class="footnote" rel="footnote">3</a></sup> Finally, since the state and action spaces of conversations are unbounded, modern RL systems do away with a table of Q-values, and instead use neural networks as function approximators.  In fact, why even calculate Q-values when directly optimizing for the policy with REINFORCE works just as well.<sup id="fnref:4" role="doc-noteref"><a href="#fn:4" class="footnote" rel="footnote">4</a></sup> At the end of the day, we’re left with an RL agent trained on mini-batches of examples on a loss function that takes into account neither world models nor discount factors. And since the underlying implementation in both cases is just a Transformer,<sup id="fnref:5" role="doc-noteref"><a href="#fn:5" class="footnote" rel="footnote">5</a></sup>  this version of RL starts to look practically indistinguishable from regular ol’ supervised learning (SL).</p>

<p>It turns out, even folks working in reinforcement learning will readily admit that <a href="https://bair.berkeley.edu/blog/2020/10/13/supervised-rl/">RL can be simply viewed as SL with a twist</a>. Specifically, the tweak is that the RL algorithms select good slices of data before applying behavior cloning (aka. supervised learning) to master the task.<sup id="fnref:6" role="doc-noteref"><a href="#fn:6" class="footnote" rel="footnote">6</a></sup>  For example, hindsight relabeling provides better data by changing the agent’s original goal with the goal that was actually achieved.<sup id="fnref:7" role="doc-noteref"><a href="#fn:7" class="footnote" rel="footnote">7</a></sup> However, this technique of labeling the data after it was collected also has its supervised learning equivalent. In fact, labeling the user intents from a large pool of unannotated conversations is precisely the most common method of providing supervision for the intent detection task.<sup id="fnref:8" role="doc-noteref"><a href="#fn:8" class="footnote" rel="footnote">8</a></sup> More critically, isn’t data manipulation just some hack to improve training stability rather than a core part of reinforcement learning methodology?  The algorithmic part of the equation is behavior cloning which seems to be identical to supervised learning. So does RL really boil down to just SL wrapped with some fancy math?</p>

<h2 id="exploring-sub-optimal-trajectories">Exploring Sub-optimal Trajectories</h2>

<p>The key benefit which allows RL to potentially outshine SL is that it can learn from non-optimal trajectories.<sup id="fnref:9" role="doc-noteref"><a href="#fn:9" class="footnote" rel="footnote">9</a></sup> In other words, the student can overcome the teacher by avoiding (or even learning from) the mistakes that the teacher has made. Based on my understanding so far, this concept can manifest itself in at least three different ways: maximizing good outcomes, minimizing bad outcomes, and changing bad outcomes into good ones.</p>

<p>First off, RL learning encourages exploration which allows for finding better reward regions.<sup id="fnref:10" role="doc-noteref"><a href="#fn:10" class="footnote" rel="footnote">10</a></sup> Since RL operates with sparse rewards, sometimes going to a bad part of the environment is ok as long as the agent eventually learns to return back to the good part. This exploration occasionally pays off when the agent discovers areas of high reward that mindless imitation of past behavior could never visit. Secondly, trajectories that end in a bad outcome are not as damaging because the reward signal will automatically lead to the model to ignore such experiences.<sup id="fnref:11" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">11</a></sup>  This useful mechanism is not found in supervised learning, as evidenced by the pervasive issue of generating boring, non-committal responses (ie. I don’t know) when such dialogue is clearly not ideal. The SL agent simply copies what it sees most, whereas the RL agent is able to downplay such utterances. Lastly, an RL agent can take advantage of a imperfect outcomes by stitching together the good parts of bad trajectories. <sup id="fnref:12" role="doc-noteref"><a href="#fn:12" class="footnote" rel="footnote">12</a></sup> It can also take advantage of poor outcomes as examples of what <em>not</em> to do. Incorporating a penalty into training is trivial by adding a negative reward.  While modifying the loss function within supervised learning is certainly also possible, figuring out the exact formulation is not as straightforward.  Lest we forget, our previously mentioned hindsight replay is another way to turn dirt into gold.<sup id="fnref:13" role="doc-noteref"><a href="#fn:13" class="footnote" rel="footnote">13</a></sup></p>

<p>What we saw earlier in the previous section was not a single, isolated case of RL providing better data, but actually a part of larger trend where a RL model achieves superior performance by directly tackling the data problem along with the modeling (policy). How realistic are these advantages though?  While these three cases allow RL to <em>theoretically</em> outperform SL, does this play out in practice? To start, we’ve already discussed the catastrophic consequences of deploying an RL agent to learn from real users as it explores unsuccessful paths. So while the model won’t be harmed too much by sub-optimal trajectories, the product surrounding the model will suffer. To get around this, one could consider developing a user simulator for to mimic customer behavior.<sup id="fnref:14" role="doc-noteref"><a href="#fn:14" class="footnote" rel="footnote">14</a></sup> Much like the gaming environment of Atari allowed RL to achieve super-human performance on video games, an accurate user simulator should allow an agent to take full advantage of what RL can offer.</p>

<h2 id="ideal-data-generators-for-rl">Ideal Data Generators for RL</h2>

<p>If the key to unlocking reinforcement learning is to design a robust user simulator, how does one go about doing that exactly?  Well, a reinforcement learning environment is expected to take in the current state along with an agent action to produce the next state along with its associated reward.<sup id="fnref:11:1" role="doc-noteref"><a href="#fn:11" class="footnote" rel="footnote">11</a></sup>  This implies that a proper user simulator contains two components, a representative model of the user to output next states and an accurate method of evaluation to output well-calibrated rewards.</p>

<p>Touching upon the user model first, we argue this is essentially intractable since there is no feasible way to predict how a user would react in any given situation.  If we knew what the user wanted, we wouldn’t need agent interaction in the first place, and could just fulfill the customer request immediately. In the context of games, the goal of an RL agent is obviously to maximize the score. But humans don’t have a come with a universal scoring function. Even for the same task, different people might want completely different things.  For example, two groups want to book a dinner reservation at the same Italian restaurant, but one group is for a large party with complex dietary restrictions, while the other is a romantic dinner for two.  Frankly, even for the same person, the ideal outcome differs over time.  Consider someone buying a movie ticket for one week, but wanting to watch a different movie the next week.  Building a truly accurate model would entail constructing a new environment for every user. Clearly, we must relax the assumptions about users and instead assume that there exist patterns among different users even if their individual circumstances are slightly unique. We can operationalize the idea that two different users want the same things by offering the agent identical rewards when performing some desired action that equally benefits both users.</p>

<p>What we’ve learned so far is that reinforcement learning is beneficial only insofar as we can build useful user simulators for producing agent experiences, and that the only aspect of user simulators we can realistically control is their ability to generate appropriate reward signals. However, real-life has no intrinsic rewards, so how do we determine dialogue success?  Open domain chat includes subjective measures such as user satisfaction and dialogue fluency<sup id="fnref:15" role="doc-noteref"><a href="#fn:15" class="footnote" rel="footnote">15</a></sup>, but defining success in task-oriented dialogue is also imprecise.<sup id="fnref:16" role="doc-noteref"><a href="#fn:16" class="footnote" rel="footnote">16</a></sup> Suppose the user is booking a flight and the goal is to select the correct flight from a set of options with a KB.  Forget the extra details of dealing with discount codes or fees for checked bags.  Let’s assume the agent is given the straightforward task of collecting information on a finite set of constraints, such as desired price range, departure and destination locations, and number of seats.  Then suppose the agent successfully books the correct flight that meets all such criteria and deserves a (discounted) reward for all steps taken.  Where does this reward score come from?  We don’t know a priori what the user wanted, so a human would need go in after the fact to mark the conversation as successful. To the extent that we are just labeling data, it doesn’t seem like reinforcement learning is any better (or any worse) than training under a supervised learning paradigm.</p>

<p>Ultimately, RL algorithms are great, but the real limitation is the ability to quickly and scalably label collected conversations.  To take it a step further, one might say the real problem comes down to getting the right data.  Of course, that was always the key to begin with, since good data is the answer to everything on this blog ;)</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Lipton et al. (2016) <a href="https://www.microsoft.com/en-us/research/publication/efficient-exploration-dialogue-policy-learning-bbq-networks-replay-buffer-spiking/">Efficient Exploration for Dialog Policy Learning with BBQ Networks &amp; Replay Buffer Spiking</a> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2" role="doc-endnote">
      <p>Weisz et al. (2018) <a href="https://arxiv.org/abs/1802.03753">Sample Efficient Deep Reinforcement Learning for Dialogue Systems with Large Action Spaces</a> (ACER) <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3" role="doc-endnote">
      <p>Jiang et al. (2021) <a href="https://aclanthology.org/2021.emnlp-main.589/">Towards Automatic Evaluation of Dialog Systems: A Model-Free Off-Policy Evaluation Approach</a> (ENIGMA) <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4" role="doc-endnote">
      <p>Liu et al. (2017) <a href="https://arxiv.org/abs/1711.10712">End-to-End Optimization of Task-Oriented Dialogue Model with Deep RL</a> <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5" role="doc-endnote">
      <p>Chen et al. (2021) <a href="https://openreview.net/forum?id=a7APmM4B9d">Decision Transformer: Reinforcement Learning via Sequence Modeling</a> <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6" role="doc-endnote">
      <p>Eysenbach, Kumar, and Gupta (2020) <a href="https://bair.berkeley.edu/blog/2020/10/13/supervised-rl/">Reinforcement Learning is Supervised Learning on Optimized Data</a> <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7" role="doc-endnote">
      <p>Kumar, Peng, and Levine (2019) <a href="https://arxiv.org/abs/1912.13465">Reward-Conditioned Policies</a> <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8" role="doc-endnote">
      <p>Casaneuva et al. (2020) <a href="https://aclanthology.org/2020.nlp4convai-1.5/">Efficient Intent Detection with Dual Sentence Encoders</a> <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9" role="doc-endnote">
      <p>Agrawal and Wu (2021) <a href="https://professional.mit.edu/news/articles/reinforcement-learning-right-your-ai-problem">Is Reinforcement Learning Right for your AI Problem?</a> <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10" role="doc-endnote">
      <p>Weng (2020) <a href="https://lilianweng.github.io/posts/2020-06-07-exploration-drl/">Exploration Strategies in Deep Reinforcement Learning</a> <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11" role="doc-endnote">
      <p>Sutton and Barto (2014) <a href="https://web.stanford.edu/class/psych209/Readings/SuttonBartoIPRLBook2ndEd.pdf">Reinforcement Learning: An Introduction</a> (2nd Edition) <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a> <a href="#fnref:11:1" class="reversefootnote" role="doc-backlink">&#8617;<sup>2</sup></a></p>
    </li>
    <li id="fn:12" role="doc-endnote">
      <p>Kumar et al. (2022) <a href="https://openreview.net/forum?id=AP1MKT37rJ">When Should We Prefer Offline RL Over Behavior Cloning?</a> <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13" role="doc-endnote">
      <p>Ghosh et al. (2019) <a href="https://arxiv.org/abs/1912.06088">Learning to Reach Goals via Iterated Supervised Learning</a> <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14" role="doc-endnote">
      <p>Shi et al. (2019) <a href="https://aclanthology.org/D19-1206/">How to Build User Simulators to Train RL-based Dialog Systems</a> <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15" role="doc-endnote">
      <p>Saleh et al. (2019) <a href="https://arxiv.org/abs/1909.07547">Hierarchical Reinforcement Learning for Open-Domain Dialog</a> <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:16" role="doc-endnote">
      <p>Wang, Peng, and Wong (2020) <a href="https://aclanthology.org/2020.acl-main.566/">Learning Efficient Dialogue Policy from Demonstrations through Shaping</a> (S^2 Agent) <a href="#fnref:16" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="modeling" /><category term="rl" /><category term="dialogue" /><category term="product-strategy" /><summary type="html"><![CDATA[On the surface, reinforcement learning (RL) seems like a great method for solving dialogue tasks. We can easily model the problem as a POMDP where the partially observed state represents the user’s intent. During each turn, the dialogue agent must make a decision about how to respond. This action space is represented as either a series of tokens or simplified even further into a single dialogue act. Lastly, task-oriented dialogue offers a natural reward — whether or not the dialogue succeeded. And yet, we don’t see (m)any deployed dialogue systems trained with RL. Why is that?]]></summary></entry><entry><title type="html">Prerequisites for a Conversational AI Revolution</title><link href="https://derekchen14.github.io/2022/06/14/conversational-ai-revolution.html" rel="alternate" type="text/html" title="Prerequisites for a Conversational AI Revolution" /><published>2022-06-14T00:00:00-04:00</published><updated>2022-06-14T00:00:00-04:00</updated><id>https://derekchen14.github.io/2022/06/14/conversational-ai-revolution</id><content type="html" xml:base="https://derekchen14.github.io/2022/06/14/conversational-ai-revolution.html"><![CDATA[<p>Conversational AI was all the rage a few years back, when people were shouting from the rooftops that chatbots were going to take over the world.  But for all the fanfare and hullabaloo, the trumpeting of a new era has given away lately to a low, dull roar.  Depending on who you ask, we either have AGI right around the corner, or all this noise is simply over-hyped technology soon to float away like vaporware of the past.  I believe the more likely outcome is that the true answer lies somewhere in the middle – there will be a revolution, but it won’t happen overnight.  Instead, changes will start out incremental as the technology is rolled out and users will slowly adopt new social norms around dealing with virtual assistants.  I don’t claim to know when this will happen or exactly what it will look like, but certainly there are some clues.</p>

<!--more-->

<p>It seems that from the technological perspective, there are a set of seven criteria that will usher in the wave of a Conversational AI revolution.  Is this a hot take?  Perhaps a little, but anyone who disagrees would have a hard time making a convincing case otherwise. Without further ado, the list goes as follows:</p>

<h3 id="long-term-context">Long-term Context</h3>
<p>Going back ten years, being able to handle context from multiple turns back in the dialogue seemed like an impossibility.  The best dependency parsers would struggle to perform proper co-reference resolution even within the same utterance, much less across utterances.  With the explosion in performance provided by <a href="https://papers.nips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html">Transformers</a> though, this has completely changed.  Models now routinely handle documents with many paragraphs and conversations with many turns.  While this problem is largely solved now, we should recognize that it certainly is a prerequisite for usable and useful conversational AI systems.</p>

<h3 id="syntax-and-coherency">Syntax and Coherency</h3>
<p>If you take a Transformer and pre-train it with masked language modeling (MLM) or just regular language modeling (LM) you get <a href="https://aclanthology.org/N19-1423/">BERT</a> and <a href="https://openai.com/blog/better-language-models/">GPT</a>, respectively. These models have shown tremendous gains in producing fluent and coherent speech across a wide variety of applications, including dialogue.  More recently, you can combine these encoder and decoder components to get a seq2seq model, such as <a href="https://arxiv.org/abs/1910.10683">T5</a> or <a href="https://arxiv.org/abs/1910.13461">BART</a>, which can theoretically handle all of the above.  Perhaps most critically, scaling these models to 100s of billions of parameters and training them with giant amounts of data leads to super-human performance across a number of NLP tasks. Once again, although the <a href="https://blog.google/technology/ai/lamda/">LaMDA</a>s and <a href="https://arxiv.org/abs/2203.15556">Chinchilla</a>s have largely solved the syntax problem, this wasn’t the case a decade ago, and the progress should be recognized.</p>

<h3 id="consistent-persona">Consistent Persona</h3>
<p>Moving beyond long-term syntactic control, a proper virtual assistant also requires semantic control.  Not <a href="https://aclanthology.org/2021.eacl-main.24/">too long ago</a>, asking a dialogue agent about its profession (<em>What do you do? I am a 3rd grade teacher.</em>) would yield one answer at the beginning of a conversation, but would quickly yield a different answer (<em>I commute to the hospital each day as a doctor.</em>) just a few turns later.  A working system should avoid such contradictions and maintain a consistent personality.  In addition to the power of large PLMs, works around <a href="https://aclanthology.org/2020.acl-main.428/">unlikelihood training</a> though have done a reasonable job at making sure the model remembers what it said about itself earlier in the conversation.</p>

<h3 id="memory-extensions">Memory Extensions</h3>
<p>What about remembering what the other person said?  While we’ve already discussed the ability of modern models to cover simple details within their latent state, a truly useful system should also be endowed with the ability to track discrete states.  This serves at least two practical purposes. First, the main goal of any task-oriented dialogue system is to extract the proper slot-values from an utterance for policy decision-making.  Predicted slot-values must be exact in order to execute API calls and need to be tracked precisely over time.  Even in the open domain scenario, having a discrete state to represent the user’s preferences would be immensely valuable. Secondly, having a discrete state allows for the ability to inspect and modify such state for improved model control. If done before model deployment, we can consider initializing the model’s memory as a way of injecting some commonsense reasoning as a prior.  A <a href="https://arxiv.org/abs/1410.3916">long line of work</a> from FAIR has focused on this area, culminating with the release of <a href="https://blenderbot.ai">BlenderBot3</a> which can not only <a href="https://arxiv.org/abs/2107.07567">remember discrete facts</a> about both speakers, but can augment <a href="https://arxiv.org/abs/2111.05204">that knowledge</a> by <a href="https://aclanthology.org/2022.acl-long.579/">retrieving facts from the Internet</a>.</p>

<h3 id="interactive-learning">Interactive Learning</h3>
<p><a href="https://arxiv.org/abs/2208.03270">Learning new skills after deployment</a> is also an absolute requirement for working conversational agents since no matter how much a model knows or remembers while it is trained, the knowledge will become outdated over time.  Being able to adapt, either through <a href="https://arxiv.org/abs/2203.02155">human feedback</a> or <a href="https://arxiv.org/abs/1710.11248">other reward signals</a> will be critical to staying relevant over time.  More specifically, the difference between these human-in-the-loop systems is that the former provides an explicit signal through direct interaction, such as clicking a thumbs up / thumbs down button at the end of a chat.  On the other hand, the much more scalable (but also noisy) option is to <a href="https://aclanthology.org/2021.emnlp-main.489/">follow an implicit signal</a>, such as measuring user satisfaction (with a separately trained model) or keeping track of user engagement (number of dialogue turns).</p>

<h3 id="ambiguity-and-uncertainty">Ambiguity and Uncertainty</h3>
<p>By satisfying all the criteria above, we end up with a model that is amazingly powerful not only in the short-term, but arguably gets stronger as time goes on.  With that said, no dialogue system is ever perfect, so one more requirement is the ability to ask for clarification when it does not know. As the famous <a href="https://en.wikipedia.org/wiki/There_are_known_knowns">Donald Rumsfeld quote</a> goes, “There are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns—the ones we don’t know we don’t know.”  Ergo, a working system must learn to how to convert unknown unknowns into known unknowns.</p>

<p>Recognized unknown or out-of-distribution topics covers multiple fields, including <a href="https://aclanthology.org/2021.acl-long.84/">abstention</a>, <a href="https://aclanthology.org/2020.findings-emnlp.277/">uncertainty calibration</a>, <a href="https://arxiv.org/abs/1811.08581">open set recognition</a>, and <a href="https://aclanthology.org/2021.emnlp-main.35/">out-of-scope detection</a>.  While tremendous progress has been made on this problem <a href="https://arxiv.org/abs/2110.11334">in general</a>, not much of it has transferred over into the <a href="https://aclanthology.org/E09-1078/">dialogue domain</a> yet. In some sense, this may never be fully solved since, on occasion, conversations are just <a href="https://aclanthology.org/Q19-1043/">inherently ambiguous</a>.  As a result, a dialogue system should not aim towards the impossible task of resolving all ambiguity, but instead should endeavor to learn how to advance a conversation despite the uncertainty.</p>

<h3 id="low-data-regime">Low Data Regime</h3>
<p>Last but not least, the raison d’être of the blog – dealing with limited and noisy data.  Even when the dialogue system can do everything we imagine, there is no revolution if the cost of training such a model requires an inordinate amount of high-quality data.  Pre-training certainly helps, but even for Large PLMs, there is evidence that <a href="https://www.lesswrong.com/posts/6Fpvch8RR29qLEWNH/chinchilla-s-wild-implications">data is the bottleneck</a>.  <a href="https://arxiv.org/abs/2105.03075">Data augmentation</a> and <a href="https://arxiv.org/abs/2105.10311">synthetic text generation</a> certainly has a role to play too.  As <a href="https://morethanoneturn.com/2022/05/24/building-user-simulators.html">previous articles</a> have hinted at though, I believe we need to find <a href="https://morethanoneturn.com/2022/03/11/data-augmentation-for-scalable-product.html">dialogue-specific methods</a> of data generation to solve this problem.  Overall, I am quite hopeful that this last issue will also be solved well enough to bring around some real change.</p>

<hr />

<p>Since all these components are at least somewhat satisfied, does that mean the revolution is right around the corner?  Well, not quite.  While the technology is mostly there, that doesn’t imply that you can build a business around it overnight.  The ability to execute and adapt to the changing environment will play a big role in determining who ends up pulling this off, and when.  The time seems soon though.</p>]]></content><author><name></name></author><category term="ai" /><category term="startups" /><category term="trends" /><category term="lists" /><summary type="html"><![CDATA[Conversational AI was all the rage a few years back, when people were shouting from the rooftops that chatbots were going to take over the world. But for all the fanfare and hullabaloo, the trumpeting of a new era has given away lately to a low, dull roar. Depending on who you ask, we either have AGI right around the corner, or all this noise is simply over-hyped technology soon to float away like vaporware of the past. I believe the more likely outcome is that the true answer lies somewhere in the middle – there will be a revolution, but it won’t happen overnight. Instead, changes will start out incremental as the technology is rolled out and users will slowly adopt new social norms around dealing with virtual assistants. I don’t claim to know when this will happen or exactly what it will look like, but certainly there are some clues.]]></summary></entry><entry><title type="html">Building User Simulators for Scalable Dialogue Systems</title><link href="https://derekchen14.github.io/2022/05/24/building-user-simulators.html" rel="alternate" type="text/html" title="Building User Simulators for Scalable Dialogue Systems" /><published>2022-05-24T00:00:00-04:00</published><updated>2022-05-24T00:00:00-04:00</updated><id>https://derekchen14.github.io/2022/05/24/building-user-simulators</id><content type="html" xml:base="https://derekchen14.github.io/2022/05/24/building-user-simulators.html"><![CDATA[<p>Training dialogue agents for real-life use cases is immensely difficult since manual data annotation quickly hits scaling issues.  One way around this is to build a user simulator which can theoretically then generate tons of examples for the agent to learn from.  However, to build a system representing the user, you would need a model that understands how to react and respond to agents.  But to train such a user model you would then need some dialogue system that acts as an agent.  So we have a chicken-and-egg problem, right?  Well, not quite.  There is at least one key distinction between a user simulator and a dialogue agent.
 <!--more--></p>

<p>Note that while a dialogue agent takes in a natural language, follows some policy (often to make API calls), and then generates a natural language response, the simulator does not have to complete all those steps.  In particular, the user simulator can avoid the NLU component and go straight into policy management.  Furthermore, the number of user actions is inherently limited by the number of APIs that the product or service can provide.  To be clear, a real life user engages in a countless number of actions, but only a small subset of those actions are expected to be handled by the agent anyway — in all other cases, the agent can simply abstain.</p>

<p>Armed with these two facts, how can we go about designing a practical user simulator? Our first insight tells us that unlike a dialogue agent, what we want to build is a system that can handle reasonably complex actions followed by extremely sophisticated NLG component for producing responses.  Framed in this way, we see that such a system already exists: open-domain chat bots.  In fact, a large part of building task-oriented chatbots is that users often break out of script and engage in chit-chat.  If our user simulator already produced such outputs, in addition to directed information, then our dialogue agent would naturally be more robust to such variations.</p>

<p>Our second insight is that our user simulator does not need a terribly complex policy manager.  Instead, we can enumerate them with a set of rules to produce all combinations of user intents.  We can then sample from this set to produce plausible scenarios.  To see how this works, let’s look at an example.  Suppose we are dealing with the a flight domain.  A user may want to book a flight, cancel a flight, check on an existing flight or ask about some FAQs.  In reality, there are maybe a dozen more actions that user would want to take, but not that much more.</p>

<p>What makes emulating and/or understanding the user difficult is the number of values they provide and the way in which they provide them.  For example, when booking a flight, the user may choose from thousands of (departure/destination) locations and times.  This can lead to millions of values, but there are only four possible slot combinations.  Taking into account edge cases such as price requirements, seating requests and airline preferences, we might expand this into a total of 100 slots for a given domain.  Ultimately though, the number of slots is relatively small compared to the number of values.<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup>  We separately mentioned that the way the user’s express a preference have lots of variation: there are a hundred ways to say that you want to “Fly from San Diego to Miami on Saturday morning”.  What all these permutations have in common though is that all the complexity is in how to express the exact request.</p>

<p>In other words, with a limited number of domains, slots and intents it is not particularly hard to design a policy which can scale to as many combinations as you want since the heavy lifting is actually within the text generation component.  And what existing models are great at generating text given a context?  Open-domain chatbots.  Such models can already directly query the internet and read through millions of Wikipedia pages.  Trying to parse a few dozen parameters before generating a natural language response should be a walk in the park.</p>

<hr />

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Further notice that the slots in a given domain are often re-used across intents which dramatically simplifies the task. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name></name></author><category term="modeling" /><category term="rl" /><category term="dialogue" /><summary type="html"><![CDATA[Training dialogue agents for real-life use cases is immensely difficult since manual data annotation quickly hits scaling issues. One way around this is to build a user simulator which can theoretically then generate tons of examples for the agent to learn from. However, to build a system representing the user, you would need a model that understands how to react and respond to agents. But to train such a user model you would then need some dialogue system that acts as an agent. So we have a chicken-and-egg problem, right? Well, not quite. There is at least one key distinction between a user simulator and a dialogue agent.]]></summary></entry></feed>