English

AgentProg: Empowering Long-Horizon GUI Agents with Program-Guided Context Management

Artificial Intelligence 2026-05-11 v2

Abstract

The rapid development of mobile GUI agents has stimulated growing research interest in long-horizon task automation. However, building agents for these tasks faces a critical bottleneck: the reliance on ever-expanding interaction history incurs substantial context overhead. Existing context management and compression techniques often fail to preserve vital semantic information, leading to degraded task performance. We propose AgentProg, a program-guided approach for agent context management that reframes the interaction history as a program with variables and control flow. By organizing information according to the structure of program, this structure provides a principled mechanism to determine which information should be retained and which can be discarded. We further integrate a global belief state mechanism inspired by Belief MDP framework to handle partial observability and adapt to unexpected environmental changes. Experiments on AndroidWorld and our extended long-horizon task suite demonstrate that AgentProg has achieved the state-of-the-art success rates on these benchmarks. More importantly, it maintains robust performance on long-horizon tasks while baseline methods experience catastrophic degradation. Our system is open-sourced at https://github.com/MobileLLM/AgentProg.

Keywords

Cite

@article{arxiv.2512.10371,
  title  = {AgentProg: Empowering Long-Horizon GUI Agents with Program-Guided Context Management},
  author = {Shizuo Tian and Hao Wen and Yuxuan Chen and Jiacheng Liu and Shanhui Zhao and Guohong Liu and Ju Ren and Yunxin Liu and Yuanchun Li},
  journal= {arXiv preprint arXiv:2512.10371},
  year   = {2026}
}

Comments

16 pages, 8 figures

R2 v1 2026-07-01T08:20:06.268Z