Skip to main content
QUICK REVIEW

[논문 리뷰] ICE-Score: Instructing Large Language Models to Evaluate Code

Terry Yue Zhuo|arXiv (Cornell University)|2023. 04. 27.
Topic Modeling인용 수 7
한 줄 요약

ICE-Score는 참조 코드나 테스트 세트가 필요 없이 LLM 기반의 참조 없는 평가 지표를 제안하며, 지시 fine-tuned 대규모 언어 모델(LLM)을 활용해 다차원적 코드 평가를 수행함으로써 네 가지 프로그래밍 언어에서 인간의 선호도와 기능적 정확도와 높은 상관관계를 달성한다.

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와 같은 지표의 한계를 해결한다.
  • 기존 평가 방법에서 인간이 작성한 테스트 세트나 참조 코드에 의존하는 문제를 해결한다. 이는 자원이 부족한 환경에서 비용이 많이 들고 비현실적인 문제를 야기한다.
  • 인간의 선호도와 기능적 정확도와 일치하는 參照 없는 평가 지표를 개발한다.
  • 실행이나 외부 오라클 없이도 여러 프로그래밍 언어에서 일관되고 정확한 코드 평가를 가능하게 한다.
  • 지시 fine-tuned LLM의 의미 이해 능력을 활용해 확장 가능하고 자동화되며 인간과 일치하는 코드 생성 평가 프레임워크를 제공한다.

제안 방법

  • 사전 정의된 다차원 평가 기준에 따라 지시 fine-tuned 대규모 언어 모델(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지시 fine-tuned LLM이 코드 실행이나 테스트 세트 없이 생성된 코드의 기능적 정확도를 어느 정도 평가할 수 있는가?
  • RQ3Human 판단과 기능적 정확도에서 최신 기준 지표인 CodeBERTScore와 G-EVAL과 비교해 제안된 ICE-Score 지표는 어떻게 성능을 내는가?
  • RQ4ICE-Score는 Java, Python, C, C++, JavaScript와 같은 여러 프로그래밍 언어로 일반화되는가?
  • RQ5참조 없는, LLM 기반 평가 프레임워크가 자원이 부족하거나 복잡한 코드 지능 작업에서 일관성과 정확성을 유지할 수 있는가?

주요 결과

  • ICE-Score는 G-EVAL과 CodeBERTScore와 같은 기존 지표들과 비교해 참조 없는 환경에서 인간의 선호도와 더 높은 상관관계를 보였다.
  • 네 가지 프로그래밍 언어에서 기능적 정확도와 강한 상관관계를 보이며, 다양한 구문과 의미 체계로의 일반화 능력이 뛰어나다는 것을 확인했다.
  • 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가 만들고, 인간 에디터가 검토했습니다.