cs.AI, cs.CL, cs.LG · 2608.23670 · 2026-08-24
Automata from Agent Traces: Failure and Next-Step Prediction
Seonglae Cho, Franklin Cardenoso Fernandez, Umar Mohammed, Zekun Wu, Kleyton Da Costa, et al.
Agent TracesFinite-State MachineSafety Monitoring
💬 把整个 agent trace 语料库坍缩成一个紧凑的有限状态机,作为看似不可预测的 agent 行为的结构底座,同时支撑下一步预测和失败预测,且构建仅需毫秒级。
在 12 个公开数据集上,得到的 FSM 都很紧凑(7-43 个状态),在留出数据上以 ≥0.997 的拟合度重放、跨切分拓扑几乎一致,且构建只需毫秒级。这个底座同时服务两个预测目标:下一步预测上,FSM 状态上下文在每一个 ground-truth 匹配的数据集上都优于 Agent Workflow Memory;失败预测上,逐状态的行为特征在留出集上取得最高 0.94 的 AUROC,一个在线监控器能仅凭部分 trace 就把失败的运行排在成功运行之前,从而在任务完成前就能提前止损。作者认为行为拓扑更多是由部署所用的 harness 塑造的,而非由 LLM 本身决定,这为安全审计和运行时监控提供了一个与具体模型无关的结构化原语。
▶ Abstract
LLM-based agents execute multi-step tasks, but their behavioral structure remains opaque: long unstructured traces resist the safety auditing and runtime monitoring that deployment requires. Existing approaches operate per-trace or success-only, so they miss the cross-run topology that links next-step and failure prediction. To recover that shared structure, we collapse an entire trace corpus into a single, compact finite-state machine (FSM) that serves as a structural substrate for the otherwise unpredictable behavior of LLM agents. Across twelve public datasets, the FSMs are compact (7-43 states), replay held-out data at >=0.997 fitness with near-identical topology across splits, and build in milliseconds. This substrate addresses both prediction goals. For next-step prediction, FSM-state context outperforms Agent Workflow Memory on every ground-truth-matched dataset. For failure prediction, per-state behavioral features reach held-out AUROC up to 0.94, and an online monitor ranks failing runs above passing ones from a partial trace, triggering early stopping well before completion. Behavioral topology thus appears shaped more by the deployment harness than by the LLM, providing a model-agnostic structural primitive for safety auditing and runtime monitoring.