From 170s to 1.3s: Agents Aren't Getting Faster—They're Getting Compiled
A common pattern in agent deployments: an LLM agent executes a standard business workflow, querying the model at every step to decide "what to do next." A full run takes 170 seconds, with most time spent waiting for the model to reason. Yet the same workflow, run the second or hundredth time, often follows an identical path. Repeated business processes force the model to re-think from scratch every time—the most wasteful part of the equation.
A team from Amazon and Columbia University (first author Kaiyuan Hou, work completed during his Amazon internship) offers a decisive fix called ReTrace: compile the agent's executed traces directly into an executable workflow, after which code—not the model—decides every step. On τ²-Bench, the compiled workflow completes a task in an average of 1.3 seconds, 130x faster than the original agent, with zero model calls at runtime.
The key is the reasoning text beyond tool calls
Looking only at which tools an agent called tells you the *how*; the reasoning text accompanying each call in the trace often contains the *why*—why branch A instead of B this time. ReTrace's pipeline consumes this text: it extracts trigger conditions from each step, merges conditions across multiple runs into a distilled rule document, and generates an executable workflow from that document.
Ablations that strip reasoning from the traces show immediate consequences: workflow completion on the production platform falls from 93.8% to 85.0%. More strikingly, for branches never actually visited in the traces but inferred from reasoning text, rule coverage drops from 44 branches to just 3. Tool calls record the path taken; reasoning text records the signposts at intersections—the latter is the raw material for compiling branching logic.
Results and trade-offs, laid out
- Production platform (79 real workflows): ReTrace completion rate 93.8% vs. the original agent's 96.8%—a 3-point sacrifice in exchange for a 24% cost reduction per task.
- τ²-Bench: 75.8% vs. 80.6% for the agent, and 1.3s vs. 170s.
- Compilation is not free: estimated at roughly 75 executions to recover compilation cost on τ²-Bench. That sounds like a lot, but in production, seven workflows ran 297,000–528,000 times over three months each—75 runs is just the entry fee.
- Failures are repairable: up to three repair rounds on failed training inputs lift the k=2 workflow from 66.7% to 81.2%. On SOP-Bench, the unrepaired version (80.6%) loses to few-shot direct generation (83.6%), but after repair it surpasses at 87.8%, at just 0.40 seconds per task.
More traces ≠ better
Counterintuitively, feeding the compiler more reference traces does not yield monotonic gains. The paper's experiments go up to k=16 and explicitly warn that too many traces degrade merge quality—though the specific claim of a sharp drop at k>8 is a video interpretation not found in the paper's text. The paper's own solution is more structural: instead of feeding raw traces to the generator, first compress them into a rule document—at k=16, full-trace input reaches 101.4k tokens while the compressed intermediate representation needs only 24.5k. Distillation is what counts.
Placement in the compilation lineage
This is another step along the "compile away the agent" line. SkillCompiler, covered earlier: 87% of actions bypass the model and tokens drop by two-thirds by hardening high-frequency operations into program skeletons. ReTrace goes further—not only hardening operations but also compiling "how to choose at branch points," leaving no model calls at runtime. Its advance over SkillCompiler lies precisely in the highlighted insight: tool calls reveal the how; reasoning reveals the why. Only by turning the why into explicit branching conditions does compilation become complete.
One boundary shared with SkillCompiler: what gets compiled away is reusable repeated paths; novel situations cannot be compiled. Branches the rule document cannot cover still need the thinking, self-explaining agent—but now its role is clearly defined: handling exceptions, not repetitive work.
---
*Source: ReTrace: Distilling Tool-Using Agents into Planner-Free Workflows (arXiv 2611.14492, 2026-11-10). Attribution: first author Kaiyuan Hou (Columbia University, work done during Amazon internship), corresponding author Yang Ping Kuo (Amazon); Columbia + Amazon team. All figures verified against the paper: τ²-Bench 1.3s vs 170s = 130x (Sec. 5.3); production 79 workflows, 93.8% vs 96.8% completion, 24% cost reduction (abstract); ~75 executions to recover construction cost; reasoning ablation: +6.2 points at k=4, Internal 85.0→93.8%, unwitnessed branches citing reasoning 44→3; k=2 repair 66.7%→81.2% over three rounds; SOP-Bench 80.6% → 87.8% repaired, 0.40s/task; k=16 IR 24.5k vs full traces 101.4k tokens; no model calls at runtime. Two caveats: the "37%–43% of time waiting for the model" claim was not found in the paper and is excluded; the "k>8 sharp drop" threshold is not explicit in the paper (experiments up to k=16 with an explicit warning about excessive traces degrading merge quality) and is recorded as a video interpretation.*