Code-MUE: Measuring Code LLMs’ Uncertainty through Execution-Based Semantic Interaction Graphs
Xiaoning Ren, Yinxing Xue, Lei Ma, Yuheng Huang
Xi'an Jiaotong University · Chinese Academy of Sciences
Key points
From the paper's conclusion- To bridge this syntax-semantics gap, we introduce Code-MUE, a purely black-box framework that measures uncertainty through execution-based Semantic Interaction Graphs.
Abstract
As Code Large Language Models (LLMs) become central to modern software engineering, their inherent stochasticity poses significant real-world risks, where even minor errors can lead to severe functional, security, or safety consequences. Reliable automation, therefore, demands the ability to distinguish between confident, well-supported predictions and stochastic guessing. However, existing uncertainty estimation methods face a critical gap: white-box and grey-box techniques are often inapplicable to closed-source models, while standard black-box text metrics fail to capture the unique fragility of code, where syntactic variation does not necessarily imply semantic divergence. To bridge this syntax-semantics gap, we introduce Code-MUE, a purely black-box framework that measures uncertainty through execution-based Semantic Interaction Graphs. Unlike prior approaches that rely on superficial textual similarity, Code-MUE grounds uncertainty in observable runtime behavior and calculates the von Neumann entropy of the solution space to quantify global semantic diversity. A large-scale empirical study across eight state-of-the-art LLMs demonstrates that Code-MUE achieves a strong negative correlation with functional correctness, with Spearman’s correlation reaching up to −0.98. It significantly outperforms lexical and embedding-based baselines while enabling robust risk detection and selective prediction in practical workflows.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Beyond Confidence: Rethinking Uncertainty Calibration in Deep Code ModelsarXiv · 2026
- Characterizing Overconfident Failure in LLM-Based Code GenerationarXiv · 2026
- CONCUR: Benchmarking LLMs for Concurrent Code GenerationProceedings of the ACM on Software Engineering · 2026
- SafeLLM4SE: Statistical Evaluation and Reporting for LLM-based Software Engineering SystemsarXiv · 2026
- Micro Operational Robustness of LLMs on Code GenerationarXiv · 2026
- Understanding code semantics: a benchmark study of LLMsInternational Journal on Software Tools for Technology Transfer · 2026