Skip to main content
QUICK REVIEW

[論文レビュー] ICE-Score: Instructing Large Language Models to Evaluate Code

Terry Yue Zhuo|arXiv (Cornell University)|Apr 27, 2023
Topic Modeling被引用数 7
ひとこと要約

ICE-Scoreは、参照コードを必要とせず、LLMに基づくコード生成評価指標を提案する。この指標は、指令微調整済みの大規模言語モデル(LLM)を活用して、複数の次元にわたるコード評価を実施し、4つのプログラミング言語で人間の好みや機能的正しさと高い相関を示す。テストスイートや参照コードを必要としない。

ABSTRACT

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 exttt{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 ( extit{human preference} and extit{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.

研究の動機と目的

  • コード評価における伝統的なトークンマッチング指標(BLEU や ROUGE)の限界に対処する。これらの指標は、人間の判断と弱い相関を示すことがある。
  • 既存の評価手法が人間が作成したテストスイートや参照コードに依存する問題を克服する。これらは低リソース環境において費用がかかり、現実的でない。
  • 人間の好みや機能的正しさと整合する、参照なしの評価指標を開発する。
  • 実行や外部オラクルを必要とせず、複数のプログラミング言語にわたる一貫性があり正確なコード評価を可能にする。
  • 指令微調整済みLLMの意味理解能力を活用し、スケーラブルで自動的かつ人間と整合するコード生成評価フレームワークを提供する。

提案手法

  • 事前に定義された多様な評価基準に基づき、指令微調整済みの大規模言語モデル(LLM)を用いてコードスニペットを評価する。
  • 指令生成や重み付きスコア関数を必要とせず、LLMに構造的な評価ステップをガイドするプロンプトベースの評価フレームワークを設計する。
  • 人間の判断基準に基づき、正しさ、読みやすさ、意味的整合性などの評価次元を定義する。
  • 自然言語とコードのデータで事前学習されたLLMを用いて、この指標を訓練・展開し、プログラミングの構文と意味の理解を強固にする。
  • 個々のコードスニペットと全体のモデル出力を評価するために、例レベルとコーパスレベルの両方でこの指標を適用する。
  • LLMの自然言語指令と内部知識によるコード品質判断に依存することで、参照なしの評価を実現する。
Figure 1: An illustration of ICE-Score . On the left-hand side, we input the task problems and corresponding generated code snippets. On the right-hand side, ICE-Score outputs the corresponding assessments.
Figure 1: An illustration of ICE-Score . On the left-hand side, we input the task problems and corresponding generated code snippets. On the right-hand side, ICE-Score outputs the corresponding assessments.

実験結果

リサーチクエスチョン

  • RQ1参照コードを必要とせず、LLMベースの評価指標が、コード生成において人間の好みと高い相関を達成できるか?
  • RQ2指令微調整済みLLMは、実行やテストスイートを用いずに、生成コードの機能的正しさをどの程度正確に評価できるか?
  • RQ3人間の判断や機能的正しさの両面で、最先端の指標(CodeBERTScore や G-EVAL)と比較して、ICE-Scoreはどの程度優れているか?
  • RQ4ICE-Scoreは、Java、Python、C、C++、JavaScript を含む複数のプログラミング言語に一般化できるか?
  • RQ5参照なしでLLM駆動の評価フレームワークは、低リソース環境や複雑なコードインテリジェンスタスクにおいても一貫性と正確性を維持できるか?

主な発見

  • G-EVAL や CodeBERTScore といった既存の指標と比較して、特に参照なしの設定において、人間の好みとの相関が優れている。
  • 4つのプログラミング言語にわたって、機能的正しさと強い相関を示しており、多様な構文と意味論にわたる強力な一般化能力を示している。
  • BLEU や ROUGE といった従来の指標は、トークンレベルのマッチングに依存するため、人間の判断と弱い整合性を示すが、ICE-Scoreはこれを上回る。
  • テストスイートや参照コードを必要としないため、低リソース環境におけるコード評価のコストと複雑さが顕著に低下する。
  • 例レベルとコーパスレベルの両方で高い一貫性と正確性を維持しており、大規模なモデル評価における信頼性を確認している。
  • 研究者らは、今後の自動コード評価研究を支援するため、指標と関連データセットを公開しており、再現可能性とコミュニティの発展を促進している。
Figure 2: Example inputs and outputs with (a) ICE-Score , (b) ICE-Score with Zero-Shot Chain-of-Thought. With the step-by-step evaluation, the output assessment is more aligned with human preference.
Figure 2: Example inputs and outputs with (a) ICE-Score , (b) ICE-Score with Zero-Shot Chain-of-Thought. With the step-by-step evaluation, the output assessment is more aligned with human preference.

より良い研究を、今すぐ始めましょう

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。