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

关于LLM生成的多语言代码注释及自动评估指标的定性研究

A Qualitative Investigation into LLM-Generated Multilingual Code Comments and Automatic Evaluation Metrics

Delft University of Technology(代尔夫特理工大学)

Jonathan Katzy, Yongcheng Huang, Gopal-Raj Panchu, Maksym Ziemlewski, Paris Loizides, Sander Vermeulen, Arie van Deursen, Maliheh Izadi

AI总结:

本研究针对大语言模型训练以英语为中心的问题,分析五种前沿代码模型在五门语言下生成代码注释的错误,构建26类错误分类体系与1.25万条标注数据集,发现现有神经评估指标无法可靠判定多语言代码注释的正确性。

摘要:

大语言模型是重要的编码助手,但其训练主要以英语为中心。本研究评估代码语言模型在非英语语境下的性能,明确其在多语言工作流中应用与集成所面临的挑战。我们开展了一项开放式编码研究,分析五种前沿代码模型(CodeGemma、CodeLlama、CodeQwen1.5、GraniteCode、StarCoder2)在五种自然语言(中文、荷兰语、英语、希腊语、波兰语)下生成的代码注释中的错误。本研究产出了包含12500条带标注生成结果的数据集,我们将其公开发布。随后,我们评估了标准指标在衡量跨语言注释“正确性”方面的可靠性,以及它们作为判断标准的可信度。通过开放式编码调查,我们确定了模型生成代码注释中26种不同错误类别的分类体系,这些类别凸显了不同自然语言下注释在语言连贯性、信息含量和语法遵循度方面的差异。我们的分析表明,尽管这些模型经常生成部分正确的注释,但现代神经指标无法可靠区分有意义的补全与随机噪声。值得注意的是,专家评定的正确与错误注释之间存在显著的分数重叠,这让这些指标在评估生成注释时的有效性受到质疑。

英文摘要:

Large Language Models are essential coding assistants, yet their training is predominantly English-centric. In this study, we evaluate the performance of code language models in non-English contexts, identifying challenges in their adoption and integration into multilingual workflows. We conduct an open-coding study to analyze errors in code comments generated by five state-of-the-art code models, CodeGemma, CodeLlama, CodeQwen1.5, GraniteCode, and StarCoder2 across five natural languages: Chinese, Dutch, English, Greek, and Polish. Our study yields a dataset of 12,500 labeled generations, which we publicly release. We then assess the reliability of standard metrics in capturing comment \textit{correctness} across languages and evaluate their trustworthiness as judgment criteria. Through our open-coding investigation, we identified a taxonomy of 26 distinct error categories in model-generated code comments. They highlight variations in language cohesion, informativeness, and syntax adherence across different natural languages. Our analysis shows that, while these models frequently produce partially correct comments, modern neural metrics fail to reliably differentiate meaningful completions from random noise. Notably, the significant score overlap between expert-rated correct and incorrect comments calls into question the effectiveness of these metrics in assessing generated comments.

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

↑