CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution

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

322 citations recorded by the source corpus.

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.

Subfields: Artificial Intelligence, Hardware and Architecture, Information Systems, Evaluation & Benchmarks, Code Generation & Program Synthesis

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Armando Solar-Lezama
  2. Fei Huang
  3. Koushik Sen
  4. Naman Jain
  5. Jingren Zhou
  6. Tianjun Zhang
  7. Wen-Ding Li
  8. Shizhuo Dylan Zhang

In Hardware and Architecture

  1. Armando Solar-Lezama
  2. Koushik Sen
  3. Jingren Zhou
  4. Ion Stoica

In Information Systems

  1. Armando Solar-Lezama
  2. Fei Huang
  3. Koushik Sen
  4. Naman Jain
  5. Jingren Zhou
  6. Tianjun Zhang
  7. Ion Stoica
  8. Rishabh Singh

In Evaluation & Benchmarks

  1. Armando Solar-Lezama
  2. Fei Huang
  3. Naman Jain
  4. Jingren Zhou
  5. Tianjun Zhang
  6. Kai Dang
  7. Ion Stoica

In Code Generation & Program Synthesis

  1. Armando Solar-Lezama
  2. Koushik Sen
  3. Rishabh Singh

Citations in the corpus