ICE-Score:指示大型语言模型评估代码
ICE-Score: Instructing Large Language Models to Evaluate Code
AI总结:
本文提出 ICE-Score,通过指示 LLM 在无测试预言和参考程序的情况下评估代码,并在四种语言上验证其与功能正确性及人类偏好的相关性优于现有指标。
摘要:
自然语言生成领域的最新进展推动了使用大型语言模型来评估生成文本的质量。尽管这些模型在机器翻译和摘要等任务中展现出良好效果,但在没有人类参与的情况下,它们在代码智能任务中的适用性仍然有限。此类任务所需编程概念的复杂性,使得开发与人类判断相一致的评估指标十分困难。基于词元匹配的指标(如 BLEU)在代码智能任务中与人类从业者的判断表现出较弱的相关性。此外,在资源匮乏的领域,利用人工编写的测试套件来评估功能正确性也可能颇具挑战。为克服这些障碍,我们提出了 ICE-Score,这是一种通过指示大型语言模型(LLM)进行代码评估的新型评估指标。我们的指标解决了现有方法的局限,无需测试预言或参考程序,即可与功能正确性和人类偏好取得更优的相关性。我们从两个不同方面(人类偏好和执行成功)以及四种编程语言评估了该指标的有效性。结果表明,我们的指标超越了代码生成领域的最先进指标,在各种编程语言和任务中均实现了高水平的准确性和一致性。我们还公开了评估指标和数据集(https://github.com/terryyz/ice-score),以鼓励对代码智能任务评估开展进一步研究。
英文摘要:
Recent advancements in the field of natural language generation have facilitated the use of large language models to assess the quality of generated text. Although these models have shown promising results in tasks such as machine translation and summarization, their applicability in code intelligence tasks remains limited without human involvement. The complexity of programming concepts required for such tasks makes it difficult to develop evaluation metrics that align with human judgment. Token-matching-based metrics, such as BLEU, have demonstrated weak correlations with human practitioners in code intelligence tasks. Moreover, utilizing human-written test suites to evaluate functional correctness can be challenging in domains with low resources. To overcome these obstacles, we propose \texttt{ICE-Score}, a new evaluation metric via instructing large language models (LLMs) for code assessments. Our metric addresses the limitations of existing approaches by achieving superior correlations with functional correctness and human preferences, without the need for test oracles or references. We evaluate the efficacy of our metric on two different aspects (\textit{human preference} and \textit{execution success}) and four programming languages. Our results demonstrate that our metric surpasses state-of-the-art metrics for code generation, delivering high levels of accuracy and consistency across various programming languages and tasks. We also make our evaluation metric and datasets available to the public\footnote{\url{https://github.com/terryyz/ice-score}}, encouraging further research in evaluating code intelligence tasks.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。