arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.37224cs.SEcs.AI
收藏

Spine:将子任务树编译为长程编码智能体的结构化上下文

Spine: Compiling Subtask Trees into Structured Context for Long-Horizon Coding Agents

Southern University of Science and Technology(南方科技大学);University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Jiahong Xiang, Kunqiu Chen, Lingming Zhang, Yuqun Zhang

AI总结:

该研究提出Spine框架,将子任务树编译为长程编码智能体的结构化上下文,集成到Codex、Pi后,在SWE-Milestone、ProgramBench等基准上显著提升性能并降低成本。

摘要:

长程编码任务包含嵌套子任务。通常,智能体将交互过程按顺序记录到不断增长的历史中,导致上下文膨胀和性能下降。在没有明确子任务边界的情况下压缩或修剪历史会丢弃未完成子任务所需的信息。相反,递归子智能体委派通过子智能体隔离已完成的子任务,将每个子任务边界分配给委派,这将子任务粒度与执行智能体选择混为一谈,增加了执行和协调开销。我们引入Spine,一种使模型上下文与子任务嵌套和完成对齐的接口和运行时。智能体通过工作范围声明明确的子任务边界,允许同一智能体内联执行嵌套子任务,同时将委派保留给独立并行任务。运行时在SpineTree中组织执行,这是一种持久树,记录子任务关系、本地交互、完成状态和返回结果。在每次模型调用前,它会及时将树编译为模型上下文,保留未完成子任务的交互,并用其结果替换已完成子任务的细节,同时保留前缀缓存复用。我们将Spine集成到Codex中构建SpineCodex。使用GPT-5.6 Sol,与原生Codex相比,SpineCodex将SWE-Milestone分数提高11.8%,同时总成本降低32.4%,将ProgramBench平均测试通过率提高17.3%,并在评估的10个FrontierSWE任务中的8个上提高了Mean@5。在SWE-Milestone上,它还达到了与递归子智能体相当的分数,总成本降低73.7%。我们还通过可重用软件包将Spine集成到Pi中:使用Gemini 3.8 Flash和Qwen 3.8 27B,与原生Pi相比,它将SWE-Milestone分数提高9.5-17.5%,并将ProgramBench平均测试通过率提高4.3-8.7%。

英文摘要:

Long-horizon coding tasks contain nested subtasks. Typically, agents record interactions sequentially into a growing history, causing context inflation and performance degradation. Compressing or trimming the history without explicit subtask boundaries can discard information needed by unfinished subtasks. Conversely, recursive subagent delegation isolates completed subtasks through child agents by assigning every subtask boundary to delegation, which conflates subtask granularity with executing agent choice, adding execution and coordination overhead. We introduce Spine, an interface and runtime that align model context with subtask nesting and completion. An agent declares explicit subtask boundaries through work scopes, allowing the same agent to execute nested subtasks inline while reserving delegation for independent parallel tasks. The runtime organizes execution in SpineTree, a persistent tree recording subtask relations, local interactions, completion states, and returned results. Before each model call, it compiles the tree into model context just in time, retaining unfinished subtasks' interactions and replacing completed subtasks' details with their results, while preserving prefix-cache reuse. We integrate Spine into Codex to build SpineCodex. With GPT-5.6 Sol, compared with native Codex, SpineCodex improves SWE-Milestone Score by 11.8% while reducing total cost by 32.4%, improves the average ProgramBench test-pass rate by 17.3%, and improves Mean@5 on eight of the ten evaluated FrontierSWE tasks. On SWE-Milestone, it also achieves a comparable Score to Recursive Subagent at 73.7% lower total cost. We also integrate Spine into Pi through a reusable software package: with Gemini 3.8 Flash and Qwen 3.8 27B, it improves SWE-Milestone Score by 9.5-17.5% and the average ProgramBench test-pass rate by 4.3-8.7% compared with native Pi.

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

↑