根据代码复杂度动态选择协作架构,确保资源使用不超限。
Retrieval-Conditioned Topology Selection with Provable Budget Conservation for Multi-Agent Code Generation
- 先分析代码结构复杂度,再决定智能体协作方式。
- 错误路由率从30.1%降到8.2%,资源消耗可证明不超预算。
- 适合需要高效、安全生成代码的系统开发者。
用于代码生成的多智能体大模型系统面临核心路由难题:最优协作拓扑依赖于待修改代码的结构复杂度,但现有系统在选择拓扑时未参考代码库。我们提出检索引导的自适应编排(RGAO),通过从分层代码索引中提取结构复杂度向量,在选择协作拓扑前完成决策闭环。RGAO运行于Code-Agent框架,其中子智能体由六维预算向量约束的正式契约管理。本工作首次融合复杂度感知路由与形式化资源代数,实现两者单独无法达成的性质:在检索条件下的动态拓扑选择中可证明资源预算守恒。具体贡献包括:(1) 复杂度条件化的拓扑路由器,使代理测量误路由率从30.1%降至8.2%;(2) 具有结构归纳守恒定理的预算代数;(3) 分层代码检索引擎。实验表明,该方法可在亚毫秒内构建有向无环图,并实现树索引线性扩展。
原文摘要 · Abstract (English)
Multi-agent LLM systems for code generation face a fundamental routing problem: the optimal orchestration topology depends on the structural complexity of the code under modification, yet existing systems select topologies without consulting the codebase. We present Retrieval-Guided Adaptive Orchestration (RGAO), an architecture that closes this loop by extracting a structural complexity vector from a hierarchical code index before selecting the orchestration topology. RGAO operates within Code-Agent, a multi-agent framework whose sub-agents are governed by formal contracts with six-dimensional budget vectors. Our headline contribution is the composition of two previously separate lines of work -- complexity-conditioned LLM routing and formal resource algebras -- yielding a property neither admits alone: provable budget conservation under retrieval-conditioned dynamic topology selection. Concretely we contribute: (1) a complexity-conditioned topology router that reduces proxy-measured misrouting from 30.1% to 8.2%; (2) a budget algebra with a structural-induction conservation theorem; and (3) a hierarchical code retrieval engine. Empirical evaluation demonstrates sub-millisecond DAG construction and linear tree-index scalability.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。