大规模实证研究揭示AI生成C++代码在生产环境中的质量特征

HuggingFace Daily Papers(社区热门论文)·2026-08-06 08:00·19天前
AI 导读

一项覆盖2025年4月至2026年4月、追踪某大型企业352万次代码变更的实证分析发现,AI生成的C++代码具有独特质量特征:接口与耦合负担更高、拷贝和分配开销更大,且更依赖显式循环而非优化标准API。这些问题导致审查工作量增加,并使计算资源消耗上升5-8%。向模型提供基于分类学的定向反馈可缓解上述影响,使相关静态分析警告减少11.1%。

HuggingFace Daily Papers(社区热门论文)
55AI 编辑部评分,满分 100

大规模实证研究揭示AI生成C++代码在生产环境中的质量特征

2026-08-06 08:00· 19天前
AI 导读

一项覆盖2025年4月至2026年4月、追踪某大型企业352万次代码变更的实证分析发现,AI生成的C++代码具有独特质量特征:接口与耦合负担更高、拷贝和分配开销更大,且更依赖显式循环而非优化标准API。这些问题导致审查工作量增加,并使计算资源消耗上升5-8%。向模型提供基于分类学的定向反馈可缓解上述影响,使相关静态分析警告减少11.1%。

The widespread integration of AI coding assistants offers undeniable boosts to engineering velocity. Yet, recent studies point to a growing trade-off, revealing persistent challenges with code quality and maintainability. Industry leaders, including frontier AI labs, echo these concerns. As large language models are increasingly relied upon to author production code, understanding their impact on shipped software quality has become a critical priority. However, assessing these effects in industrial workflows remains difficult due to observability barriers. We study the impact of AI-generated code on production quality within a large enterprise operating global products relied upon by billions of users daily. Driven by this scale and user trust, the organization values code quality and has built thorough observability for every line of code deployed into production, enabling us to overcome measurement barriers to assess these effects. This study presents a large-scale empirical analysis of AI-generated C++ code from April 2025 to April 2026, tracking 3.52 million code changes across this enterprise's brownfield codebase. The core purpose is to understand the quality, performance, and maintenance characteristics of AI-generated code compared to human-written code in a production environment at scale. We find that AI-generated C++ code has a distinct quality profile, showing higher rates of interface and coupling burdens, copy and allocation overheads, and a reliance on explicit loops over optimized standard APIs. These issues translate into tangible downstream costs, including increased review effort and a 5-8% increase in compute resource consumption. However, we demonstrate that providing models with targeted, taxonomy-informed feedback can mitigate these effects, leading to an 11.1% reduction in targeted static analysis warnings and improved computational efficiency.

来源:HuggingFace Daily Papers(社区热门论文)· arxiv.org