arXiv:2605.10913cs.AIcs.PL2026-05被引 4

让大模型代理可编程,实现快速回滚与状态修改。

Shepherd: Enabling Programmable Meta-Agents via Reversible Agentic Execution Traces

论文配图:Shepherd: Enabling Programmable Meta-Agents via Reversible Agentic Execution Traces
图 1 · 摘自论文原文
  • 将代理执行过程变为可逆的结构化日志,支持灵活操控。
  • 回滚速度比Docker快5倍,提升多代理协作效率。
  • 适合开发复杂代理系统的研究者和工程师使用。

随着大语言模型代理系统承担更复杂的任务,元代理(meta-agents)——即创建、操作和管理其他代理的高级代理——变得越来越重要。然而现有代理框架仅提供执行记录和环境快照,使元代理难以重建并操作完整执行状态。为此,我们提出Shepherd,一种基于函数式编程原理的Python框架,将代理执行本身作为可操作的一等对象。每个模型动作、工具调用和环境变化均被记录为结构化事件,形成类似Git的可逆执行轨迹,任意历史状态均可在5倍于Docker commit/fork的速度下回滚。三个应用案例验证其通用性:(1) 监督元代理避免并行编码代理冲突,使CooperBench上的配对编码通过率从28.8%提升至54.7%;(2) 反事实优化元代理通过修改流程并重播,以58%更低的运行时间,在Terminal-Bench 2.0上超越MetaHarness 12.8%;(3) 训练元代理在推演中选择分支点,改善长周期代理强化学习中的信用分配,使GRPO在Terminal-Bench 2.0上的提升翻倍。Shepherd已开源,支持用户与元代理对代理执行进行高效、严谨的操作。

原文摘要 · Abstract (English)

As LLM agent systems take on more complex tasks, they increasingly rely on meta-agents: higher-order agents that create, operate on and manage other agents. Meta-agent operations such as coordinating agents, halting risky actions before execution, or repairing failed runs, require runtime manipulation of agentic execution. Yet existing agentic substrates make this difficult: they expose only transcripts and environment snapshots, forcing meta-agents to build ad hoc tooling to reconstruct and operate over full execution state. Therefore, we introduce Shepherd, a Python substrate grounded in functional programming principles, where an agent's execution is itself a first-class object that a meta-agent can easily inspect and transform. Every model action, tool call, and environment change becomes a structured event in a reversible, Git-like execution trace, where any past state can be reverted 5x faster than docker commit and fork. Three example use cases show Shepherd's versatility: (1) a supervisor meta-agent prevents conflicts among parallel coding agents, lifting pair-coding pass rate from 28.8% to 54.7% on CooperBench; (2) a counterfactual optimization meta-agent repairs agent workflows by proposing edits and replaying runs from the point of changed behavior, outperforming MetaHarness on Terminal-Bench 2.0 by 12.8% with 58% lower wall-clock; (3) a training meta-agent picks fork points during rollouts to improve credit assignment in long-horizon agentic RL, doubling GRPO's uplift on Terminal-Bench 2.0. We open-source Shepherd to enable principled and efficient operations over agentic execution for both users and meta-agents.

元代理可逆执行智能体系统框架设计

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。