Keeping LLM Agents on Procedure: Executable Finite-State Control for Long-Horizon Instruction Fidelity
Yutao Sun, Haokun Li, Mingshuai Chen, Guanyan Li, Zhongyi Wang, Shengchao Qin, Jianwei Yin
Abstract
Much of the automation handed to language-model agents is procedural: each step needs little intelligence, but a long unattended run must follow a skill or SOP stated once at the start. We show that agents drift from such procedures over long runs, and that restating the instructions or resuming a stopped agent only moves the drift to another shortcut. We study an executable finite-state machine (FSM) that keeps the workflow state outside the model's context and enforces it at three points: tool calls, state transitions and the end of the agent's turn. In a pre-registered experiment on 200-account SOP-Bench batches, Claude Haiku 4.5 with the FSM decided on average 139 accounts correctly and by the procedure, against 48 for the strongest baseline (95% CI of the difference [46, 130]), and kept this rate to the end; across three models, the gain tracked how much the plain agent drifted. Because the runtime, not the model, supplies this long-horizon reliability, the FSM can let small models carry procedural work: Haiku 4.5 with it averaged more such decisions than plain Claude Sonnet 4.6 at 38% of the cost. Analyses on SWE-bench Verified, -bench, and staged and cross-context workflows further suggest that reliable long-horizon automation can come from stronger execution control, not only stronger models.
Create a lesson
Related papers
Dependable Long-Horizon LLM Agents: A Trajectory-Centered Empirical Study of Where Errors Enter and Which Controls Reach Them
Shared title terminology · Shaohuang Wang, Jinghao Wen, Xulei Zhang et al.
Infrathon: Benchmarking Language Agents for Real-World, Long-Horizon AI Infra Optimization
Shared title terminology · Zhengyu Hu, Zheyuan Xiao, Yike Wang et al.
Layer-Level Control of Language Model Execution in Agent Frameworks
Shared title terminology · Ran Guan, Yiqi Lin, Xiangxi Tian et al.
MatHarness: Towards Long-Horizon Open-ended AutoResearch for Computational Materials Science
Shared title terminology · Yanlin Fei, Lei Li, Shaolong Chen et al.
FinEvo: Recursive Self-Improvement for Long-Horizon Financial Modeling
Shared title terminology · Chengjun Pan, Shichun Liu, Zekai Zhou et al.
Improving the Improver: Semantic PID Control for Medical Agent Self-Improvement
Shared title terminology · Dexia Chen, YiLong Hu, Wenqi Zhong et al.