Automata from Agent Traces: Failure and Next-Step Prediction

Seonglae Cho, Franklin Cardenoso Fernandez, Umar Mohammed, Zekun Wu, Kleyton Da Costa, Ilham Wicaksono, Adriano Koshiyama

arXiv:2608.23670 · 2026-08-26 공개 · arXiv · PDF

llm-agents model-agnostic runtime-monitoring failure-prediction agent-traces safety-auditing finite-state-machine next-step-prediction

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.

한국어 요약

한 줄 요약

LLM 에이전트의 실행 트레이스를 기반으로 생성된 FSM이 다음 단계 예측과 실패 예측 성능을 동시에 향상시킨다.

핵심 기여도

핵심 아이디어

LLM 기반 에이전트는 복잡한 다단계 작업을 수행하지만, 그 행동 구조는 불투명하다. 기존 방법은 개별 트레이스 또는 성공 사례만을 기반으로 하여, 다음 단계와 실패 예측 간의 공통 구조를 포착하지 못한다. 본 연구는 전체 트레이스 코퍼스를 단일 FSM으로 압축하여, 에이전트의 예측 불가능한 행동에 구조적 기반을 제공한다. 이 FSM은 각 상태에서 행동 특성을 기반으로 실패 예측 모델을 학습하고, 다음 단계 예측을 위한 문맥 정보를 제공한다. 특히, FSM은 학습 하이퍼파라미터 없이 결정론적 알고리즘으로 생성되며, 동일한 FSM이 4개의 LLM 모델에서 모두 완벽한 정확도를 보인다.

기술적 접근법

주요 결과

의의 및 한계

실용적 활용