arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.00308cs.SEcs.AIcs.LG
收藏

生成架构如何塑造多智能体LLM系统中的代码复杂度:基于HumanEval的配对研究

How Generation Architecture Shapes Code Complexity in Multi-Agent LLM Systems: A Paired Study on HumanEval

Nazmus Ashrafi

AI总结:

通过配对实验比较六种多智能体架构在HumanEval上的代码复杂度,发现架构复杂度与功能正确性无正相关,最简架构在准确率上持平或超越复杂架构。

摘要:

大语言模型代码生成已从单次提示转向多智能体编排——分析师、编码员、测试员和调试器流水线——并且几乎完全根据功能正确性进行评估。这些架构是否也影响它们生成代码的结构复杂度,以及哪些编排层承担了成本,在很大程度上仍未得到检验:先前的工作记录了提示级别对代码复杂度的影响,但架构级别的问题仍是开放的。我们在GPT-4o系列的两个模型下,针对所有164个HumanEval任务(1,968个配对观测),使用五个RADON复杂度度量(SLOC、圈复杂度以及Halstead体积、难度和努力),比较了六种广泛使用的多智能体配置(Basic、AC、ACT、Debugger、AC+Debugger、ACT+Debugger)。我们在所有完成和仅通过条件下应用了配对非参数统计流程(Friedman总体检验、Wilcoxon符号秩事后检验与Holm校正、Kendall's W和配对秩双列效应量)。六种架构坍缩为两个不可区分的复杂度簇,间隔50-130%的差距,在两个模型和两种条件下分区相同;在架构层中,分析师-编码员分割增加了复杂度,运行时调试器没有——并且在分析师-编码员背景下主动降低复杂度——而测试员则重新增加复杂度。重簇的额外复杂度并未带来pass@1优势:最简架构在准确率上匹配或超越最重架构。因此,LLM代码生成中的架构细化应通过所关注维度上的实测收益来证明,而非假设。

英文摘要:

Large-language-model code generation has shifted from single-shot prompting to multi-agent orchestrations - analyst, coder, tester, and debugger pipelines - and is evaluated almost exclusively on functional correctness. Whether these architectures also affect the structural complexity of the code they produce, and which orchestration layers carry the cost, remains largely unexamined: prior work has documented prompt-level effects on code complexity, but the architecture-level question is open. We compare six widely-used multi-agent configurations (Basic, AC, ACT, Debugger, AC+Debugger, ACT+Debugger) under two models from the GPT-4o family across all 164 HumanEval tasks - 1,968 paired observations - using the five RADON complexity metrics (SLOC, cyclomatic complexity, and Halstead Volume, Difficulty, and Effort). We apply a paired non-parametric statistical pipeline (Friedman omnibus, Wilcoxon signed-rank post-hoc with Holm correction, Kendall's $W$ and matched-pairs rank-biserial effect sizes) in both all-completions and passing-only conditions. The six architectures collapse into two indistinguishable complexity clusters separated by a 50-130% gap, the same partition in both models and under both conditions; among the architectural layers, the analyst-coder split inflates complexity, the runtime debugger does not - and on the analyst-coder background actively deflates it - and the tester re-inflates it. The heavy cluster's additional complexity buys no pass@1 advantage: the leanest architectures match or beat the heaviest on accuracy. Architectural elaboration in LLM code generation should therefore be justified by measured benefit on the dimensions that matter, not assumed.

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

↑