<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rush Taneja</title>
    <description>The latest articles on DEV Community by Rush Taneja (@rushab11).</description>
    <link>https://dev.to/rushab11</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2082256%2Fbc4244cc-2043-43c5-9317-dd56d4981635.jpg</url>
      <title>DEV Community: Rush Taneja</title>
      <link>https://dev.to/rushab11</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rushab11"/>
    <language>en</language>
    <item>
      <title>My baseline agent found a bug in my own ground truth</title>
      <dc:creator>Rush Taneja</dc:creator>
      <pubDate>Tue, 11 Aug 2026 21:25:47 +0000</pubDate>
      <link>https://dev.to/rushab11/my-baseline-agent-found-a-bug-in-my-own-ground-truth-23pm</link>
      <guid>https://dev.to/rushab11/my-baseline-agent-found-a-bug-in-my-own-ground-truth-23pm</guid>
      <description>&lt;p&gt;&lt;em&gt;I implemented Amazon's "Tool-Making and Self-Evolving LLM Agents" paper (arXiv 2607.08010) on real Kraken/Binance market data. The tools it generated hit 25/25 accuracy at ~9,600× lower latency than the baseline agent — but the most interesting thing that happened was my baseline agent proving one of my hand-made labels wrong.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem the paper attacks
&lt;/h2&gt;

&lt;p&gt;If you've run LLM agents in production, you've seen this: the agent solves the same procedural step over and over - and &lt;em&gt;re-derives the solution from scratch every single time&lt;/em&gt;. Same instruction re-interpreted, same API schema re-discovered, similar code re-written. Every repetition costs seconds of latency, thousands of tokens, and a fresh chance to get it wrong.&lt;/p&gt;

&lt;p&gt;Amazon's paper (from their Fulfillment Technologies &amp;amp; Robotics group) proposes something simple and radical: let the agent &lt;strong&gt;compile its own reasoning into permanent tools&lt;/strong&gt;. Solve the step with an LLM once, capture the working code, freeze it into a validated deterministic function, and never pay the LLM tax for that step again - falling back to the LLM only when a tool is missing or can't answer.&lt;/p&gt;

&lt;p&gt;The paper's setting is Amazon's internal robotics-monitoring stack, which nobody outside can reproduce. So I transplanted it to a domain where everything is real and public: &lt;strong&gt;cryptocurrency market monitoring&lt;/strong&gt; - live Kraken/Binance REST endpoints, a 312MB archive of historical trades, and alarms like "is this market stale?" and "is this volume spike real?"&lt;/p&gt;

