Assessing Correctness in LLM-Based Code Generation via Uncertainty Estimation
Not on the map. Why?
Abstract (arXiv)
In this work, we explore uncertainty estimation as a proxy for correctness in LLM-generated code. To this end, we adapt two state-of-the-art techniques from natural language generation -- one based on entropy and another on mutual information -- to the domain of code generation. Given the distinct semantic properties of code, we introduce modifications, including a semantic equivalence check based on symbolic execution. Our findings indicate a strong correlation between the uncertainty computed through these techniques and correctness, highlighting the potential of uncertainty estimation for quality assessment. Additionally, we propose a simplified version of the entropy-based method that assumes a uniform distribution over the LLM's responses, demonstrating comparable effectiveness. Using these techniques, we develop an abstention policy that prevents the model from making predictions when uncertainty is high, reducing incorrect outputs to near zero. Our evaluation on the LiveCodeBench shows that our approach significantly outperforms a baseline relying solely on LLM-reported log-probabilities.
Key facts. Cited by 14 papers in the map (data through 14 Oct 2026). First posted on arXiv 17 Feb 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 5; 2026: 9.
14 papers.
Sort:
By area:
- 2025On LLMs' Internal Representation of Code Correctnesscited by 5
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completioncited by 3
- 2025INSIGHT: INference-time Sequence Introspection for Generating Help Triggers in Vision-Language-Action Modelscited by 3
- 2025Eliminating Hallucination-Induced Errors in LLM Code Generation with Functional Clusteringcited by 2
- 2025EGG-SR: Embedding Symbolic Equivalence into Symbolic Regression via Equality Graphcited by 2
- 2026Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metricscited by 2
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generationcited by 2
- 2026Heteroskedastic Signals in Budgeted LLM Verification: Structural Heterogeneity Limits Optimization Gainscited by 1
- 2026LLMs + Security = Troublecited by 0
- 2026Inference-Time Code Selection via Symbolic Equivalence Partitioningcited by 0
- 2026Code-MUE: Measuring Code LLMs' Uncertainty through Execution-based Semantic Interaction Graphscited by 0
- 2026Is This Your Final Answer? Cross-Contextual Consistency as a Measure of LLM Credibilitycited by 0
- 2026Characterizing Overconfident Failure in LLM-Based Code Generation8 Oct 2026
- 2026Is This Your Final Answer? Cross-Contextual Consistency as a Measure of LLM Credibility10 Aug 2026
- 2026When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation31 Jul 2026
- 2026Code-MUE: Measuring Code LLMs' Uncertainty through Execution-based Semantic Interaction Graphs14 Jul 2026
- 2026Heteroskedastic Signals in Budgeted LLM Verification: Structural Heterogeneity Limits Optimization Gains14 Jun 2026
- 2026Inference-Time Code Selection via Symbolic Equivalence Partitioning7 Apr 2026
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generation4 Mar 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2026Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics5 Jan 2026
- 2025On LLMs' Internal Representation of Code Correctness8 Dec 2025
- 2025EGG-SR: Embedding Symbolic Equivalence into Symbolic Regression via Equality Graph8 Nov 2025
- 2025INSIGHT: INference-time Sequence Introspection for Generating Help Triggers in Vision-Language-Action Models1 Oct 2025
- 2025On LLMs' Internal Representation of Code Correctnesscited by 5
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completioncited by 3
- 2025Eliminating Hallucination-Induced Errors in LLM Code Generation with Functional Clusteringcited by 2
- 2025EGG-SR: Embedding Symbolic Equivalence into Symbolic Regression via Equality Graphcited by 2
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generationcited by 2
- 2026Heteroskedastic Signals in Budgeted LLM Verification: Structural Heterogeneity Limits Optimization Gainscited by 1
- 2026LLMs + Security = Troublecited by 0
- 2026Inference-Time Code Selection via Symbolic Equivalence Partitioningcited by 0
- 2026Code-MUE: Measuring Code LLMs' Uncertainty through Execution-based Semantic Interaction Graphscited by 0
- 2026Is This Your Final Answer? Cross-Contextual Consistency as a Measure of LLM Credibilitycited by 0
- 2026When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generationcited by 0
- 2026Characterizing Overconfident Failure in LLM-Based Code Generationcited by 0
- 2026Characterizing Overconfident Failure in LLM-Based Code Generation8 Oct 2026
- 2026Is This Your Final Answer? Cross-Contextual Consistency as a Measure of LLM Credibility10 Aug 2026
- 2026When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation31 Jul 2026
- 2026Code-MUE: Measuring Code LLMs' Uncertainty through Execution-based Semantic Interaction Graphs14 Jul 2026
- 2026Heteroskedastic Signals in Budgeted LLM Verification: Structural Heterogeneity Limits Optimization Gains14 Jun 2026
- 2026Inference-Time Code Selection via Symbolic Equivalence Partitioning7 Apr 2026
- 2026CONCUR: Benchmarking LLMs for Concurrent Code Generation4 Mar 2026
- 2026LLMs + Security = Trouble9 Feb 2026
- 2025On LLMs' Internal Representation of Code Correctness8 Dec 2025
- 2025EGG-SR: Embedding Symbolic Equivalence into Symbolic Regression via Equality Graph8 Nov 2025
- 2025The Fools are Certain; the Wise are Doubtful: Exploring LLM Confidence in Code Completion22 Aug 2025
- 2025Eliminating Hallucination-Induced Errors in LLM Code Generation with Functional Clustering16 May 2025