Agents · Efficiency · Memory

PreAct

First page
PreAct
Paper summary

Computer-using agents drive real software through the screen, but they solve every task from scratch. Ask one to repeat a task and it re-reads the screen and re-reasons every tap, paying the full cost again. PreAct fixes this by compiling the first successful run into a small state-machine program, where states check the screen and transitions act, then replaying that program on later runs instead of invoking the agent.

Ask this paper

Key points
01

Compile runs into a state machine: A completed task is captured as an explicit program rather than a free-form trace, turning a one-off solution into a reusable artifact that can be executed deterministically.

02

Replay with no per-step model calls: Replaying the compiled program runs 8.5 to 13 times faster than the agent because it needs no per-step language-model calls on repeated tasks.

03

Safe by construction: At each step PreAct checks that the screen matches what the program expects before acting, and hands control back to the agent the moment something is off, and it only stores programs an independent evaluator confirms solve the task from a clean state.

04

Why it matters: This turns computer-using agents from interactive tools that re-reason everything into repeatable operational systems, which is exactly what is needed to deploy them on recurring real work.

Abstract

Computer-using agents drive real software through the screen -- clicking and typing -- but they solve every task from scratch: asked to repeat a task, an agent re-reads the screen, re-reasons every tap, and pays the full cost again. We present PreAct, which lets such an agent get faster on tasks it has done before. The first time it succeeds, PreAct compiles the run into a small state-machine program-states that check the screen, transitions that act-and on later runs replays it directly instead of invoking the agent 8.5-13x faster, with no per-step language-model calls. Replay is not blind: at each step PreAct checks that the screen matches what the program expects before acting, and hands control back to the agent the moment something is off. PreAct applies the same discipline when deciding what to keep: a freshly compiled program enters the store only if, re-run from a clean state, an independent evaluator confirms it solved the task-catching programs that replay to their last step yet leave the task undone. Across a mobile, a desktop, and a web benchmark, this store-time check separates repeated runs that improve from ones that degrade as faulty programs accumulate, worth 1.75-2.6 tasks per benchmark, the same direction on all three; a fallback that explores afresh when no program fits brings PreAct level with a strong record-and-replay baseline. We also report what did not matter: prompt wording, runtime guardrails, and whether a language model or a plain embedding retriever selects which program to reuse.

Every Monday
Get next week’s papers.
Subscribe on Substack