Ensuring Functional Correctness of Large Code Models with Selective Generation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Jeong, Jaewoo, Kim, Taesoo, Park, Sangdon
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866918168605229056
author Jeong, Jaewoo
Kim, Taesoo
Park, Sangdon
author_facet Jeong, Jaewoo
Kim, Taesoo
Park, Sangdon
contents The hallucination of code generation models hinders their applicability to systems requiring higher safety standards. One critical bottleneck in addressing code hallucination is the difficulty of identifying the functional correctness of generated code, due to its unnatural form. We address this core bottleneck by automatically generating unit tests using dynamic code analysis tools, leveraging the \emph{executable nature} of code. Accordingly, we propose \emph{selective code generator} that abstains from uncertain generations -- based on the functional correctness evaluated by generated unit tests -- to theoretically control the correctness among non-abstained answers, \ie the false discovery rate. Finally, we propose to use generated unit tests in evaluation as well as in learning for precise code evaluation, calling this paradigm \emph{FuzzEval}. We demonstrate the efficacy of our method along with the controllability of code hallucination and reasonable selection efficiency.
format Preprint
id arxiv_https___arxiv_org_abs_2505_13553
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Ensuring Functional Correctness of Large Code Models with Selective Generation
Jeong, Jaewoo
Kim, Taesoo
Park, Sangdon
Software Engineering
Machine Learning
The hallucination of code generation models hinders their applicability to systems requiring higher safety standards. One critical bottleneck in addressing code hallucination is the difficulty of identifying the functional correctness of generated code, due to its unnatural form. We address this core bottleneck by automatically generating unit tests using dynamic code analysis tools, leveraging the \emph{executable nature} of code. Accordingly, we propose \emph{selective code generator} that abstains from uncertain generations -- based on the functional correctness evaluated by generated unit tests -- to theoretically control the correctness among non-abstained answers, \ie the false discovery rate. Finally, we propose to use generated unit tests in evaluation as well as in learning for precise code evaluation, calling this paradigm \emph{FuzzEval}. We demonstrate the efficacy of our method along with the controllability of code hallucination and reasonable selection efficiency.
title Ensuring Functional Correctness of Large Code Models with Selective Generation
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2505.13553