ChatPaper.aiChatPaper

Ripensare la verifica per la generazione di codice con LLM: dalla generazione al testing

Rethinking Verification for LLM Code Generation: From Generation to Testing

July 9, 2025
Autori: Zihan Ma, Taolin Zhang, Maosong Cao, Wenwei Zhang, Minnan Luo, Songyang Zhang, Kai Chen
cs.AI

Abstract

I modelli linguistici di grandi dimensioni (LLM) hanno recentemente ottenuto un successo significativo nei benchmark di generazione di codice come HumanEval e LiveCodeBench. Tuttavia, un esame dettagliato rivela che queste suite di valutazione spesso comprendono solo un numero limitato di casi di test omogenei, con il risultato che difetti sottili passano inosservati. Ciò non solo infla artificialmente le prestazioni misurate, ma compromette anche una stima accurata della ricompensa nei framework di apprendimento per rinforzo che utilizzano ricompense verificabili (RLVR). Per affrontare queste criticità, investigiamo sistematicamente il compito di generazione di casi di test (TCG) proponendo metriche multidimensionali progettate per quantificare rigorosamente la completezza delle suite di test. Inoltre, introduciamo un metodo collaborativo uomo-LLM (SAGA), che sfrutta l'esperienza di programmazione umana e la capacità di ragionamento degli LLM, con l'obiettivo di migliorare significativamente sia la copertura che la qualità dei casi di test generati. In aggiunta, sviluppiamo un TCGBench per facilitare lo studio del compito TCG. Gli esperimenti mostrano che SAGA raggiunge un tasso di rilevamento del 90,62% e un'accuratezza del verificatore del 32,58% su TCGBench. L'accuratezza del verificatore (Verifier Acc) del benchmark di valutazione della generazione di codice sintetizzato da SAGA è del 10,78% superiore rispetto a quella di LiveCodeBench-v6. Questi risultati dimostrano l'efficacia del metodo proposto. Speriamo che questo lavoro contribuisca a costruire una base scalabile per una valutazione affidabile del codice generato da LLM, avanzando ulteriormente l'RLVR nella generazione di codice e aprendo la strada alla sintesi automatizzata di test avversari e all'integrazione adattativa dei benchmark.
English
Large language models (LLMs) have recently achieved notable success in code-generation benchmarks such as HumanEval and LiveCodeBench. However, a detailed examination reveals that these evaluation suites often comprise only a limited number of homogeneous test cases, resulting in subtle faults going undetected. This not only artificially inflates measured performance but also compromises accurate reward estimation in reinforcement learning frameworks utilizing verifiable rewards (RLVR). To address these critical shortcomings, we systematically investigate the test-case generation (TCG) task by proposing multi-dimensional metrics designed to rigorously quantify test-suite thoroughness. Furthermore, we introduce a human-LLM collaborative method (SAGA), leveraging human programming expertise with LLM reasoning capability, aimed at significantly enhancing both the coverage and the quality of generated test cases. In addition, we develop a TCGBench to facilitate the study of the TCG task. Experiments show that SAGA achieves a detection rate of 90.62% and a verifier accuracy of 32.58% on TCGBench. The Verifier Accuracy (Verifier Acc) of the code generation evaluation benchmark synthesized by SAGA is 10.78% higher than that of LiveCodeBench-v6. These results demonstrate the effectiveness of our proposed method. We hope this work contributes to building a scalable foundation for reliable LLM code evaluation, further advancing RLVR in code generation, and paving the way for automated adversarial test synthesis and adaptive benchmark integration.
PDF281July 10, 2025