Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain

📄 arXiv: 2310.14053v3 📥 PDF

作者: Marcus J. Min, Yangruibo Ding, Luca Buratti, Saurabh Pujar, Gail Kaiser, Suman Jana, Baishakhi Ray

分类: cs.LG, cs.CL, cs.SE

发布日期: 2023-10-21 (更新: 2024-02-26)

备注: ICLR 2024

🔗 代码/项目: GITHUB


💡 一句话要点

提出IdentityChain框架以评估代码大语言模型的自一致性

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码大语言模型 自一致性 模型评估 IdentityChain 模型调试 自然语言处理 编程语言理解

📋 核心要点

  1. 现有的代码大语言模型评估方法主要集中在单一任务的准确性,忽视了模型在不同任务间的一致性。
  2. 本文提出的IdentityChain框架能够同时评估模型的自一致性和传统准确性,填补了这一空白。
  3. 实验结果显示,研究中的十一种代码大语言模型普遍存在自一致性不足的问题,且IdentityChain有效揭示了模型的弱点。

📝 摘要(中文)

代码大语言模型(Code LLMs)在实际应用中越来越普遍,因此对其评估至关重要。传统的准确性评估仅关注模型在单个任务上的表现,而忽视了其在不同任务间的自一致性。本文首次正式定义了代码大语言模型的自一致性,并设计了IdentityChain框架,能够有效且高效地同时评估模型的自一致性和传统准确性。研究表明,现有的十一种代码大语言模型在自一致性方面存在明显不足,且IdentityChain可作为模型调试工具,揭示当前模型的三大主要弱点。代码已在GitHub上公开。

🔬 方法详解

问题定义:本文旨在解决代码大语言模型在不同任务间自一致性评估不足的问题。现有方法主要关注单一任务的准确性,未能全面反映模型的理解能力和信任度。

核心思路:通过定义自一致性并设计IdentityChain框架,论文提出了一种新的评估方式,强调模型在生成自然语言规范和代码之间的一致性。

技术框架:IdentityChain框架包括多个模块,首先定义自一致性指标,然后设计评估流程,最后通过实验验证模型的表现。

关键创新:最重要的创新在于首次将自一致性作为评估标准,与传统的准确性评估形成鲜明对比,揭示了模型在理解语义方面的不足。

关键设计:框架中涉及的关键设计包括自一致性指标的定义、评估流程的优化,以及在实验中使用的多种代码大语言模型的选择与对比。通过这些设计,IdentityChain能够有效识别模型的弱点。

🖼️ 关键图片

fig_0

📊 实验亮点

实验结果表明,研究中的十一种代码大语言模型在自一致性方面普遍存在问题,且IdentityChain成功揭示了三大主要弱点。这些发现强调了自一致性作为评估标准的重要性,推动了对模型性能的更全面理解。

🎯 应用场景

该研究的潜在应用领域包括软件开发、自动化代码生成和智能编程助手等。通过提高代码大语言模型的自一致性,能够增强其在实际应用中的可靠性和信任度,推动智能编程技术的发展。

📄 摘要(原文)

Code Large Language Models (Code LLMs) are being increasingly employed in real-life applications, so evaluating them is critical. While the conventional accuracy evaluates the performance of Code LLMs on a set of individual tasks, their self-consistency across different tasks is overlooked. Intuitively, a trustworthy model should be self-consistent when generating natural language specifications for its own code and generating code for its own specifications. Failure to preserve self-consistency reveals a lack of understanding of the shared semantics underlying natural language and programming language, and therefore undermines the trustworthiness of a model. In this paper, we first formally define the self-consistency of Code LLMs and then design a framework, IdentityChain, which effectively and efficiently evaluates the self-consistency and conventional accuracy of a model at the same time. We study eleven Code LLMs and show that they fail to preserve self-consistency, which is indeed a distinct aspect from conventional accuracy. Furthermore, we show that IdentityChain can be used as a model debugging tool to expose weaknesses of Code LLMs by demonstrating three major weaknesses that we identify in current models using IdentityChain. Our code is available at https://github.com/marcusm117/IdentityChain.