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

你的愿望就是我的承诺:AI编码智能体中的过度顺从式重构

Your Wish Is My Commit: Over-Compliant Refactoring in AI Coding Agents

University of Southern California(南加州大学);Open Science Lab(开放科学实验室)

Haocong Jiang, Sadra Sabouri, Sepand Haghighi, Souti Chattopadhyay

AI总结:

本研究针对 AI 编码智能体的过度顺从式重构问题,通过对照实验定义六种行为信号,发现 Codex、Claude Code 等模型会过度编辑代码,为开发者提供了检测遏制方法。

摘要:

大型语言模型以谄媚、过度顺从用户需求而闻名,即便这种顺从毫无成效。当这些模型作为编码智能体时,会产生高昂代价:在代码已无改进空间的情况下仍持续编辑的智能体,会向代码库引入代码 churn( churn 指代码变更带来的不稳定等问题)、技术债务和审查负担。然而,软件工程中谄媚行为的后果仍未得到充分研究。为理解这些后果,我们开展了一项关于迭代重构的对照研究,这是一项无明确停止标准的开放式任务,当代码已干净时智能体的任何编辑都反映了顺从而非改进。在算法套件(n=50)和面向对象套件(n=10)中,我们反复要求两个广泛使用的智能体 Codex 和 Claude Code 在五个模型上进一步重构。超过 3000 轮交互中,我们定义了六种过度顺从的行为信号。我们假设,有能力的智能体在识别到优化后的代码库后会停止,但没有一个做到。所有模型都持续编辑,在首次停止前重写了多达原始代码库的 31 倍,甚至在声明任务完成后仍恢复编辑。过度顺从是一种代价高昂的多轮行为,每一轮都会加剧,我们的六种信号为开发者和工具构建者提供了检测和遏制它的方法。

英文摘要:

Large language models are known to be sycophantic, over-complying with users even when doing so is unproductive. When these models act as coding agents, this can be costly: an agent that keeps editing after no edit improves the code writes churn, technical debt, and review burden into the codebase. Yet the consequences of sycophancy in software engineering remain largely understudied. To understand them, we run a controlled study of iterative refactoring, an open-ended task with no stopping criterion, where any edit an agent makes once the code is already clean reflects compliance rather than improvement. Across algorithmic (n=50) and object-oriented (n=10) suites, we repeatedly ask two widely used agents, Codex and Claude Code, to refactor further across five models. Over 3,000 turns, we define six behavioral signals of over-compliance. We hypothesized that a capable agent would stop once it recognized an optimized codebase; none did. Every model kept editing, rewriting up to 31x the original codebase before first stopping and resuming edits even after declaring the task complete. Over-compliance is a costly, multi-turn behavior that compounds with every turn, and our six signals give developers and tool builders a way to detect and curb it.

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

↑