arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.14914cs.CL
收藏

CodeDelegator: 通过角色分离缓解上下文污染在代码作为行动代理中

CodeDelegator: Mitigating Context Pollution via Role Separation in Code-as-Action Agents

Large Language Model Department, Tencent(腾讯大语言模型部门)

Tianxiang Fei, Cheng Chen, Yue Pan, Mao Zheng, Mingyang Song

AI总结:

CodeDelegator通过角色分离缓解上下文污染,利用多代理框架实现战略规划与实现的分离,提升代码作为行动代理的长期性能。

摘要:

近年来,大语言模型(LLMs)的进步使代理能够将动作表示为可执行代码,提供了比传统工具调用更大的表达性。然而,现实任务往往需要战略规划和详细实现。使用单一代理进行两者会导致调试痕迹和中间失败的上下文污染,影响长周期性能。我们提出了CodeDelegator,一种多代理框架,通过角色专业化将规划与实现分开。一个持久的Delegator通过分解任务、编写规范和监控进度来维持战略监督,而无需执行代码。对于每个子任务,会实例化一个新的Coder代理,其上下文仅包含其规范,从而避免受到先前失败的影响。为了协调代理之间,我们引入了短暂-持久状态分离(EPSS),它隔离每个Coder的执行状态,同时保持全局一致性,防止调试痕迹污染Delegator的上下文。在各种基准测试中的实验展示了CodeDelegator在不同场景中的有效性。

英文摘要:

Recent advances in large language models (LLMs) allow agents to represent actions as executable code, offering greater expressivity than traditional tool-calling. However, real-world tasks often demand both strategic planning and detailed implementation. Using a single agent for both leads to context pollution from debugging traces and intermediate failures, impairing long-horizon performance. We propose CodeDelegator, a multi-agent framework that separates planning from implementation via role specialization. A persistent Delegator maintains strategic oversight by decomposing tasks, writing specifications, and monitoring progress without executing code. For each sub-task, a new Coder agent is instantiated with a clean context containing only its specification, shielding it from prior failures. To coordinate between agents, we introduce Ephemeral-Persistent State Separation (EPSS), which isolates each Coder's execution state while preserving global coherence, preventing debugging traces from polluting the Delegator's context. Experiments on various benchmarks demonstrate the effectiveness of CodeDelegator across diverse scenarios.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