ChatPaper.aiChatPaper

CRUXEval: Un Benchmark per il Ragionamento, la Comprensione e l'Esecuzione del Codice

CRUXEval: A Benchmark for Code Reasoning, Understanding and Execution

January 5, 2024
Autori: Alex Gu, Baptiste Rozière, Hugh Leather, Armando Solar-Lezama, Gabriel Synnaeve, Sida I. Wang
cs.AI

Abstract

Presentiamo CRUXEval (Code Reasoning, Understanding, and eXecution Evaluation), un benchmark composto da 800 funzioni Python (3-13 righe). Ogni funzione è accompagnata da una coppia input-output, dando origine a due compiti naturali: la previsione dell'input e la previsione dell'output. In primo luogo, proponiamo una ricetta generica per la generazione del nostro benchmark di esecuzione, che può essere utilizzata per creare future variazioni del benchmark. In secondo luogo, valutiamo venti modelli di codice sul nostro benchmark e scopriamo che molti modelli recenti ad alto punteggio su HumanEval non mostrano gli stessi miglioramenti sul nostro benchmark. In terzo luogo, dimostriamo che semplici schemi di CoT (Chain of Thought) e fine-tuning possono migliorare le prestazioni sul nostro benchmark, ma rimangono lontani dal risolverlo. La configurazione migliore, GPT-4 con chain of thought (CoT), raggiunge un pass@1 del 75% e dell'81% rispettivamente per la previsione dell'input e dell'output. Al contrario, Code Llama 34B raggiunge un pass@1 del 50% e del 46% per la previsione dell'input e dell'output, evidenziando il divario tra modelli open source e closed source. Poiché nessun modello è vicino a eccellere in CRUXEval, forniamo esempi di errori consistenti di GPT-4 su programmi semplici come una lente per comprendere le sue capacità di ragionamento sul codice e le aree di miglioramento.
English
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.
PDF110February 9, 2026