跳转至

跨回合智能体记忆的失效契约

文章背景与核心概要

大型语言模型(LLM)智能体通常会缓存来自先前API错误的恢复建议,以避免在未来的执行回合中进行昂贵的重新推导,从而节省Token消耗和模型调用次数。然而,服务端的数据漂移经常使这些缓存的修复方案变成静默失败的隐患。尽管在每个回合重新推导可以解决此问题,但这完全抵消了缓存带来的效率提升。

本文引入了失效契约(invalidation contracts),这是一种新颖的协议层,它将版本标记和可缓存性提示附加到恢复建议中。这使得客户端能够在无需试错的情况下准确驱逐过期条目,同时保留有效的条目。


Authors: Michael Wu, Arquimedes Canedo
Primary Subject: Artificial Intelligence (cs.AI)
arXiv: 2609.00243 [cs.AI] | DOI: 10.48550/arXiv.2609.00243
Submitted: 31 August 2026


执行摘要 (Executive Summary)

大型语言模型(LLM)智能体通常会缓存来自先前API错误的恢复建议,以避免在未来的执行回合中进行昂贵的重新推导,从而节省Token消耗和模型调用次数。然而,服务端的数据漂移经常使这些缓存的修复方案变成静默失败的隐患。尽管在每个回合重新推导可以解决此问题,但这完全抵消了缓存带来的效率提升。

本文引入了失效契约(invalidation contracts),这是一种新颖的协议层,它将版本标记和可缓存性提示附加到恢复建议中。这使得客户端能够在无需试错的情况下准确驱逐过期条目,同时保留有效的条目。

Large Language Model (LLM) agents often cache recovery suggestions from previous API errors to bypass costly re-derivation in future episodes, conserving both tokens and model calls. However, server-side data drift frequently turns these cached fixes into silent failures. While re-deriving on every episode solves this problem, it completely negates the efficiency gains of caching.

This paper introduces invalidation contracts, a novel protocol layer that attaches version stamps and cacheability hints to recovery suggestions. This allows clients to accurately evict stale entries without trial-and-error while retaining valid ones.


核心发现与方法论 (Key Findings & Methodology)

  • 收益分解: 该契约成功地将实际实现的收益分解为两个独立因素:
  • 有效性(Validity): 漂移后仍然正确的缓存建议比例(与协议相关且与供应商无关)。
  • 合规性(Compliance): 规划器在第一次尝试时应用的建议比例(与模型相关)。
  • 模型合规性差异: 相同的负载产生了截然不同的合规行为:
  • Claude Haiku 4.5: 实现了 100% 的初次尝试合规率。
  • Claude Sonnet 5: 由于输入模式保守性(拒绝引入原始请求中不存在的字段的修复方案),其合规性表现为 11% 或更低。
  • 粒度性能:
  • 行级失效在所测试的模型中将合规性提升了 0 到 66.7 个百分点(其中三个模型提升了 55.6–66.7 个百分点),并为七分之四的模型恢复了 29–33% 的基线 Token 成本。
  • 表级失效灾难性地破坏了同地协作(co-located)的条目,导致七分之五个模型的漂移后初次尝试成功率降至 0%。
  • 鲁棒性与开销:
  • 使用行级预言机(oracle)时,所有评估模型的驱逐精确度均达到了完美的 1.00
  • 该契约引入了极小的 15% 负载开销
  • 版本标记的有效性被证明完全是确定性的,在所有评估和服务的路径中产生相同的结果,并且在整个评估过程中零契约失效
  • Decomposition of Savings: The contract successfully separates realized savings into two independent factors:
  • Validity: The proportion of cached suggestions that remain correct post-drift (protocol-dependent and vendor-agnostic).
  • Compliance: The proportion of suggestions applied by the planner on the first attempt (model-dependent).
  • Model Compliance Discrepancies: Identical payloads yielded vastly different compliance behaviors:
  • Claude Haiku 4.5: Achieved 100% first-try compliance.
  • Claude Sonnet 5: Exhibited 11% or lower compliance due to input-schema conservatism (refusing fixes that introduce fields absent from the original request).
  • Granularity Performance:
  • Row-level invalidation raised compliance by 0 to 66.7 percentage points across tested models (55.6–66.7 points on three of them) and recovered 29–33% of baseline token costs for four out of seven models.
  • Table-level invalidation catastrophically destroyed co-located entries, dropping post-drift first-try rates to 0% on five of the seven models.
  • Robustness & Overhead:
  • Eviction precision reached a flawless 1.00 at row granularity across all evaluated models using the row-level oracle.
  • The contract introduced a minimal 15% payload overhead.
  • Version-stamp validity proved entirely deterministic, producing identical outcomes across all models and serving paths with zero contract failures throughout the evaluation.

评估范围 (Evaluation Scope)

该方法在以下方面进行了严格测试: * 7 个不同的模型 * 3 条服务路径 * 2 个领域 * 大约 9,400 个执行回合

The approach was rigorously tested across: * 7 distinct models * 3 serving paths * 2 domains * Approximately 9,400 execution episodes