arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.20747cs.SE
收藏

测量大型语言模型在软件代码审查中的确定性

Measuring Determinism in Large Language Models for Software Code Review

Eugene Klishevich, Yegor Denisov-Blanch, Simon Obstbaum, Igor Ciobanu, Michal Kosinski

AI总结:

本研究通过控制温度为零并重复相同提示,测量了四个大型语言模型在代码审查中的一致性,发现即使温度为零,模型输出仍存在差异,强调了LLM固有的一致性问题及实际应用中的谨慎性。

摘要:

大型语言模型(LLMs)有望简化软件代码审查流程,但它们生成一致评估的能力仍是一个悬而未决的问题。在本研究中,我们测试了四个领先的LLM——GPT-4o mini、GPT-4o、Claude 3.5 Sonnet和LLaMA 3.2 90B Vision——对来自私有和公共仓库的70个Java提交进行了测试。通过将每个模型的温度设置为零、清除上下文并重复完全相同的提示五次,我们测量了每个模型生成代码审查评估的一致性。我们的结果显示,即使温度最小化,LLM的响应也会出现不同程度的差异。这些发现突出了一个关于LLM固有有限一致性(测试-重测信度)的考量——即使温度设置为零——以及在使用LLM生成的代码审查做出实际决策时需要谨慎的必要性。

英文摘要:

Large Language Models (LLMs) promise to streamline software code reviews, but their ability to produce consistent assessments remains an open question. In this study, we tested four leading LLMs -- GPT-4o mini, GPT-4o, Claude 3.5 Sonnet, and LLaMA 3.2 90B Vision -- on 70 Java commits from both private and public repositories. By setting each model's temperature to zero, clearing context, and repeating the exact same prompts five times, we measured how consistently each model generated code-review assessments. Our results reveal that even with temperature minimized, LLM responses varied to different degrees. These findings highlight a consideration about the inherently limited consistency (test-retest reliability) of LLMs -- even when the temperature is set to zero -- and the need for caution when using LLM-generated code reviews to make real-world decisions.

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

↑