We are entering a hybrid era in which human developers and AI coding agents work in the same codebases. While industry practice has long optimized code for human comprehension, it is increasingly important to ensure that LLMs with different capabilities can edit code reliably. In this study, we investigate the concept of ``AI-friendly code'' via LLM-based refactoring on a dataset of 5,000 Python files from competitive programming. We find a meaningful association between CodeHealth, a quality metric calibrated for human comprehension, and semantic preservation after AI refactoring. Our findings confirm that human-friendly code is also more compatible with AI tooling. These results suggest that organizations can use CodeHealth to guide where AI interventions are lower risk and where additional human oversight is warranted. Investing in maintainability not only helps humans; it also prepares for large-scale AI adoption.


翻译:我们正步入一个混合时代,人类开发者与AI编码助手将在同一代码库中协同工作。尽管业界实践长期以来一直为人类理解而优化代码,但确保具备不同能力的LLM能够可靠地编辑代码正变得日益重要。本研究通过对竞争性编程中5,000个Python文件进行基于LLM的重构,深入探讨了"AI友好型代码"的概念。我们发现,专为人类理解校准的代码质量指标CodeHealth与AI重构后的语义保持之间存在显著关联。研究结果证实,对人类友好的代码同样与AI工具更具兼容性。这些发现表明,组织可利用CodeHealth来指导哪些区域的AI介入风险较低,哪些区域需要额外的人工监督。投资于代码可维护性不仅对人类有益,也为大规模AI应用做好了准备。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
[IEEE TPAMI 2024] 将CLIP模型转换为端到端文本识别器
专知会员服务
22+阅读 · 2024年4月12日
[CVPR 2021] 序列到序列对比学习的文本识别
专知
10+阅读 · 2021年4月14日
DeepMind:用PopArt进行多任务深度强化学习
论智
29+阅读 · 2018年9月14日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2008年12月31日
Top
微信扫码咨询专知VIP会员