Blolabel
← Notes
analysis 9 min read

A compiled GUI routine repays itself after 1.4 to 15.5 uses, and failed compiles took two thirds of the tokens; phoneshell records macros for free and has replayed one once

Ming, Xu, Wu and Jia put a price on the idea that a phone agent should stop re-deriving routes it already found. The per-use saving is near total. The cost is in the compiles that fail and the routines nobody reuses. We compared it with phoneshell's own answer, which costs nothing to make and checks less.

Turning a repeated GUI task into a program saves 93.6% to 99.9% of the agent's tokens on every later use, but the first program takes 1.39 to 15.5 uses to repay, and 9 of 20 compilation attempts produced nothing usable while consuming 67.7% of the compilation tokens. That is the measurement in PACE, posted on 2 October 2026. phoneshell avoids the compile cost entirely by recording sessions as macros. Its runtime holds one, with no post-step checks, replayed once in 785 logged actions.

Abstract technical illustration of a looping path being straightened into a short direct line, with faint discarded loops around it

What PACE measured

Yulong Ming, Jie Xu, Zihan Wu and Xiaohua Jia (City University of Hong Kong, arXiv:2610.02932) take seven task families: four from AndroidWorld (Contacts add, Markor delete, Calendar add event, OsmAnd marker), LibreOffice Calc and Writer tasks in an OSWorld-based container, and a WebArena Reddit comment. Three models, GLM-5.3-flash, DeepSeek-V4-flash-vision-exp and Qwen3.8-flash, each try to compile each family into a program from successful agent traces, giving 20 cells with records (Qwen's provider refused the web task). A program counts only if it passes 3 of 3 source tasks, with up to 3 refinements per task. Costs are in weighted tokens: one unit per uncached input token at the model's reference price.

ProgramCompile cost (K)Agent per use (K)Program per use (K)Payback, compile onlyPayback, with source runsSource
GLM, Contacts13798.70.4251.394.4Tables 1, 5
Qwen, Contacts13839.20.5523.76.85Tables 1, 5
GLM, Markor delete14433.70.3324.317.34Tables 1, 5
DeepSeek, Markor delete15610.80.33115.518.7Tables 1, 5
Qwen, Markor delete21221.50.3881013.1Tables 1, 5
GLM, Calendar3,4243140.64010.913.9Tables 1, 5
DeepSeek, Calc table3,0576470.6774.737.74Tables 1, 5
GLM, Writer memo47370.20.5966.89.82Tables 1, 5
DeepSeek, Writer memo25950.70.6925.188.22Tables 1, 5
Qwen, Writer memo48737.00.72413.416.5Tables 1, 5
GLM, Reddit comment4371240.7163.556.57Tables 1, 5
Failed: DeepSeek Contacts 605; DeepSeek and Qwen Calendar 2,872 and 1,936; OsmAnd 3,082, 1,701, 1,552 (no model); GLM and Qwen Calc 2,544 and 3,054; DeepSeek Reddit 1,397 (lower bound)Table 1

The payback column is short because the per-use saving is nearly total. DeepSeek on Markor needs the most uses, 15.5, because its agent was already cheap at 10.8K a run. GLM on Calendar is expensive to compile, 3,424K, and still repays in 10.9 uses because the agent burns 314K per run. Compiled programs were also more reliable in the matched Android replays: GLM Calendar's agent succeeded 14 of 30 times against the program's 30 of 30. In a live OpenApps Calendar study the agent succeeded 7 of 12 times with mean cost bounded between 8.142 and 21.590 milli-USD; program plus fallback succeeded 11 of 12 between 1.202 and 4.564, and all 8 runs on a changed interface fell back to the agent, 7 successfully.

Uses needed before a compiled program repays its compilation compile-only payback (uses) 0 4 8 12 16 uses to break even 1.39 GLM Cont. 3.55 GLM Redd. 3.7 Qwen Cont. 4.31 GLM Mark. 4.73 DS Calc 5.18 DS Writ. 6.8 GLM Writ. 10 Qwen Mark. 10.9 GLM Cal. 13.4 Qwen Writ. 15.5 DS Mark. Source: Ming, Xu, Wu, Jia, arXiv:2610.02932, Table 1. Excludes failed attempts and replacement after drift.

The cost the payback column leaves out

Only 3 programs passed before repair. Summing Table 1, successful first attempts used 8,924K weighted tokens and failed ones 18,743K. The paper's payback counts exclude that failed two thirds by construction, and a team choosing which families to compile does not know in advance which third it will land in: OsmAnd marker failed for all three models. PACE's online algorithm exists for exactly this, weighing estimated savings against compile cost including failures, inside a cumulative budget, and on recorded arrival traces it saved in 9 of 12 conditions. It lost to never compiling on all three Sepsis-log conditions. The headline figures, 17.3% against ReAct and 24.9% against an AutoRPA adaptation, are averages of ratios across those 12. The ToolPro figure equals the ReAct one because ToolPro never compiled in any tested condition.

Where PACE's compilation tokens went (first attempts, 20 cells) thousand weighted tokens 0 5000 10000 15000 20000 K weighted tokens 8,924K (32.3%) succeeded (11 attempts) 18,743K (67.7%) failed (9 attempts) Source: arXiv:2610.02932 Table 1, our sum. DeepSeek Reddit (1,397K) is a lower bound.

phoneshell compiles for free and checks less

phoneshell's answer to the same problem is in agent/macros.py. A Recorder keeps the last 200 steps of a session; phone_macro_save writes them to YAML with no model call, so compilation costs zero tokens and payback starts at the first reuse, if the replay works. Each step can carry an anchor, text that must be on screen before it fires, and an expect, text that must be on screen after. A missing anchor stops the replay and hands the screen back to the model, which is PACE's fallback in another form.

Two ways to turn a repeated phone task into a routine PACE (compile) agent runs the tasktrace kept model writes a program137K to 3,424K tokensup to 9 repairs verify: 3 of 311 of 20 pass run, else fall back0.33K to 0.72K per use phoneshell (record) agent runs the taskRecorder keeps 200 steps phone_macro_save0 model tokens no verification runsaved as YAML replay, stop if theanchor is missing about-screen.yaml, the one saved macro: open_app Settings, tap General, tap About. anchors: "", "Settings", "Settings". expect: "", "", "". runs: 1, failures: 0. With every expect empty, a replay that ends on the wrong screen reports success. Sources: arXiv:2610.02932 Sec. 3, Table 1; phoneshell agent/macros.py, runtime/macros/about-screen.yaml.

What phoneshell does not do is PACE's verification. Nothing replays a macro against fresh inputs before it is saved, and the recorder fills expect only when a caller passes one. In the runtime directory on 5 October 2026 there is one macro, about-screen.yaml: open Settings, tap General, tap About, with anchors "", "Settings", "Settings" and three empty expects, runs: 1, failures: 0. The audit log from 7 September to 1 October 2026 holds 785 events, two macro names saved (about-screen, and an 8-step test-grab-order learned from a demonstration on 30 September, which is no longer in the directory) and one macro_run. The module's docstring says replay is "worth roughly twenty points of task success" and "cuts token use by most of an order of magnitude". It cites nothing. PACE's per-use saving supports the token half. Our usage supports neither, because the macros are not being reused.

What it means if you are deciding what to automate on a phone

Check it yourself

What would prove this wrong

Our claim is that a recorded macro without post-step checks will sometimes succeed on paper and fail on the phone. Test: fill expect for every step from the recorded post-step screen, replay each saved phoneshell macro 30 times with varied inputs, and compare the expect verdict with the result recorded when expect is empty. If the two never disagree in 30 runs of any macro with an input slot, the missing check costs nothing in practice and this note is wrong about it. We expect at least one disagreement. We will publish the run, or say we did not run it, by 31 March 2027.

Sources

  1. Ming, Xu, Wu, Jia, When to Compile a Computer-Use Agent? Measuring Payback and Making Compilation Decisions for Token Efficiency, arXiv:2610.02932v1, 2 October 2026
  2. PACE measurement records, policies and paired outcomes, released with the paper
  3. phoneshell source: agent/macros.py, mcp_server.py (read 5 October 2026); runtime/macros and runtime/logs/audit.jsonl on the rig
  4. Blolabel, earlier note: shortcut catalogs help until they grow