Code-MUE: Measuring Code LLMs' Uncertainty through Execution-based Semantic Interaction Graphs

· Source: Computation and Language · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering · Depth: Expert, quick

Summary

Code-MUE is a novel black-box framework designed to measure the uncertainty of Code Large Language Models (LLMs) by addressing the critical syntax-semantics gap in existing methods. Unlike approaches relying on textual similarity, Code-MUE grounds uncertainty in observable runtime behavior through execution-based Semantic Interaction Graphs. It quantifies global semantic diversity by calculating the Von Neumann entropy of the solution space. A large-scale empirical study involving eight state-of-the-art LLMs demonstrated Code-MUE's strong negative correlation with functional correctness, achieving a Spearman's correlation up to -0.98. This significantly outperforms lexical and embedding-based baselines, enabling robust risk detection and selective prediction in practical software engineering workflows.

Key takeaway

For Machine Learning Engineers deploying Code LLMs in critical software systems, you should integrate Code-MUE to quantify model uncertainty based on observable execution behavior, moving beyond superficial text metrics. This enables robust risk detection and selective prediction, significantly improving reliability and mitigating potential functional, security, or safety consequences stemming from LLM stochasticity.

Key insights

Code-MUE quantifies Code LLM uncertainty by analyzing the semantic diversity of execution-based outputs, bridging the syntax-semantics gap.

Principles

Method

Code-MUE constructs Semantic Interaction Graphs from the runtime behavior of multiple LLM-generated code variants. It then calculates the Von Neumann entropy of this solution space to quantify global semantic diversity and, consequently, model uncertainty.

In practice

Topics

Best for: AI Engineer, Research Scientist, AI Scientist, Machine Learning Engineer, Software Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Computation and Language.