Trace2World: Reconstructing App Worlds from Real Interaction Traces for Scalable GUI Agent Training
Organizations: Nanjing University · Alibaba Token Hub, Alibaba Group · Beijing Institute of Technology
Abstract
Scaling GUI reinforcement learning requires environments that preserve real-app behavior. Yet coupling behavior inference with coding can turn partial traces into runnable mocks with incorrect state transitions. We introduce Trace2World, which separates global behavior reconstruction from implementation. It reconciles traces into a shared, source-linked app model, then compiles an executable environment. Independent replay of source workflows localizes mismatches for bounded implementation repair. Validated worlds then support learner-adaptive task and environment augmentation within source-supported behavior. From 1,570 traces, Trace2World constructs 50 environments. On 200 workflows across ten apps, 91.1% are reproduced end to end, versus 59.8% for the strongest matched task-local baseline. Source-grounded validation retains 94.0% of simulated training gains on real devices, versus 54.7% under self-validation. Learner guidance raises benchmark success from 56.9% to 61.1%. Training in Trace2World further improves the model by 20.2 points on our benchmark, 5.4--16.2 points across four external GUI benchmarks, and 16.3 points on 100 real-device tasks. Reliable reconstruction separates what behavior source evidence supports from whether the implementation preserves it.
Figures & tables
| Method | Overall | Structure | State | Data | |||
| All six | Reach | Surface | State | Effect | Terminal | ||
| Direct w/o traces | 5.2 | 28.4 | 14.8 | 22.7 | 15.0 | 15.9 | 12.8 |
| Direct + traces | 16.7 | 53.6 | 35.3 | 41.2 | 34.6 | 33.7 | 31.7 |
| CUA-Gym w/o traces | 8.2 | 34.4 | 20.0 | 29.0 | 22.6 | 21.5 | 19.6 |
| CUA-Gym + traces | 19.9 | 50.4 | 37.5 | 38.0 | 35.0 | 35.3 | 35.0 |
| PhoneWorld-style | 22.4 | 57.0 | 39.3 | 46.8 | 41.5 | 39.8 | 38.5 |
| Model | Trace2World-Bench (SR / PR) | MG SR / PR | AW SR | MW SR@50 | AD SR | ||||
| Entity repl. | Held-out workflow | Cross-app | Unseen apps | Overall | |||||
| Proprietary models | |||||||||
| Gemini 3.1 Pro | 75.1 / 82.2 | 69.0 / 76.2 | 58.0 / 67.0 | 65.7 / 71.9 | 68.9 / 76.1 | 31.3 / 44.6 | – | – | – |
| GPT-5.5 | 74.5 / 82.5 | 68.3 / 76.8 | 57.3 / 66.3 | 66.1 / 73.8 | 68.4 / 76.7 | – | – | 62.4 | – |
| Qwen3.7-Plus | 76.3 / 83.4 | 70.6 / 78.4 | 59.0 / 67.8 | 68.8 / 76.4 | 70.6 / 78.3 | 32.8 / 46.0 | 81.0 | 62.3 | 79.8 |
| Open-source GUI agents | |||||||||
| Matched stage-1 source | Stage 3 | ||
| Metric | Self- validation | Source-trace validation | Ours |
| Real gain | 9.7 2.1 | 15.7 1.5 | 16.3 2.1 |
| Sim. gain | 17.7 1.5 | 16.7 2.1 | 18.7 1.5 |
| Real/sim gain | 54.7% | 94.0% | 87.5% |
| Sim-only pass | 18.3% | 10.0% | 10.7% |
Appendix figures & tables70 assets
Supplementary material from the paper’s appendix.
Appendix
| Real / designed | Topic / task-local | Trace-grounded | ||||
| Axis | AndroidWorld | MobileGym | CUA-Gym | GUI-GENESIS | PhoneWorld | Trace2World |
| Construction input | real Android apps and task definitions | authored simulator and tasks | topic request | one traced task | real trajectories and screenshots | all app traces |
| Behavior representation | real app itself | authored state and actions | topic-based mock | task-local site | screen graph, page PRDs, mutable state | shared IDs, state/data, guards and effects |
| Cross-trace state/effect rule | native app | authored | topic specification | task-local | no explicit source-linked rule | guarded or unresolved |
| Implementation path | native apps | hand-authored simulator | Plan–Dev–Web agents | code agent | PRDs coding agent | model API compile agentic repair |
| Acceptance evidence | real-app task oracle | authored task checks | generated verifier and filter | code-native reward and golden path | smoke tests and human comparison | replay of every source workflow |
| Trace selection | Visual evidence | |||||
| Stratum | Apps | Candidate recordings | Selected traces | Retention | Selected screenshots | Screens / trace |
| Multi-service | 19 | 2,005 | 950 | 47.4% | 5,206 | 5.48 |
| Single-service | 31 | 4,536 | 620 | 13.7% | 4,712 | 7.60 |
| Full corpus | 50 | 6,541 | 1,570 | 24.0% | 9,918 | 6.32 |
| Layer | Evidence rule | App-specification commitment |
| Structure | Interaction topology that remains stable across tasks and runtime variation. | Canonical pages/surfaces, routes, containment, visible hosts, overlays, and bindings. |
| State | Launch-, guard-, or action-conditioned mutable variation owned by a canonical surface or entity. | Initialization deltas, fields, guards, reads/writes, reducers, projections, terminal conditions, and reset. |
| Data | Identity and attributes reused across pages or tasks, including stable resource bindings. | Canonical entities, attributes, relations, and resources rather than task-local aliases. |
| Layer | Packaged form | Owns | Boundary |
| Presentation | Static HTML/CSS/JavaScript; one page per canonical route | Renders and maps pointer or keyboard input to registered reads and actions | Disposable UI state only; no business state or task-specific product branches |
| State interface | One shared JavaScript client and typed same-origin API | Stable entity and affordance identity; registered reads, queries, and guarded transactions | No direct database or browser-storage writes; a failed guard cannot mutate state |
| State kernel | Packaged state module or same-origin service; immutable world plus one writable overlay per episode | Canonical entities, relations, fields, atomic transitions, revisions, diffs, and receipts | The world is immutable; overlays are session-isolated |
| Episode control | Private lifecycle and initial-state template | Creates, initializes, seals, resets, finalizes, and deletes an episode | Unreachable from pages; reset rebuilds the overlay and clears its ledger |
| Evaluation | Task/evaluator manifests and a read-only state view | Computes checkpoints and reward from finalized snapshots and diffs; receipts supplement order or count | Cannot mutate state or branch product behavior on task identity |
| Probe | Required verdict | False pass it exposes |
| Zero-action initial state | no progress, no reward | reward granted at launch; leaked prior state |
| Each legal partial stage | progress only | terminal credit for route-only arrival |
| Wrong entity or value | fail | terminal check that ignores the bound object |
| Premature terminal | fail | success declared before the required mutation |
| Repeated action | judged on final state | double credit from a historical maximum |
| Correct terminal | pass | missing verifier-visible consequence |
| Component | Scale | Role | Released artifact |
| Source traces | 1,570 / 50 apps | construction evidence; external fidelity authority | source recordings, action records, instructions, terminal contracts, collection metadata |
| Construction pipeline | one shared pipeline | trace reconciled specification environment | preprocessing, reconciliation, compilation, validation, and repair code |
| Environment portfolio | 50 apps / 10 domains | resettable GUI RL substrate | standalone packages with state and evaluator manifests |
| Training-task supply | 1,280 seed + 768 learner-guided | policy optimization | task, launch, support, and evaluator manifests |
| Trace2World-Bench | 1,044 tasks | frozen policy evaluation | task definitions, split identities, evaluators |
| Fidelity study | 200 workflows / 10 apps | reconstruction correctness | source/execution packets, reviewer labels, human adjudication |
| Action | Arguments | Definition |
| click / double_click / long_press | coordinate | tap, double-tap, or 500 ms press at the point |
| type | text | enter text into the focused editable control |
| swipe / scroll | direction; optional coordinate | finger-motion direction / content-motion direction |
| drag | start, end coordinates | drag from start to end |
| open_app | app name | open the named application (episode manifest only) |
| system_button | {home, back, enter} | press the system button |
| Field | Episode contract |
| Policy observation | Instruction, action history, three most recent screenshots, and feedback for the preceding rejected action; no trace, hidden state, or evaluator access. |
| Action unit | One call from Table D2 per policy decision. Invalid actions, wait , open_app , answer , and terminate each use one decision; a nonterminal call is followed by a new observation. |
| Geometry | The model uses coordinates, mapped through the current screenshot to the browser CSS viewport; each package declares its viewport and device scale. |
| Settling | Declared navigation targets wait up to 5 s; pointer and gesture actions add 50 ms. Before a screenshot, the host waits for fonts and an animation frame. wait is a separate, budgeted action. |
| Stop and score | A terminal call or the class cap ends the attempt. In both cases the task evaluator scores the final business state and required receipts; a declared success does not override its verdict. |
| Horizon | source-derived single-app; augmented single-app; two-app return composition. Single-app caps match across screening, RL, and evaluation; two-app tasks enter only the benchmark. |
| Domain | Policy-training apps (40) | Held-out eval app (10) |
| Social & community | WeChat; QQ; Weibo; Xiaohongshu | Zhihu |
| News & short video | Kuaishou; Bilibili; Toutiao; Tencent News | Douyin |
| Long video & audio | iQIYI; Youku; NetEase Cloud Music; Kugou Music; Ximalaya | QQ Music |
| Commerce & resale | Taobao; JD; Xianyu; Dewu | Pinduoduo |
| Local services & food | Meituan; Dianping; Dingdong Maicai; KFC; Hema | Ele.me |
| Mobility, travel & tickets | Amap; Ctrip; Didi; Railway 12306; Damai | Taopiaopiao |
| Evaluation set | Application coverage | Size / partition |
| Fidelity (construction-exposed) | 10-app reconstruction set | 200 workflows (16–26/app) |
| Trace2World-Bench | all 50 apps | 1,044 tasks |
| Policy-training-app subtotal | 40 policy-training apps / 10 frozen pairs | 868 tasks |
| Entity replacement | training-side workflow skeletons | 256 tasks |
| Held-out workflow | 20% signature split (320 seed + 192 aug.) | 512 tasks |
| Cross-app | 10 policy-training-app pairs | 100 tasks (10/pair) |
| Field | Value | Note |
| Initial policy | Qwen3.5-9B | no SFT warm-up |
| Objective | DAPO | clip-higher, dynamic sampling, token-level loss |
| Reward | checkpoint credit | Eq. 6 ; no format or length terms |
| / | 0.2 / 0.28 | DAPO defaults |
| KL / entropy coefficient | 0 / 0 | no reference model |
| Tasks / RL iteration | at most 40 | shuffled once per stage; no replacement |
| Task class | Tasks | Certified | Median | P90 | Max | |
| Source-derived single-app | 656 | 656 | 9 | 17 | 24 | 30 |
| Augmented single-app | 288 | 288 | 18 | 29 | 36 | 45 |
| Two-app return composition | 100 | 100 | 27 | 39 | 44 | 60 |
| Condition | Input | Behavior source | Validation |
| Direct Agent traces | app request; recordings in +traces | implicit in generated code | self-execution and debugging |
| CUA-Gym traces | topic/research; recordings in +traces | Plan-agent specification | Dev–Web loop against the plan |
| PhoneWorld-style (reimpl.) | recorded screens and transitions | screen types and page specifications | two independent screen-QA rounds with fixes |
| GUI-GENESIS-style (reimpl.) | one traced task per site | task-local site and co-written reward | static checks and own golden path |
| Trace2World, self-validation | same traces and construction stages | shared app specification | tests generated from the same interpretation decide validation |
| Trace2World | same real-app traces | reconciled Structure, State, and Data | independent source-trace review and state probes |
| Method / audit statistic | Overall | Structure | State | Data | |||
| All six | Reach | Surface | State | Effect | Terminal | ||
| Direct Agent w/o traces | 5.2 | 28.4 | 14.8 | 22.7 | 15.0 | 15.9 | 12.8 |
| Direct Agent + traces | 16.7 | 53.6 | 35.3 | 41.2 | 34.6 | 33.7 | 31.7 |
| CUA-Gym w/o traces | 8.2 | 34.4 | 20.0 | 29.0 | 22.6 | 21.5 | 19.6 |
| CUA-Gym + traces | 19.9 | 50.4 | 37.5 | 38.0 | 35.0 | 35.3 | 35.0 |
| PhoneWorld-style (reimpl.) | 22.4 | 57.0 | 39.3 | 46.8 | 41.5 | 39.8 | 38.5 |
| Method | Automated | Human | P/P | P/F | F/P | F/F | |
| Direct Agent + traces | 16.7 | 19.4 | 2.7 | 26 | 12 | 7 | 155 |
| CUA-Gym + traces | 19.9 | 22.1 | 2.2 | 31 | 12 | 7 | 150 |
| PhoneWorld-style (reimpl.) | 22.4 | 23.8 | 1.4 | 37 | 10 | 7 | 146 |
| GUI-GENESIS-style (reimpl.) | 59.8 | 63.6 | 3.8 | 108 | 18 | 10 | 64 |
| Trace2World | 91.1 | 93.5 | 2.4 | 178 | 9 | 4 | 9 |
| Control (not our method) | |||||||
| Population | Evidence support | Fresh-GUI validation and repair | Training use |
| Seed workflows 1,570 across 50 apps | 1,570 pass (100% of seeds) | 1,171 at wave 0 (74.6%); at waves 1/2/3; 1,570 validated, 0 unresolved | 1,280 seeds from the 40 training apps |
| Generated candidates 1,152 proposals across 40 apps | 985 pass (85.5% of proposals) | 673 at wave 0 (68.3% of supported); at waves 1/2/3; 853 validated (86.6%), 132 not validated by | 768 admitted (90.0% of validated) |
| Builder | Hours | Calls/app |
| Direct w/o traces | 0.92 | 248 |
| Direct + traces | 1.27 | 319 |
| CUA-Gym w/o traces | 1.82 | 344 |
| CUA-Gym + traces | 2.14 | 392 |
| PhoneWorld-style | 5.02 | 1,118 |
| GUI-GENESIS-style | 5.90 | 2,415 |
| Metric | Median | P95 | |
| Package on disk, raw / app | 50 | 18.9 MiB | 46.3 MiB |
| Package on disk, tar.gz / app | 50 | 8.2 MiB | 20.8 MiB |
| Writable state / episode | 50 | 0 KiB | 412 KiB |
| Host process to healthy API | 10 | 3.06 s | 3.42 s |
| First task initialization after display acquisition | 50 | 258 ms | 555 ms |
| Warm task reinitialization, init only | 150 | 229 ms | 512 ms |
| Review condition | Defects found (%) | Reported defects correct (%) | Defective execs. missed / 200 | Clean execs. flagged / 200 |
| Execution only | 43.2% | 73.6% | 34 | 42 |
| source trace | 68.4% | 88.2% | 8 | 28 |
| contrastive rubric | 86.0% | 93.0% | 1 | 20 |
| (a) Candidate funnel and fixed yield | ||||
| Round | Proposed | Source- supported | Validated | Selected |
| R1 | 576 | 499 | 426 | 384 |
| R2 | 576 | 486 | 427 | 384 |
| (a) Refinement accounting | ||
| Outcome | R1 | R2 |
| Refinable / validated | 60 / 426 (14.1%) | 62 / 427 (14.5%) |
| Recovered after first | 29 | 30 |
| Recovered after second | 7 | 7 |
| Recovered total | 36 (60.0%) | 37 (59.7%) |
| Held: no supported hardening | 9 | 9 |
| Model | Training apps | Unseen apps | All apps | |||
| Entity replacement | Held-out workflow | Cross-app | Overall | |||
| Proprietary Models | ||||||
| Qwen3.7-Plus | 76.3 / 83.4 | 70.6 / 78.4 | 59.0 / 67.8 | 71.0 / 78.7 | 68.8 / 76.4 | 70.6 / 78.3 |
| GPT-5.5 | 74.5 / 82.5 | 68.3 / 76.8 | 57.3 / 66.3 | 68.9 / 77.3 | 66.1 / 73.8 | 68.4 / 76.7 |
| Gemini 3.1 Pro | 75.1 / 82.2 | 69.0 / 76.2 | 58.0 / 67.0 | 69.5 / 76.9 | 65.7 / 71.9 | 68.9 / 76.1 |
| Gemini 3.5 Flash | 72.4 / 81.1 | 66.2 / 74.6 | 55.7 / 64.9 | 66.8 / 75.4 | 62.5 / 70.7 | 66.1 / 74.6 |
| Model | SR | PR | L1 | L2 | L3 | L4 | Atomic | Seq. | Transfer | Deep |
| Proprietary Models | ||||||||||
| Gemini 3.1 Pro | 31.3 | 44.6 | 100.0 | 56.2 | 20.5 | 2.5 | 77.3 | 41.8 | 7.1 | 19.1 |
| Doubao-Seed-2.0-Pro | 34.0 | 47.5 | 100.0 | 60.3 | 24.1 | 3.8 | 81.8 | 45.5 | 8.9 | 20.6 |
| Qwen3.7-Plus | 32.8 | 46.0 | 100.0 | 57.5 | 22.9 | 3.8 | 77.3 | 43.6 | 8.9 | 20.6 |
| Open-source Models | ||||||||||
| UI-Venus-2-27B | 60.5 | – | – | – | – | – | – | – | – | – |
| Model | Filter | Query | Analyze | Atomic | Comp. | Cond. | Low | Mid | High | Total |
| Proprietary Models | ||||||||||
| Qwen3.7-Plus † | – | – | – | – | – | – | – | – | – | 79.8 |
| Open-source Models | ||||||||||
| Qwen-UI-Agent-27B † | – | – | – | – | – | – | – | – | – | 97.5 |
| UI-TARS-1.5 † | 57.6 | 66.0 | 36.7 | 61.4 | 13.6 | 60.4 | 57.1 | 54.9 | 57.9 | 56.6 |
| Step-GUI-8B † | 52.5 | 63.8 | 33.0 | 59.1 | 14.0 | 42.9 | 54.1 | 44.6 | 61.5 | 52.5 |
| Model | Transp. (78) | Shop. (61) | Social (43) | Content (37) | Local (16) | Total |
| Base policy | 48.7 | 46.4 | 46.5 | 47.7 | 43.8 | 47.2 |
| Ours | 58.1 | 57.9 | 58.9 | 59.5 | 56.3 | 58.3 |
| Gain (pp) | +9.4 | +11.5 | +12.4 | +11.8 | +12.5 | +11.1 |
| Slice | Base env. | Base real | Trained env. | Trained real | Agreement | |
| Entity rebinding | 50 | 58.7 | 54.0 | 79.3 | 73.3 | 78.0 / 84.7 |
| Held-out workflow | 50 | 34.0 | 30.7 | 50.7 | 44.0 | 84.7 / 85.3 |
| All tasks | 100 | 46.3 | 42.3 | 65.0 | 58.7 | 81.3 / 85.0 |
RL for GUI Agents
Reinforcement learning for GUI agents trains screen-based AI to complete multi-step tasks across mobile, web, and desktop interfaces.
See all 50 papers