TL;DR
Large Language Models (LLMs) are increasingly used to judge code, but their self-verdicts are often unreliable. This paper demonstrates that "execution-free" predictors—which use internal model signals like hidden states rather than running tests—can identify when a model's judgment is trustworthy, with causal localization methods proving particularly robust when switching between programming languages.
What Problem Does This Paper Address?
As LLMs take on roles like "LLM-as-a-judge" in software engineering, we face a dilemma: how do we know if the model’s assessment of a piece of code is actually correct? The gold standard is running a full test suite, but that is computationally expensive and requires a secure execution environment.
Researchers have turned to "execution-free" signals—like the model's own confidence scores or internal hidden states—to predict correctness. However, these predictors often suffer from distribution shift. A predictor trained to spot bugs in Python algorithmic challenges might completely fail when applied to Java enterprise code. This paper investigates which internal signals are "robust" enough to survive shifts in programming languages and task types.
Methods
The authors compare six predictors across four distinct families:
- Output Token Probabilities (Confidence): Simply looking at how "sure" the model is when it outputs a "Yes" or "No" verdict.
- Consistency (EigenScore): Measuring how much the model's internal states vary across multiple sampled solutions for the same problem.
- Internal Feature Probing: Training linear classifiers (probes) on the model's hidden states to detect "correctness" signals.
- Causal Localization: The most novel approach in this context. It uses Distributed Alignment Search (DAS) to find a specific low-dimensional subspace in the hidden states that causally controls the model's verdict.
By using "interchange interventions"—copying a subspace from a "source" example into a "base" example and seeing if the model's answer flips—they identify the internal "knobs" the model actually uses to make its decision.
Datasets
The study utilizes two major benchmarks to simulate distribution shifts:
- LiveCodeBench (LCB): Focused on competitive programming and algorithmic challenges.
- BigCodeBench (BCB): Focused on practical, library-heavy Python tasks.
- Language Shift Set: The authors adapted LCB problems into Python, C++, and Java to specifically test how predictors handle changes in programming syntax while the underlying logic remains the same.
The experiments were conducted using two open-weight models: Qwen3-Coder-30B and gpt-oss-20b.
Key Insights and Ideas
- Verdict vs. Program Correctness: The paper makes a crucial distinction between predicting if the code is right ($y^{prog}$) and predicting if the model's judgment of the code is right ($y^{verd}$). These targets respond differently to distribution shifts.
- Causal Robustness: For the Qwen3-Coder model, causal methods were significantly more robust to language shifts than standard probes. The "causal subspace" seems to capture a more universal representation of "correctness" that isn't tied to a specific language's syntax.
- The "Problem" Signal: A surprising finding is that these predictors are much better at identifying hard problems (where the model is likely to fail across the board) than they are at distinguishing between a "good" and "bad" candidate solution for the same problem.
- Intervention vs. Readout: The authors found that once the causal subspace is identified, simply reading the values from that subspace (a "value probe") is just as effective as performing expensive counterfactual simulations.
Key Results
- Language Shift Lead: Under language shift, the causal value probe for Qwen3-Coder maintained a 0.09 AUROC lead over simple output confidence and outperformed the best non-causal probe by 0.04 AUROC.
- Benchmark Shift is Harder: While language shift was manageable for causal methods, shifting between benchmarks (e.g., LCB to BCB) caused almost all verdict predictors to degrade significantly, often falling toward chance levels.
- Subspace vs. Full State: Figure 4 shows that the learned causal subspace consistently outperforms random subspaces of the same dimension, proving that the DAS method is successfully localizing meaningful signals rather than just benefiting from dimensionality reduction.
Limitations and Future Work
- Model Specificity: The causal advantage was clear for Qwen3-Coder but less pronounced for gpt-oss-20b, suggesting that different model architectures or training recipes might distribute "correctness" information differently.
- Ranking within Problems: The limited ability to rank candidates for a single problem remains a hurdle for using these methods in "Best-of-N" sampling strategies.
- Future Directions: The authors suggest exploring whether these internal signals can be used to "gate" more expensive checks in agentic workflows—only triggering a full test execution when the internal "trust" signal is low.
Summary updated