Incoherence as Oracle-less Measure of Error in LLM-Based Code Generation
Not on the map. Why?
Abstract (arXiv)
Generating code from a natural language programming task is one of the most successful applications of Large Language Models (LLMs). Yet, the generated program may be buggy. Without an oracle, such as an existing, correct implementation or a formal specification, can we somehow estimate how likely the generated program is correct? In this paper, we propose a measure of incorrectness, called *incoherence*, that can be estimated efficiently in the absence of an oracle and allows us to establish a lower bound on the error, i.e., the probability that the LLM-generated program for that specification is incorrect. In our experiments, our incoherence-based methodology can automatically identify about two-thirds of incorrect programs without reports of false positives for the average task. In fact, *an oracle-based evaluation of LLMs can be reliably replaced by an incoherence-based evaluation*. In particular, we find a very strong agreement between the ranking of LLMs by the number of programs deemed correct via an oracle (pass@1) and the ranking of LLMs by the number of programs deemed correct via incoherence.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 10 of its 27 references that are in the map. First posted on arXiv 26 Jun 2025.
Builds on
10 of 27 references.
References · 10
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023Chainpoll: A high efficacy method for LLM hallucination detectioncited by 39
- 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
- 2025Enhancing LLM Code Generation with Ensembles: A Similarity-Based Selection Approachcited by 10
- 2024The Fault in our Stars: Quality Assessment of Code Generation Benchmarkscited by 9
- 2025MyGO Multiplex CoT: A Method for Self-Reflection in Large Language Models via Double Chain of Thought Thinkingcited by 5
- 2024Showing LLM-Generated Code Selectively Based on Confidence of LLMscited by 4
- 2018Assurances in Software Testing: A Roadmapcited by 2
Built on by
Citing papers per year: 2025: 2; 2026: 4.
6 papers.
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 15
- 2025FalseCrashReducer: Mitigating False Positive Crashes in OSS-Fuzz-Gen Using Agentic AIcited by 2
- 2026N-Version Programming with Coding Agentscited by 2
- 2026Beyond "What to Retrieve": Uncertainty in Retrieval-Augmented Code Generationcited by 1
- 2026How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repaircited by 0
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generationcited by 0
- 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation5 Aug 2026
- 2026How Do LLMs Read Bug Reports? An Empirical Study of Attention in LLMs for Automated Program Repair28 Jul 2026
- 2026Beyond "What to Retrieve": Uncertainty in Retrieval-Augmented Code Generation27 Jul 2026
- 2026N-Version Programming with Coding Agents18 Jun 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025FalseCrashReducer: Mitigating False Positive Crashes in OSS-Fuzz-Gen Using Agentic AI2 Oct 2025