跳转至

解析流式数据:面向长程智能体及其观察者的实时追踪模型

文章背景与核心概要

随着人工智能智能体(AI Agents)的工作周期变得越来越长,其执行过程中产生的追踪数据(Execution Traces)也变得异常庞大,无论是人类监控人员还是智能体自身有限的上下文窗口,都难以对其进行高效处理。本文引入了一种全新的实时追踪模型(Live Trace Model)——它本质上是一个只追加(Append-only)的事件分类账本,能够增量式地折叠(Fold)进带类型的运行状态中,并为每个消费者编译出专用的视图。

通过与确定性基准(Ground Truth)进行对比评估,该实时追踪模型在人类观察者和智能体自身的令牌效率(Token Efficiency)、成本削减、准确性以及可审计性方面,均展现出了显著的性能提升。


📌 执行摘要 (Executive Summary)

As AI agents operate over increasingly long horizons, their execution traces grow too massive for either human monitors or the agents' own bounded contexts to handle efficiently. This paper introduces a live trace model—an append-only event ledger that is incrementally folded into a typed run state and compiled into specialized views for each consumer.

Evaluated against deterministic ground truth, the live trace model demonstrates significant improvements in token efficiency, cost reduction, accuracy, and auditability for both human observers and the agents themselves.

随着人工智能智能体(AI Agents)的工作周期变得越来越长,其执行过程中产生的追踪数据(Execution Traces)也变得异常庞大,无论是人类监控人员还是智能体自身有限的上下文窗口,都难以对其进行高效处理。本文引入了一种全新的实时追踪模型(Live Trace Model)——它本质上是一个只追加(Append-only)的事件分类账本,能够增量式地折叠(Fold)进带类型的运行状态中,并为每个消费者编译出专用的视图。

通过与确定性基准(Ground Truth)进行对比评估,该实时追踪模型在人类观察者和智能体自身的令牌效率(Token Efficiency)、成本削减、准确性以及可审计性方面,均展现出了显著的性能提升。


📑 概述与关键发现 (Overview & Key Findings)

1. 面向人类观察者(监控人员)

  • 性能表现: 以大模型阅读器作为代理,经编译后的视图在回答监控问题时,与受预算限制、单次调用的原始追踪数据读取方式相比,输入令牌数量减少了 14 到 15 倍,且成本降低了 5 到 7 倍
  • 准确率: 达到了 0.85–0.87 的准确率,而直接读取原始追踪数据的准确率仅为 0.48(注:由于问题是与视图架构共同设计的,因此令牌/成本的减少被视为条件受限于架构的覆盖范围)。

1. For Human Observers (Monitors)

  • Performance: Using an LLM reader as a proxy, the compiled view answers monitoring questions with 14× to 15× fewer input tokens and at 5–7× lower cost than a budget-capped, single-call reading of the raw trace.
  • Accuracy: Achieves an accuracy of 0.85–0.87, compared to 0.48 for raw trace reading. (Note: Because questions were co-designed with the view schema, token/cost reductions are treated as conditional on schema coverage).

2. 面向长程智能体

  • 顺序任务: 在包含 120 个链接的顺序依赖任务中,采用在每一步状态中维护运行统计机制的方法,能够在全上下文提示词失效的情况下取得成功(在清晰协议下为 30/30 对比 8/30\(n=30\))。
  • 便签(Scratchpads)与折叠(Folds)的对比: 提示词级别的便签(Scratchpad)能以更低的成本匹配折叠机制的准确率。然而,双臂消融实验(Two-arm decomposition)表明,折叠机制之所以具备高准确率,归功于其确定性的聚合结果,而其成本优势则源于其紧凑性。
  • 核心优势: 折叠机制相较于更廉价替代方案的主要价值在于其确定性的可审计性,以及它能够为人类观察者提供完全相同的底层状态服务。

2. For Long-Horizon Agents

  • Sequential Tasks: On 120-link sequential-dependency tasks, mechanisms maintaining running statistics in per-step state succeed where full-context prompting fails (30/30 vs. 8/30 under a clean protocol, \(n=30\)).
  • Scratchpads vs. Folds: A prompt-level scratchpad matches the fold's accuracy at a lower cost. However, a two-arm decomposition attributes the fold's accuracy to its deterministic aggregate and its cost advantage to its compactness.
  • Key Advantage: The fold's primary value over cheaper alternatives lies in its deterministic auditability and its ability to serve the human observer from the exact same underlying state.

3. 理论与实践贡献

  • 基于观察到的系统故障,归纳出了追踪折叠的十一项候选需求
  • 通过一个顺序敏感的任务族(在此任务族中折叠不再带来收益)对这些需求进行了界定。
  • 完全开源了实现代码、基准测试以及数据集。

3. Theoretical & Practical Contributions

  • Derives eleven candidate requirements for trace folding based on observed system failures.
  • Delimits these requirements using an order-sensitive task family where the fold ceases to provide a benefit.
  • Fully open-sourced implementation, benchmarks, and datasets.

🔗 资源与工件 (Resources & Artifacts)