ChatPaper.aiChatPaper

HardTests: Sintesi di casi di test di alta qualità per la codifica con LLM

HardTests: Synthesizing High-Quality Test Cases for LLM Coding

May 30, 2025
Autori: Zhongmou He, Yee Man Choi, Kexun Zhang, Jiabao Ji, Junting Zhou, Dejia Xu, Ivan Bercovich, Aidan Zhang, Lei Li
cs.AI

Abstract

I verificatori svolgono un ruolo cruciale nel ragionamento dei modelli linguistici di grandi dimensioni (LLM), essendo necessari per tecniche post-addestramento come l'apprendimento per rinforzo. Tuttavia, ottenere verificatori affidabili per problemi di codifica complessi è difficile, poiché una soluzione errata ben camuffata potrebbe essere rilevata solo da casi limite scritti con cura da esseri umani, difficili da sintetizzare. Per affrontare questo problema, proponiamo HARDTESTGEN, una pipeline per la sintesi di test di alta qualità utilizzando LLM. Con questa pipeline, abbiamo curato un dataset completo di programmazione competitiva, HARDTESTS, con 47k problemi e test sintetici di alta qualità. Rispetto ai test esistenti, i test di HARDTESTGEN dimostrano una precisione superiore di 11,3 punti percentuali e un richiamo superiore di 17,5 punti percentuali nella valutazione del codice generato da LLM. Per problemi più difficili, il miglioramento nella precisione può arrivare fino a 40 punti. HARDTESTS si dimostra anche più efficace per l'addestramento dei modelli, misurato dalle prestazioni di generazione del codice a valle. Renderemo open-source il nostro dataset e la pipeline di sintesi all'indirizzo https://leililab.github.io/HardTests/.
English
Verifiers play a crucial role in large language model (LLM) reasoning, needed by post-training techniques such as reinforcement learning. However, reliable verifiers are hard to get for difficult coding problems, because a well-disguised wrong solution may only be detected by carefully human-written edge cases that are difficult to synthesize. To address this issue, we propose HARDTESTGEN, a pipeline for high-quality test synthesis using LLMs. With this pipeline, we curate a comprehensive competitive programming dataset HARDTESTS with 47k problems and synthetic high-quality tests. Compared with existing tests, HARDTESTGEN tests demonstrate precision that is 11.3 percentage points higher and recall that is 17.5 percentage points higher when evaluating LLM-generated code. For harder problems, the improvement in precision can be as large as 40 points. HARDTESTS also proves to be more effective for model training, measured by downstream code generation performance. We will open-source our dataset and synthesis pipeline at https://leililab.github.io/HardTests/.
PDF442June 2, 2025