当AI审查自己的代码:代码大语言模型中的递归自训练崩溃
When AI Reviews Its Own Code: Recursive Self-Training Collapse in Code LLMs
AI总结:
研究代码LLM在递归自训练中因缺乏外部质量控制而崩溃的风险,对比无审查、人工门控和AI自门控三种机制,发现AI自门控会退化为无门控自训练,需外源验证。
摘要:
递归自训练会降低神经生成模型的质量,当生成的数据在没有新的人类数据或外部质量控制的情况下被重复使用时。我们在代码大语言模型中研究这一风险,其中AI生成的代码可能进入真实仓库,随后成为训练数据,形成仓库规模的自训练循环。虽然软件开发传统上通过拉取请求审查、测试、编译和人工批准来中断这一循环,但AI编码工具现在生成代码的速度快于人类审查的速度,而代码审查本身也越来越被AI系统自动化。因此,我们比较了三种递归微调机制:无审查、使用模型无关过滤器(如编译和静态质量检查)的人工门控审查,以及使用代码LLM自身信号(如困惑度和二元自评分)的AI自门控审查。在多个代码LLM和基准测试中,无审查崩溃最快,人工门控过滤器减缓但未阻止崩溃,而AI自门控过滤器早期可能表现强劲,但后来失去其过滤效果。在最明显的情况下,二元自门控进入橡皮图章状态,接受分数上升而基准正确性下降。我们通过将审查形式化为门控分布重加权来解释这一行为,证明AI自门控在自我确认接受条件下退化为无门控自训练,并给出了递归重训练下表示级协方差集中的谱分析。这些结果表明,稳定的递归代码LLM训练需要外源验证而非模型耦合的自我审查。
英文摘要:
Recursive self-training can degrade neural generative models when generated data is reused without fresh human data or external quality control. We study this risk in code LLMs, where AI-generated code can enter real repositories, later become training data, and create a repository-scale self-training loop. While software development traditionally interrupts this loop through pull-request review, tests, compilation, and human approval, AI coding tools now produce code faster than humans can review it, and code review itself is increasingly automated by AI systems. We therefore compare three recursive fine-tuning regimes: no review, human-style exogenous-gate review using model-independent filters such as compilation and static quality checks, and AI-self-gate review using the code LLM's own signals such as perplexity and binary self-scoring. Across multiple code LLMs and benchmarks, every tested recursive regime falls below its own starting point; exogenous filters preserve executable validity and sometimes reduce decline, while AI-self-gate filters can look strong early but later lose their filtering effect. In the clearest case, the binary self-gate enters a rubber-stamp regime where acceptance scores rise while benchmark correctness falls. We explain this behavior by formulating review as gated distributional reweighting, proving that AI self-gating degenerates to ungated self-training under a self-confirming acceptance condition, and giving a spectral analysis of representation-level covariance concentration under recursive retraining. These results suggest that stable recursive code LLM training requires exogenous verification rather than model-coupled self-review.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。