CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution
Alex Gu, Baptiste Rozière, Hugh James Leather, Armando Solar-Lezama, Gabriel Synnaeve, Sida Wang
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 73 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Learning to Reason without External Rewards 引用了 Absolute Zero: Reinforced Self-play Reasoning with Zero Data
- Learning to Reason without External Rewards 引用了 Scalable Best-of-N Selection for Large Language Models via Self-Certainty
- Learning to Reason without External Rewards 引用了 Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation
- Learning to Reason without External Rewards 引用了 Training language models to follow instructions with human feedback
- SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution 引用了 Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation
- SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Self-Refine: Iterative Refinement with Self-Feedback 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Self-Refine: Iterative Refinement with Self-Feedback 引用了 Training language models to follow instructions with human feedback
- Absolute Zero: Reinforced Self-play Reasoning with Zero Data 引用了 Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation
- Absolute Zero: Reinforced Self-play Reasoning with Zero Data 引用了 Training language models to follow instructions with human feedback
- The Mamba in the Llama: Distilling and Accelerating Hybrid Models 引用了 Language Models are Few-Shot Learners
- Scalable Best-of-N Selection for Large Language Models via Self-Certainty 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Scalable Best-of-N Selection for Large Language Models via Self-Certainty 引用了 Training language models to follow instructions with human feedback
- Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation 引用了 Language Models are Few-Shot Learners
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 引用了 Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper73
- Absolute Zero: Reinforced Self-play Reasoning with Zero DataAndrew Zhao, Yiran Wu, Tong Wu, Quentin Xu 等NeurIPS 2025 · 361 次引用
- SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software EvolutionYuxiang Wei, Olivier Duchenne, Jade Copet, Quentin Carbonneaux 等NeurIPS 2025 · 291 次引用
- Learning to Reason without External RewardsXuandong Zhao, Zhewei Kang, Aosong Feng, Sergey Levine 等ICLR 2026 · 218 次引用
- Scalable Best-of-N Selection for Large Language Models via Self-CertaintyZhewei Kang, Xuandong Zhao, Dawn SongNeurIPS 2025 · 211 次引用
- The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush 等NeurIPS 2024 · 146 次引用
它引用的 Paper34
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
- Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code GenerationJiawei Liu, Chunqiu Steven Xia, Yuyao Wang, Lingming ZhangNeurIPS 2023 · 2,317 次引用
相关 Paper
- CRUXEVAL-X: A Benchmark for Multilingual Code Reasoning, Understanding and ExecutionRuiyang Xu, Jialun Cao, Yaojie Lu, Ming Wen 等ACL 2025 · 26 次引用
- Reasoning Runtime Behavior of a Program with LLM: How Far are We?Junkai Chen, Zhiyuan Pan, Xing Hu, Zhenhao Li 等ICSE 2025 · 5 次引用
- NaturalCodeBench: Examining Coding Performance Mismatch on HumanEval and Natural User QueriesShudan Zhang, Hanlin Zhao, Xiao Liu, Qinkai Zheng 等ACL Findings 2024 · 11 次引用
- RealisticCodeBench: Towards More Realistic Evaluation of Large Language Models for Code GenerationXiao Yu, Haoxuan Chen, Lei Liu, Xing Hu 等ASE 2025
- ContractEval: A Benchmark for Evaluating Contract-Satisfying Assertions in Code GenerationSoohan Lim, Joonghyuk Hahn, Hyunwoo Park, Sang-Ki Ko 等ACL Findings 2026
