Chronicle: Cut-Point Replay for Regression Testing of LLM Agents

📄 arXiv: 2609.20625v1 📥 PDF

作者: Tisha Chawla, Susheem Koul

分类: cs.CL, cs.AI

发布日期: 2026-09-17

🔗 代码/项目: GITHUB


💡 一句话要点

提出Chronicle以解决LLM代理回归测试中的非确定性问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 回归测试 故障重现 非确定性 持续集成 切点重放 软件开发

📋 核心要点

  1. 现有的LLM代理故障重现困难,主要由于其非确定性和多步骤轨迹的复杂性。
  2. Chronicle通过在非确定性边界处记录运行,利用切点重放技术实现故障的可重现性和回归测试。
  3. 实验结果显示,Chronicle在6个记录故障的基准测试中表现出色,能够有效捕获故障并稳定运行。

📝 摘要(中文)

大型语言模型(LLM)的响应具有非确定性,这使得LLM代理的故障难以重现。现有的记录与重放方法主要用于追踪或评分,而非测试代码更改。本文提出Chronicle,通过在非确定性边界处记录代理运行,形成不可变的封装,并从记录中重放。其核心操作为切点重放,能够在新代码下执行记录的故障,转化为回归测试。实验表明,记录增加的时间开销极小,重放过程稳定且有效捕获故障,展示了该方法在持续集成中的应用潜力。

🔬 方法详解

问题定义:本文旨在解决大型语言模型代理的故障重现问题,现有方法在记录和重放过程中无法有效测试代码更改,导致故障难以复现。

核心思路:Chronicle的核心思路是通过在代理运行的非确定性边界处记录运行状态,形成不可变的封装,并利用切点重放技术在新代码下重放这些记录,从而实现故障的可重现性和回归测试。

技术框架:Chronicle的整体架构包括记录模块、重放模块和切点重放模块。记录模块负责捕捉代理运行中的非确定性边界,重放模块则从记录中重放这些边界,切点重放模块选择特定边界进行测试。

关键创新:Chronicle的主要创新在于切点重放技术,它允许在新代码下执行记录的故障,转化为回归测试。这一方法与传统的记录与重放方法不同,能够有效地测试代码更改的影响。

关键设计:在设计上,Chronicle使用了不可变的记录封装,确保记录的完整性和一致性。同时,切点重放的实现依赖于对记录边界的精确选择,以确保测试的有效性和准确性。具体的参数设置和损失函数设计在实验中进行了详细验证。

🖼️ 关键图片

img_0
img_1
img_2

📊 实验亮点

在6个记录故障的基准测试中,Chronicle的记录过程仅增加23微秒的时间开销,重放过程稳定且在20次重复中保持一致性。切点测试能够有效捕获所有故障代码,而基线方法未能捕获任何故障,显示出显著的性能提升。

🎯 应用场景

Chronicle的研究成果在软件开发和持续集成领域具有广泛的应用潜力,尤其是在大型语言模型的开发和测试过程中。通过提高故障重现的效率,开发者能够更快速地识别和修复问题,从而提升软件的可靠性和用户体验。未来,该方法还可以扩展到其他类型的非确定性系统中。

📄 摘要(原文)

Large language model responses are non-deterministic, so failures in LLM agents are hard to reproduce: a failure depends on inference that is not bitwise reproducible, on tools that read changing state, and on a multi-step trajectory that a re-run rarely repeats. Record-and-replay makes a run reproducible, but existing agent tooling records runs only to trace or score them, not to test a code change against them. We present Chronicle, which records an agent run at its non-deterministic boundaries as immutable envelopes and replays it from the record. Its central operation, cut-point replay, serves a chosen subset of boundaries from the record and executes the complementary subset live with new code, turning a recorded incident into a regression test that runs in continuous integration. On a benchmark of 6 recorded failures with simulated model boundaries, recording adds 23 μs per crossing (0.008% of an assumed 300 ms model call), full replay issues zero model calls and is bit-stable across 20 repetitions, and cut-point tests fail on faulty code and pass on guarded and benign changes for all 6 incidents. In a mutation study of the guarded tools, cut-point tests catch every mutant that lets the recorded unsafe action through, while a baseline that stubs every boundary, using the same assertion, catches none. Chronicle and the benchmark are publicly available at https://github.com/theagentplane/chronicle.