研究对比人类与AI生成的代码质量差异
What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code
这个研究很实用,对比了人类和AI生成的代码质量差异,比如AI代码结构更紧凑但可能更模板化,不同语言的安全漏洞情况也不同,对开发者应该有帮助。
研究对比了人类与AI生成的代码质量差异,分析了787,562个函数对,发现AI生成的代码结构更紧凑、分支更少,且存在更多重复的样板代码。
在Python和Java中,AI生成的代码存在更多安全漏洞,但在C语言中,人类代码的内存安全漏洞更多。研究还发布了CQBench基准测试集。
What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code
AI coding assistants are becoming co-authors of production software, yet their evaluation centers on functional correctness, leaving open whether their code differs from human code in the quality dimensions dominating lifecycle cost. We compare human-written and AI-generated code at scale: 787,562 function pairs across Python, Java, and C, each human function mined from open-source repositories paired with implementations generated from its docstring by three AI assistants (OpenAI GPT models, DeepSeek-Coder, Qwen2.5-Coder). We characterize structural complexity and statistical naturalness, and map static-analysis findings onto Orthogonal Defect Classification for defects and the Common Weakness Enumeration for vulnerabilities, making authors and languages directly comparable. AI-generated code is structurally compressed and stylistically templated: roughly half the size and branching of human code, clustering apart at the style level. Defect profiles differ in kind: human code concentrates issues of mature codebases, AI code repetitive boilerplate; security is language-dependent, with LLMs producing more, and more severe, findings in Python and Java but fewer high-severity memory-safety findings than humans in C. Once size is controlled for, complexity metrics carry little signal, while naturalness separates authors. Finally, we release CQBench, a benchmark of 27,346 issue-prone tasks with baselines and an evaluation pipeline for quality assurance and security testing.
本条情报归属 AITOP「论文」核心栏目,重点聚焦北美前沿实验室与硅谷科技巨头。在跨区域产业观察坐标中,该动态直接关联「AI 开发者工具链、Coding Agent 与工程化实践」「中美大模型技术代差与商业化对照」「各国 AI 监管法案、合规治理与主权算力政策」研究主线,反映出当前技术演进与商业落地的最新风向。涉及核心实体与技术议题包括:Qwen2.5-Coder、DeepSeek-Coder、GPT、代码质量,读者可通过下方标签进入对应专题页查阅历史脉络与关联对比。
信源核验说明:本文原始信息发布自一手权威信源「arXiv: DeepSeek」(Tier-1 一手发布),具备高确定性参考价值。