&lt;p&gt;One rule I set myself: &lt;strong&gt;no mocks anywhere&lt;/strong&gt;. Real exchange APIs with their real quirks, real historical data, and human-labeled ground truth. (The quirks earn their keep immediately: ask Kraken for &lt;code&gt;XBTUSD&lt;/code&gt; and it answers under the key &lt;code&gt;XXBTZUSD&lt;/code&gt;. No SOP would ever tell an agent that. This is exactly why the paper's "trace" concept exists.)&lt;/p&gt;

&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;Four days, five components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SOP decision tree&lt;/strong&gt; (&lt;code&gt;sop.yaml&lt;/code&gt;) - 9 decision nodes across 3 alarm families (spread anomaly, volume spike, feed health), the kind of runbook a human on-call engineer would follow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main agent&lt;/strong&gt; - walks the tree per alarm. The key design decision: the node evaluator is &lt;em&gt;injected&lt;/em&gt; (&lt;code&gt;evaluate(node, pair, t) → true | false | no_data&lt;/code&gt;), so the same walker runs against human labels, an LLM, or compiled tools.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Baseline sub-agent&lt;/strong&gt; - the expensive thing we're trying to beat. For each node, an LLM writes Python that queries the data layer; I execute it in a subprocess, feed back stdout/stderr, and iterate (max 3 attempts) until it commits to a verdict.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The pipeline&lt;/strong&gt; - the paper's contribution: a &lt;em&gt;tool-maker&lt;/em&gt; LLM that reads the node text + my labeled cases + the baseline's successful traces and writes a permanent tool; and a &lt;em&gt;reflector&lt;/em&gt; that tests every tool against the full labeled set and repairs on failure (max 3 rounds).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Runtime&lt;/strong&gt; - tool-first evaluation with LLM fallback.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ground truth: 25 cases I labeled by hand from the historical archives - real staleness gaps, real volume spikes, real calm hours — each with a one-line &lt;code&gt;why&lt;/code&gt; stating my reasoning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Accuracy&lt;/th&gt;
&lt;th&gt;Hold-out&lt;/th&gt;
&lt;th&gt;Median latency / node&lt;/th&gt;
&lt;th&gt;Tokens / node&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Baseline (code-writing agent)&lt;/td&gt;
&lt;td&gt;22/25&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;16,717 ms&lt;/td&gt;
&lt;td&gt;~7,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compiled tools&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;25/25&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;5/5&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.74 ms&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff7ibytnqk68cvy34zxi9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff7ibytnqk68cvy34zxi9.png" alt="Latency" width="600" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffoh25al6qys1ubx5cd9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffoh25al6qys1ubx5cd9y.png" alt="Accuracy" width="600" height="400"&gt;&lt;/a&gt;&lt;br&gt;
The tool-maker one-shotted the entire SOP: &lt;strong&gt;all six tools passed every labeled case at version 1 - the repair loop never fired.&lt;/strong&gt; The hold-out set was labeled &lt;em&gt;after&lt;/em&gt; tool generation, and 4 of its 5 cases use trading pairs (ETH, SOL) the tool-maker never saw. The tools generalized because they encoded my &lt;em&gt;conventions&lt;/em&gt;, not my examples.&lt;/p&gt;

&lt;p&gt;That last row is the whole paper in one line: the baseline pays ~17 seconds and ~7,000 tokens to answer a question a compiled tool answers in under 2 milliseconds for free.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;1. My baseline agent found a bug in my ground truth.&lt;/strong&gt; One of my labeled cases pointed at BTC's only &amp;gt;15-minute trading gap of the entire quarter — I'd placed the case timestamp mid-gap and labeled it "stale = true." The baseline agent returned &lt;code&gt;false&lt;/code&gt;, and it was &lt;em&gt;right&lt;/em&gt;: at that timestamp, the last trade was only ~10.7 minutes old, inside the 15-minute lookback. My label reasoned about the gap as a whole; the agent reasoned about the moment. Labels are a spec, and specs have bugs — I moved the timestamp late into the gap and thanked the agent for the code review.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Ambiguity - not capability - dominated the baseline's errors.&lt;/strong&gt; The baseline's misses weren't "the LLM is dumb." They were cases where my SOP said things like &lt;em&gt;"significant price move"&lt;/em&gt; or &lt;em&gt;"recent typical volume"&lt;/em&gt; without defining them - and a fresh LLM guessed conventions different from mine (a 30-day baseline where I meant 24 hours; the previous candle where I meant the current one). Every fresh call re-guesses your conventions. That's the deep argument for compiling tools: they freeze the &lt;em&gt;SME's&lt;/em&gt; conventions once, correctly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Four labeled examples pinned an ambiguous convention.&lt;/strong&gt; My "significant move" labels were extreme: 0.2% moves labeled &lt;em&gt;not significant&lt;/em&gt;, +20% moves labeled &lt;em&gt;significant&lt;/em&gt;. From just four such cases the tool-maker committed to a concrete |move| ≥ 5% threshold - a sensible interpolation of my intent that I never stated anywhere. (The paper's Appendix B.4 claims ~5 labels get you near ceiling; I can now confirm the vibe.) The boundary &lt;em&gt;between&lt;/em&gt; the extremes stays genuinely undefined: a hold-out candidate at −1.6% with 5× volume showed up and I couldn't honestly label it either way — so it's documented as exactly where the ambiguity lives.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I didn't reproduce, honestly
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Training-set caveat: the 25 cases both taught and tested the tools; the independent evidence is the small post-hoc hold-out. A larger temporal split is future work.&lt;/li&gt;
&lt;li&gt;The paper's LoRA fine-tuning section needs Amazon's production trajectories — can't reproduce outside.&lt;/li&gt;
&lt;li&gt;Tool latency is file-scan-bound on the biggest archive (one tool scans 5.75M rows of BTC trades; 8–22s cold). An index would fix it; irrelevant to the architecture claim.&lt;/li&gt;
&lt;li&gt;The label-free variant (Appendix C - validation by voting instead of human labels) is my Part 2.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;The paper's claim survives contact with a completely different domain, real messy data, and a solo implementer: &lt;strong&gt;an LLM agent that compiles its own reasoning into validated tools keeps the flexibility of agents and gains the speed, cost, and determinism of code.&lt;/strong&gt; And the artifacts along the way — the label my agent falsified, the convention four examples pinned — taught me more about &lt;em&gt;specification&lt;/em&gt; than about LLMs.&lt;/p&gt;

&lt;p&gt;Code, data pipeline, labeled cases, charts, and the full evaluation: &lt;strong&gt;&lt;a href="https://github.com/0xTaneja/tool-making-llm-agents" rel="noopener noreferrer"&gt;github.com/0xTaneja/tool-making-llm-agents&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I'm implementing more agent papers on real market data - if you're working on agent systems or know an unpopular paper that deserves a real implementation, my GitHub inbox is open.&lt;/em&gt;&lt;/p&gt;

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