用可执行有限状态机控制 LLM Agent,长流程指令遵循显著提升
Keeping LLM Agents on Procedure: Executable Finite-State Control for Long-Horizon Instruction Fidelity
做 Agent 工作流的人该看看这篇:把 SOP 状态放到运行时的 FSM 里管,Haiku 4.5 就能比不带这套控制的 Sonnet 4.6 更稳,还省六成成本。实验有预注册和置信区间,方法可直接借鉴到自己的编排框架里。
一篇 arXiv 论文提出把工作流状态放在模型上下文之外的有限状态机(FSM)中,在工具调用、状态转换、回合结束三个点强制约束 Agent 行为,解决长流程运行中的步骤漂移问题。在预注册的 200 账户 SOP-Bench 批次实验中,Claude Haiku 4.5 加 FSM 平均正确且按规程决策 139 个账户,最强基线仅 48 个(差异 95% CI 为 [46, 130]),且能保持到流程结束。重述指令或恢复中断的 Agent 只会把漂移转移到别的捷径上,说明问题在上下文管理而非提示词。
由于长程可靠性由运行时而非模型提供,小模型也能承担程序化工作:带 FSM 的 Haiku 4.5 平均决策数超过不带 FSM 的 Claude Sonnet 4.6,成本只有其 38%。论文在 SWE-bench Verified、τ²-bench 及分阶段、跨上下文工作流上做了进一步分析,三个模型上的增益与其无 FSM 时的漂移程度正相关。
结论指向一条与堆模型能力不同的路线:长程自动化可以靠更强的执行控制实现,这对以 SOP 驱动的企业流程自动化有直接参考价值。
Keeping LLM Agents on Procedure: Executable Finite-State Control for Long-Horizon Instruction Fidelity
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, $τ^2$-bench, and staged and cross-context workflows further suggest that reliable long-horizon automation can come from stronger execution control, not only stronger models.
This report is categorized under AITOP's "Papers" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include Claude, Haiku, SOP-Bench, SWE-bench.
Source attribution: curated from arXiv cs.AI (@Yutao Sun, Haokun Li, Mingshuai Chen, Guanyan Li, Zhongyi Wang, Shengchao Qin, Jianwei Yin).