Good to Go: The LOOP Skill Engine That Hits 99% Success and Slashes Token Usage by 99% via One-Shot Recording and Deterministic Replay

📄 arXiv: 2605.14237v1 📥 PDF

作者: Xiaohua Wang, Kai Yu, XuXiao Liang, Liang Wang, Chao Han

分类: cs.AI

发布日期: 2026-05-14

备注: 8 pages, 5 tables


💡 一句话要点

LOOP Skill Engine:通过一次记录和确定性回放,实现99%成功率并降低99% Token消耗

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

关键词: LLM Agent 确定性回放 Token优化 周期性任务 自动化 工具调用 参数化 buddyMe

📋 核心要点

  1. 现有方法依赖LLM进行重复性任务,面临随机性导致失败和Token成本过高的挑战。
  2. LOOP SKILL ENGINE通过记录一次成功的LLM执行轨迹,生成确定性回放的Loop Skill,避免重复调用LLM。
  3. 实验结果表明,该方法在周期性任务中显著降低Token消耗和执行延迟,同时保证高成功率。

📝 摘要(中文)

针对重复性周期任务中AI Agent部署面临的大语言模型(LLM)灵活性与随机性、高Token成本之间的矛盾,本文提出了LOOP SKILL ENGINE。该系统通过一次记录、确定性回放的范式,实现了99%的成功率和99%的Token消耗降低。首次运行时,Agent利用LLM进行完整推理并执行任务,系统透明地拦截并记录完整的工具调用轨迹。然后,贪婪的降序长度模板提取算法将此记录转换为参数化的、无分支的Loop Skill——一种确定性的执行计划,捕获任务的功能意图,同时参数化时间相关和结果相关的变量。后续执行完全绕过LLM:引擎根据实时值解析模板变量,并确定性地回放工具序列。论文证明了回放确定性和写入安全性两个定理。实验表明,在5分钟到24小时的周期性Agent任务基准测试中,Loop Skill Engine每月Token消耗降低93.3%--99.98%,执行延迟降低8.7倍,并消除了输出不确定性。多层降级策略保证任务永不停止。该引擎已作为buddyMe开源Agent框架的一部分发布。

🔬 方法详解

问题定义:论文旨在解决在重复性周期任务中使用LLM驱动的Agent时,由于LLM的随机性和高昂的Token成本所带来的问题。现有方法每次执行任务都需要调用LLM,导致结果不稳定且成本不可控。

核心思路:核心思路是“一次学习,多次复用”。通过记录一次成功的LLM执行轨迹,将其转化为确定性的、参数化的Loop Skill。后续执行直接复用该Loop Skill,避免重复调用LLM,从而降低成本并提高稳定性。

技术框架:LOOP SKILL ENGINE包含以下主要模块:1) 记录模块:首次执行时,记录LLM的工具调用轨迹。2) 模板提取模块:将记录的轨迹转换为参数化的Loop Skill,提取任务的关键步骤和参数。3) 回放模块:后续执行时,根据实时值解析Loop Skill中的参数,并确定性地回放工具序列。4) 降级策略模块:在回放失败时,提供多层降级策略,保证任务的持续执行。

关键创新:最重要的创新点在于将LLM的推理过程转化为确定性的执行计划(Loop Skill)。与现有方法每次都依赖LLM进行推理不同,该方法只需要LLM进行一次推理,后续执行直接复用推理结果,从而显著降低了Token消耗和执行延迟。

关键设计:关键设计包括:1) 贪婪降序长度模板提取算法:用于从记录的轨迹中提取Loop Skill,保证提取的模板尽可能长,从而减少参数的数量。2) 参数化策略:对时间相关和结果相关的变量进行参数化,使得Loop Skill可以适应不同的执行环境。3) 多层降级策略:包括重新参数化、重新规划等,保证在回放失败时任务能够继续执行。

📊 实验亮点

实验结果表明,LOOP SKILL ENGINE在周期性Agent任务中,每月Token消耗降低93.3%--99.98%,执行延迟降低8.7倍,并消除了输出不确定性。在成功率方面,该引擎达到了99%。这些结果表明,该方法在降低成本、提高效率和保证稳定性方面具有显著优势。

🎯 应用场景

该研究成果可广泛应用于需要重复执行的自动化任务中,例如:定时发送邮件、监控系统状态、自动更新数据等。通过降低Token消耗和提高执行效率,可以显著降低AI Agent的部署成本,并提高其在实际应用中的可用性。未来,该方法可以扩展到更复杂的任务中,例如:涉及多个Agent协作的任务。

📄 摘要(原文)

Deploying AI agents for repetitive periodic tasks exposes a critical tension: Large Language Models (LLMs) offer unmatched flexibility in tool orchestration, yet their inherent stochasticity causes unpredictable failures, and repeated invocations incur prohibitive token costs. We present the LOOP SKILL ENGINE, a system that achieves a combined 99% success rate and 99% token reduction for periodic agent tasks through a one-shot recording, deterministic replay paradigm. On its first run, the agent executes the task with full LLM reasoning while the system transparently intercepts and records the complete tool-call trajectory. A greedy length-descending template extraction algorithm then converts this recording into a parameterized, branch-free Loop Skill -- a deterministic execution plan that captures the task's functional intent while parameterizing time-dependent and result-dependent variables. All subsequent executions bypass the LLM entirely: the engine resolves template variables against real-time values and replays the tool sequence deterministically. We prove two theorems: (1) Replay Determinism -- the step sequence of a validated Loop Skill is invariant across all future executions; (2) Write Safety -- concurrent access to persistent configuration is serialized through reentrant locks and atomic file replacement. Across a benchmark of periodic agent tasks spanning intervals from 5 minutes to 24 hours, the Loop Skill Engine reduces monthly token consumption by 93.3%--99.98% and cuts execution latency by 8.7x while eliminating output non-determinism. A multi-layer degradation strategy guarantees that tasks never stall. We release the engine as part of the buddyMe open-source agent framework.