When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
[2608.14659] When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation Skip to main content Search Submit Donate Log in Search arXiv Press Enter to search · Advanced search Computer Science > Artificial Intelligence arXiv:2608.14659 (cs) [Submitted on 31 Jul 2026] Title: When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation Authors: Pranav Rakasi , Maanas Lalwani , Arnav Srivastava , Arya Palanivel , Tinuade Adeleke , Ruizhe Li , Sean Wu View a PDF of the paper titled When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation, by Pranav Rakasi and 6 other authors View PDF HTML (experimental) Abstract: Large language models for code generation often produce incorrect solutions without reliable indicators of failure. We study whether uncertainty estimation methods developed for natural language transfer to code generation, and whether such signals can improve code generation via selective self-correction. We evaluate five uncertainty methods: mean token entropy, verbalized confidence, $P(\text{True})$, entropy ensembles, and semantic entropy probes, across three small code LLMs on HumanEval and BigCodeBench. We find that multi-sample $P(\text{True})$ achieves the strongest correlation with correctness, while all the other methods, including semantic entropy probes, yield only weak correlation. We then use these uncertainty signals to drive three self-correction policies: adaptive decoding, uncertainty-based regeneration, and verification-based regeneration. Our results reveal a stronger negative finding than anticipated: uncertainty-based self-correction fails to reliably improve Pass@1, degrading accuracy in 5 of 6 configurations across both benchmarks ($-3$pp to $-10$pp), and adaptive decoding degrades accuracy in 4 of 6 configurations. Only verification-based self-correction reliably improves Pass@1, with gains of $+6$ to $+26$ percentage points on HumanEval and $+8$ to $+20$ percentage points on BigCodeBench, scaling inversely with baseline strength. These findings replicate consistently across both benchmarks and suggest that cheap uncertainty estimators are insufficient on their own to improve code correctness, and that their practical value lies in serving as gating signals for costlier execution-based correction loops rather than as standalone substitutes for verification. Subjects: Artificial Intelligence (cs.AI) ; Machine Learning (cs.LG); Software Engineering (cs.SE) ACM classes: I.2.5 Cite as: arXiv:2608.14659 [cs.AI] (or arXiv:2608.14659v1 [cs.AI] for this version) https://doi.org/10.48550/arXiv.2608.14659 Focus to learn more arXiv-issued DOI via DataCite Submission history From: Tinuade Adeleke [ view email ] [v1] Fri, 31 Jul 2026 21:13:02 UTC (517 KB) Full-text links: Access Paper: View a PDF of the paper titled When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generation, by Pranav Rakasi and 6 other authors View PDF HTML (experimental) TeX Source view license Current browse context: cs.AI < prev | next > new | recent | 2026-08 Change to browse by: cs cs.LG cs.SE References & Citations NASA ADS Google Scholar Semantic Scholar export BibTeX citation Loading... BibTeX formatted citation × loading... Data provided by: Bookmark Bibliographic Tools Bibliographic and Citation Tools Bibliographic Explorer Toggle Bibliographic Explorer ( What is the Explorer? ) Connected Papers Toggle Connected Papers ( What is Connected Papers? ) Litmaps Toggle Litmaps ( What is Litmaps? ) scite.ai Toggle scite Smart Citations ( What are Smart Citations? ) Code, Data, Media Code, Data and Media Associated with this Article alphaXiv Toggle alphaXiv ( What is alphaXiv? ) Links to Code Toggle CatalyzeX Code Finder for Papers ( What is CatalyzeX? ) DagsHub Toggle DagsHub ( What is DagsHub? ) GotitPub Toggle Gotit.pub ( What is GotitPub? ) Huggingface Toggle Hugging Face ( What is Huggingface? ) ScienceCast Toggle ScienceCast ( What is ScienceCast? ) Demos Demos Replicate Toggle Replicate ( What is Replicate? ) Spaces Toggle Hugging Face Spaces ( What is Spaces? ) Spaces Toggle TXYZ.AI ( What is TXYZ.AI? ) Related Papers Recommenders and Search Tools Link to Influence Flower Influence Flower ( What are Influence Flowers? ) Core recommender toggle CORE Recommender ( What is CORE? ) Author Venue Institution Topic About arXivLabs arXivLabs: experimental projects with community collaborators arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website. Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them. Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs . Which authors of this paper are endorsers? | Disable MathJax ( What is MathJax? ) We gratefully acknowledge support from our major funders , member institutions , , and all contributors. About · Help · Contact · Subscribe · Copyright · Privacy · Accessibility · Operational Status (opens in new tab) Major funding support from
Related documents
- CoGate: Confidence-Gated Co-Decoding for Secure Code Generation#414167
- Reading Between the Code Lines: On the Use of Self-Admitted Technical Debt for Security Analysis#665642
- Reading Between the Code Lines: On the Use of Self-Admitted Technical Debt for Security Analysis#664142
- When to Ponder: Adaptive Compute Allocation for Code Generation via Test-Time Training#652167
- When to Ponder: Adaptive Compute Allocation for Code Generation via Test-Time Training#650714
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive