来自代理轨迹的自动机:失败与下一步预测
观点分析 · 2026/08/27
基于LLM的智能体执行多步任务,但其行为结构不透明,长而杂乱无章的轨迹阻碍了安全审计和运行时监控。现有方法要么逐轨迹处理,要么只处理成功案例,因此错过了连接下一步预测和失败预测的跨运行拓扑。为了恢复这种共享结构,我们将整个轨迹语料库压缩成一个紧凑的有限状态机(FSM),作为LLM智能体不可预测行为的结构基础。在12个公共数据集上,FSM紧凑(7-43个状态),对保留数据的回放适应度≥0.997,跨分割的拓扑几乎相同,且构建时间在毫秒级。该基础解决了两个预测目标:对于下一步预测,FSM状态上下文在所有匹配真实标签的数据集上优于Agent Workflow Memory;对于失败预测,每状态行为特征在保留数据上的AUROC最高达0.94,在线监控器能从部分轨迹中区分失败和成功运行,提前触发早停。行为拓扑似乎更多由部署框架而非LLM塑造,为安全审计和运行时监控提供了与模型无关的结构原语。
该论文提出了一种新颖且实用的方法,将LLM智能体的行为轨迹转化为紧凑的有限状态机,从而同时解决下一步预测和失败预测问题。其方法在多个数据集上验证有效,且发现行为拓扑主要由部署环境决定,这为安全审计和运行时监控提供了新的视角和工具。对于关注LLM智能体可靠性和安全性的研究者,该文提供了重要的结构原语和实证结果。
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.