← Latest papers
🤖 machine learning

Agent JIT Compilation for Latency-Optimizing Web Agent Planning and Scheduling

This paper introduces Agent JIT Compilation, a framework comprising a planner, scheduler, and invariant-enforcing protocol that converts natural language tasks into executable code to achieve significant speedups and accuracy improvements over traditional sequential web agent loops.

Original authors: Caleb Winston, Ron Yifeng Wang, Azalia Mirhoseini, Christos Kozyrakis

Published 2026-05-21
📖 4 min read☕ Coffee break read

Original authors: Caleb Winston, Ron Yifeng Wang, Azalia Mirhoseini, Christos Kozyrakis

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to get a robot to do a complex errand for you, like "Order the cheapest taco from Taco Bell."

Currently, most robots work like a very cautious, slow human assistant. They look at the screen, ask a super-intelligent brain (an AI) what to do next, click a button, wait for the screen to change, ask the brain again, type a word, wait, and ask again. This "look-think-act" loop happens over and over. It's slow, expensive (because the AI brain costs money every time you ask it), and prone to mistakes because the robot might click the wrong thing if the screen looks slightly different.

This paper introduces a new way to make these robots faster and smarter, called Agent JIT Compilation. Think of it as switching from a "step-by-step instruction manual" to "writing a custom software script" before the robot even starts moving.

Here is how it works, broken down into three simple parts:

1. The "Pre-Flight" Planner (JIT-Planner)

Instead of asking the AI "What should I do next?" at every single step, the system first takes your request ("Order the cheapest taco") and instantly generates several different computer programs (code) that could solve the problem.

  • The Analogy: Imagine you need to drive from New York to Boston.
    • Old Way: You stop at every gas station to ask a local, "Which way is Boston?" You drive a mile, ask again, drive another mile, ask again.
    • New Way: Before you leave, you ask a map app to generate three different routes. It checks the traffic, the road conditions, and the distance. It picks the absolute fastest route and writes the GPS coordinates into your car's navigation system once. Then, you just drive.
  • The Magic: The system checks these generated routes to make sure they are logical (e.g., you can't click "Order" before you've clicked "Add to Cart"). It picks the one that uses the least amount of "brain power" (AI calls) and time.

2. The "Traffic Cop" (JIT-Scheduler)

Once the robot has a plan, it needs to decide how to run it. Should it do everything one by one? Should it try to do three things at once? Or should it try the same task three times in parallel and just use the first one that finishes?

  • The Analogy: Imagine you are ordering food for a party.
    • Serial (One by one): You call one restaurant, wait for the answer, call the next, wait...
    • Parallel: You call three restaurants at the same time.
    • Hedging: You call three restaurants, but you only care about the first one that picks up. If one is slow, you don't wait; you just take the answer from the fast one.
  • The Magic: The system looks at the specific task and uses past data to guess which strategy is best. If the task is simple, it goes one-by-one. If the task is tricky and might get stuck, it tries multiple paths at once (hedging) to ensure it finishes quickly. It picks the strategy that saves the most time.

3. The "Rulebook" (Invariant-Enforcing Protocol)

To make sure the robot doesn't crash or click the wrong button, every tool the robot uses (like "click button" or "type text") comes with a strict rulebook.

  • The Analogy: Think of a vending machine.
    • Old Way: You just push buttons randomly. Sometimes you push "Snack" when the machine is empty, and nothing happens.
    • New Way: The machine has a sensor. It checks: "Is the machine on? Is there money inside? Is the door closed?" If the conditions aren't met, the machine refuses to let you push the button.
  • The Magic: Before the robot runs the code, it checks these rules. If a plan tries to "Order" when the "Cart" is empty, the system catches that mistake before the robot even starts, preventing errors and wasted time.

The Results

The authors tested this on five different websites (like food delivery, email, and shopping sites). The results were impressive:

  • Speed: Their new method was 10 times faster than the standard "ask-the-AI-every-step" method.
  • Accuracy: It was also 28% more accurate, meaning it actually got the right taco 28% more often.
  • Comparison: Even compared to other advanced AI agents (like those from OpenAI or Anthropic), their method was 2.4 times faster and 9% more accurate.

Summary

In short, this paper says: Don't ask the AI to drive the car step-by-step. Instead, have the AI write the entire driving route as a script, check that the route is safe, pick the fastest way to drive it, and then just run the script. This turns a slow, stuttering conversation into a smooth, high-speed execution.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →