CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution

Alex Gu, Baptiste Rozière, Hugh Leather, Armando Solar-Lezama, Gabriel Synnaeve, Sida Wang

arXiv:2401.03065 · 2026-07-27 공개 · arXiv · PDF

gpt-4 code-reasoning code-evaluation code-llama cot execution-benchmark input-prediction output-prediction

Abstract

We present CRUXEval (Code Reasoning, Understanding, and eXecution Evaluation), a benchmark consisting of 800 Python functions (3-13 lines). Each function comes with an input-output pair, leading to two natural tasks: input prediction and output prediction. First, we propose a generic recipe for generating our execution benchmark which can be used to create future variation of the benchmark. Second, we evaluate twenty code models on our benchmark and discover that many recent high-scoring models on HumanEval do not show the same improvements on our benchmark. Third, we show that simple CoT and fine-tuning schemes can improve performance on our benchmark but remain far from solving it. The best setup, GPT-4 with chain of thought (CoT), achieves a pass@1 of 75% and 81% on input and output prediction, respectively. In contrast, Code Llama 34B achieves a pass@1 of 50% and 46% on input and output prediction, highlighting the gap between open and closed source models. As no model is close to acing CRUXEval, we provide examples of consistent GPT-4 failures on simple programs as a lens into its code reasoning capabilities and areas for improvement.

한국어 요약

한 줄 요약

CRUXEval은 코드 추론, 이해, 실행 능력을 평가하는 800개의 간단한 파이썬 함수로 구성된 새로운 벤치마크이다.

핵심 기여도

핵심 아이디어

CRUXEval은 기존 코드 생성 중심의 HumanEval과 달리, 코드 실행 추적과 이해 능력을 평가하는 새로운 벤치마크이다. 이는 코드 LLM이 단순히 코드를 생성하는 것 이상으로, 코드의 실행 흐름을 추론하고 예측할 수 있는지 평가하는 데 초점을 맞춘다. CRUXEval-I는 주어진 출력에 대해 입력을 예측하는 작업이고, CRUXEval-O는 주어진 입력에 대해 출력을 예측하는 작업이다. 이 두 태스크는 코드 LLM이 실제 실행 과정을 이해하고 추론할 수 있는지 평가하는 핵심 지표로 사용된다. CRUXEval은 Code Llama 34B로 대량 생성한 함수를 필터링하여 800개의 간단한 문제로 구성되며, 이는 인간 개발자가 1분 이내에 해결 가능한 수준의 문제들이다.

기술적 접근법

주요 결과

의의 및 한계

CRUXEval은 코드 LLM의 실행 추적 및 이해 능력을 평가하는 데 중요한 새로운 벤치마크로, 기존 HumanEval과 MBPP가 포착하지 못한 차원의 능력을 평가한다. 특히, GPT-4가 CRUXEval에서 높은 성능을 보이는 반면, 오픈소스 모델은 상당한 성능 격차를 보임으로써, 모델의 추론 능력 차이를 명확히 드러낸다. 그러나 CRUXEval은 여전히 간단한 문제만 다루므로, 복잡한 코드 실행이나 대규모 시스템 이해 능력을 평가하기는 어렵다. 또한, GPT-4조차도 일부 간단한 프로그램에서 일관된 실패를 보여, 코드 추론 능력의 한계를 드러낸다.

실용적 활용

CRUXEval은 코드 LLM의 실행 추론 및 이해 능력을 평가하는 데 활용될 수 있으며, 특히 코드 디버깅, 자동 테스트 생성, 코드 리팩토링 등 실행 피드백이 필요한 작업에서 유용할 수 있다. 또한, 모델 개선을 위한 훈련 데이터 생성 및 평가 지표로서도 활용 가능하다.