mlsanityData to 14 Oct 2026

Functional Entropy: Predicting Functional Correctness in LLM-Generated Code with Uncertainty Quantification

arXiv 2605.28500 ↗First posted 27 May 2026cs.CL cs.AI cs.LGcited by 3

Not on the map. Why?

Abstract (arXiv)

Large language models have shown impressive capabilities in code generation, yet they often produce functionally incorrect code. Uncertainty quantification (UQ) methods have emerged as a promising approach for detecting hallucinations in natural language generation, but their effectiveness for code generation tasks remains underexplored. We systematically evaluate how UQ techniques transfer to code generation across three programming languages, five LLMs, and over 1,700 problems. We find that some token-probability-based methods generalize effectively without modification, while sampling-based methods relying on natural language inference (NLI) fail because NLI models cannot distinguish functionally different code, causing most responses to collapse into a single semantic cluster. To address this, we introduce functional equivalence methods, a family of code-specific methods that replace NLI-based semantic equivalence with an LLM-based functional equivalence assessment, including functional entropy, a code-specific analog of semantic entropy. Functional equivalence methods achieve top AUROC in 11 out of 15 model-benchmark combinations and the best calibration across most settings, consistently outperforming both NLI-based counterparts and all other methods evaluated.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 24 of its 44 references that are in the map. First posted on arXiv 27 May 2026.

Builds on

24 of 44 references.

References · 24

  1. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,181
  2. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  3. 2023Just Ask for Calibration: Strategies for Eliciting Calibrated Confidence Scores from Language Models Fine-Tuned with Human Feedbackcited by 812
  4. 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
  5. 2024Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMscited by 259
  6. 2022MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generationcited by 136
  7. 2023Quantifying Uncertainty in Answers from any Language Model and Enhancing their Trustworthinesscited by 122
  8. 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 107
  9. 2024Benchmarking Uncertainty Quantification Methods for Large Language Models with LM-Polygraphcited by 105
  10. 2024LUQ: Long-text Uncertainty Quantification for LLMscited by 81
  11. 2024Calibration and Correctness of Language Models for Codecited by 49
  12. 2024CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verificationcited by 34
12 more
  1. 2025Uncertainty-Guided Chain-of-Thought for Code Generation with LLMscited by 32
  2. 2025Uncertainty Quantification for LLMs through Minimum Bayes Risk: Bridging Confidence and Consistencycited by 30
  3. 2024Atomic Calibration of LLMs in Long-Form Generationscited by 24
  4. 2023Generation Probabilities Are Not Enough: Uncertainty Highlighting in AI Code Completionscited by 20
  5. 2026Internal Representations as Indicators of Hallucinations in Agent Tool Selectioncited by 19
  6. 2025Uncertainty Quantification for Language Models: A Suite of Black-Box, White-Box, LLM Judge, and Ensemble Scorerscited by 18
  7. 2024Collu-Bench: A Benchmark for Predicting Language Model Hallucinations in Codecited by 13
  8. 2025EAGer: Entropy-Aware GEneRation for Adaptive Inference-Time Scalingcited by 10
  9. 2025Hallucination Detection for LLM-based Text-to-SQL Generation via Two-Stage Metamorphic Testingcited by 9
  10. 2025A Systematic Literature Review of Code Hallucinations in LLMs: Characterization, Mitigation Methods, Challenges, and Future Directions for Reliable AIcited by 6
  11. 2026HalluJudge: A Reference-Free Hallucination Detection for Context Misalignment in Code Review Automationcited by 5
  12. 2026Fine-Grained Uncertainty Quantification for Long-Form Language Model Outputs: A Comparative Studycited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.