Agentic Compilation: Mitigating the LLM Rerun Crisis for Minimized-Inference-Cost Web Automation

arXiv cs.AI / 5/1/2026

💬 OpinionDeveloper Stack & InfrastructureTools & Practical UsageModels & Research

Key Points

  • The paper identifies a scalability problem for LLM-based web agents that use continuous inference loops, calling it the “Rerun Crisis,” where token spend and API latency grow roughly linearly with execution frequency.
  • It proposes a Compile-and-Execute architecture that separates LLM reasoning from browser execution by compiling a deterministic JSON “workflow blueprint” from a DOM semantic representation via a DSM, then running it with a lightweight runtime.
  • The approach reduces inference cost scaling from O(M × N) to amortized O(1), cutting a 5-step workflow over 500 iterations from about $150 (continuous agent) to under $0.10 per workflow even with aggressive caching assumptions.
  • Experiments on data extraction, form filling, and fingerprinting show zero-shot compilation success rates of 80–94%, and allowing minimal Human-in-the-Loop JSON patching raises reliability to near-100%.
  • Per-compilation costs range from $0.002 to $0.092 across five frontier models, suggesting deterministic compilation makes large-scale, economically viable web automation feasible compared with continuous agent designs.

Abstract

LLM-driven web agents operating through continuous inference loops -- repeatedly querying a model to evaluate browser state and select actions -- exhibit a fundamental scalability constraint for repetitive tasks. We characterize this as the Rerun Crisis: the linear growth of token expenditure and API latency relative to execution frequency. For a 5-step workflow over 500 iterations, a continuous agent incurs approximately 150.00 USD in inference costs; even with aggressive caching, this remains near 15.00 USD. We propose a Compile-and-Execute architecture that decouples LLM reasoning from browser execution, reducing per-workflow inference cost to under 0.10 USD. A one-shot LLM invocation processes a token-efficient semantic representation from a DOM Sanitization Module (DSM) and emits a deterministic JSON workflow blueprint. A lightweight runtime then drives the browser without further model queries. We formalize this cost reduction from O(M x N) to amortized O(1) inference scaling, where M is the number of reruns and N is the sequential actions. Empirical evaluation across data extraction, form filling, and fingerprinting tasks yields zero-shot compilation success rates of 80-94%. Crucially, the modularity of the JSON intermediate representation allows minimal Human-in-the-Loop (HITL) patching to elevate execution reliability to near-100%. At per-compilation costs between 0.002 USD and 0.092 USD across five frontier models, these results establish deterministic compilation as a paradigm enabling economically viable automation at scales previously infeasible under continuous architectures.