In-Context Learning as an Effective Estimator of Functional Correctness of LLM-Generated Code

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Das, Susmita, Ghosh, Madhusudan, Swami, Priyanka, Ganguly, Debasis, Calikli, Gul
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915374462664704
author Das, Susmita
Ghosh, Madhusudan
Swami, Priyanka
Ganguly, Debasis
Calikli, Gul
author_facet Das, Susmita
Ghosh, Madhusudan
Swami, Priyanka
Ganguly, Debasis
Calikli, Gul
contents When applying LLM-based code generation to software development projects that follow a feature-driven or rapid application development approach, it becomes necessary to estimate the functional correctness of the generated code in the absence of test cases. Just as a user selects a relevant document from a ranked list of retrieved ones, a software generation workflow requires a developer to choose (and potentially refine) a generated solution from a ranked list of alternative solutions, ordered by their posterior likelihoods. This implies that estimating the quality of a ranked list -- akin to estimating "relevance" for query performance prediction (QPP) in IR -- is also crucial for generative software development, where quality is defined in terms of "functional correctness". In this paper, we propose an in-context learning (ICL) based approach for code quality estimation. Our findings demonstrate that providing few-shot examples of functionally correct code from a training set enhances the performance of existing QPP approaches as well as a zero-shot-based approach for code quality estimation.
format Preprint
id arxiv_https___arxiv_org_abs_2507_05200
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle In-Context Learning as an Effective Estimator of Functional Correctness of LLM-Generated Code
Das, Susmita
Ghosh, Madhusudan
Swami, Priyanka
Ganguly, Debasis
Calikli, Gul
Software Engineering
Information Retrieval
When applying LLM-based code generation to software development projects that follow a feature-driven or rapid application development approach, it becomes necessary to estimate the functional correctness of the generated code in the absence of test cases. Just as a user selects a relevant document from a ranked list of retrieved ones, a software generation workflow requires a developer to choose (and potentially refine) a generated solution from a ranked list of alternative solutions, ordered by their posterior likelihoods. This implies that estimating the quality of a ranked list -- akin to estimating "relevance" for query performance prediction (QPP) in IR -- is also crucial for generative software development, where quality is defined in terms of "functional correctness". In this paper, we propose an in-context learning (ICL) based approach for code quality estimation. Our findings demonstrate that providing few-shot examples of functionally correct code from a training set enhances the performance of existing QPP approaches as well as a zero-shot-based approach for code quality estimation.
title In-Context Learning as an Effective Estimator of Functional Correctness of LLM-Generated Code
topic Software Engineering
Information Retrieval
url https://arxiv.org/abs/2507.05200