CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution
Alex Gu, Baptiste Rozi\`ere, Hugh Leather, Armando Solar-Lezama,, Gabriel Synnaeve, Sida I. Wang

TL;DR
CRUXEval is a new benchmark with 800 Python functions designed to evaluate code reasoning, understanding, and execution, revealing gaps in current models' capabilities and providing insights for future improvements.
Contribution
It introduces a generic recipe for creating execution benchmarks and evaluates twenty models, highlighting their limitations and the potential of simple schemes like CoT and fine-tuning.
Findings
Recent high-scoring models on HumanEval perform poorly on CRUXEval.
GPT-4 with CoT achieves up to 81% pass@1 on output prediction.
Open-source models like Code Llama 34B lag behind GPT-4 in performance.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Software Engineering Research · Machine Learning and Data Classification
MethodsMulti-Head Attention · Attention Is All You Need · Linear Layer · Softmax · Adam · Layer Normalization · Residual Connection · Absolute Position Encodings · Dropout · Dense Connections
