mlsanityData to 24 Nov 2026

Which Signals of Code Correctness Survive Distribution Shift? Hidden-State and Causal Predictors of Program and Verdict Correctness

arXiv 2611.07876 ↗Submitted 5 Nov 2026cs.SE cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models increasingly judge code, yet without external feedback such judgments are unreliable, and verifying them by executing tests or by extended reasoning is costly. Instead, execution-free correctness predictors use signals from the model's output probabilities, sampled solutions, or hidden states to identify judgments that warrant further verification. However, these predictors may degrade under distribution shifts when generalizing across projects and languages. We compare six execution-free predictors from four families on Qwen3-Coder-30B and gpt-oss-20b under benchmark shift between LiveCodeBench and BigCodeBench and language shift across Python, C++ and Java. We evaluate two targets: whether the model's own verdict on a program can be trusted, and whether the program itself is correct. Besides established approaches, we adapt two novel causal localization methods to code, which have been shown to be more robust out-of-distribution on natural language tasks. For verdict correctness, causal localization improves robustness to language shift. For Qwen3-Coder a probe on the causally localized subspace stays 0.09 AUROC ahead of output confidence under language shift (0.11 in distribution), significantly outperforming the best non-causal predictor by 0.04 AUROC on average. This advantage, however, does not generalize consistently to gpt-oss or to benchmark shift. For program correctness, predictors transfer more successfully between benchmarks, largely by identifying problems on which the model tends to fail. However, their ability to rank candidates within the same problem is limited.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Builds on 46 of its 52 references that are in the map. Submitted 5 Nov 2026.

Builds on

46 of 52 references.

References · 46

  1. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,494
  2. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,243
  3. 2022Language Models (Mostly) Know What They Knowcited by 2,077
  4. 2016Understanding intermediate layers using linear classifier probescited by 1,541
  5. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,530
  6. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 1,170
  7. 2024LLM Evaluators Recognize and Favor Their Own Generationscited by 827
  8. 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 810
  9. 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 794
  10. 2024BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructionscited by 603
  11. 2021Causal Abstractions of Neural Networkscited by 461
  12. 2024INSIDE: LLMs' Internal States Retain the Power of Hallucination Detectioncited by 349
34 more
  1. 2024LLMs Know More Than They Show: On the Intrinsic Representation of LLM Hallucinationscited by 290
  2. 2024When Can LLMs Actually Correct Their Own Mistakes? A Critical Survey of Self-Correction of LLMscited by 282
  3. 2023Finding Alignments Between Interpretable Causal Variables and Distributed Neural Representationscited by 235
  4. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 162
  5. 2024Trust or Escalate: LLM Judges with Provable Guarantees for Human Agreementcited by 122
  6. 2023Is This the Subspace You Are Looking for? An Interpretability Illusion for Subspace Activation Patchingcited by 105
  7. 2025Detecting High-Stakes Interactions with Activation Probescited by 68
  8. 2024Calibration and Correctness of Language Models for Codecited by 54
  9. 2025CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding Taskscited by 43
  10. 2026Agentic Rubrics as Contextual Verifiers for SWE Agentscited by 32
  11. 2025On the Effectiveness of LLM-as-a-judge for Code Generation and Summarizationcited by 23
  12. 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 19
  13. 2025Correctness Assessment of Code Generated by Large Language Models Using Internal Representationscited by 18
  14. 2026LLMs Encode Their Failures: Predicting Success from Pre-Generation Activationscited by 18
  15. 2025Assessing Correctness in LLM-Based Code Generation via Uncertainty Estimationcited by 16
  16. 2025Addressing divergent representations from causal interventions on neural networkscited by 15
  17. 2025Internal Causal Mechanisms Robustly Predict Language Model Out-of-Distribution Behaviorscited by 13
  18. 2025Calibrating LLM Judges: Linear Probes for Fast and Reliable Uncertainty Estimationcited by 13
  19. 2023Lightweight reranking for language model generationscited by 11
  20. 2025Risk Assessment Framework for Code LLMs via Leveraging Internal Statescited by 11
  21. 2025On LLMs' Internal Representation of Code Correctnesscited by 9
  22. 2025Incoherence as Oracle-less Measure of Error in LLM-Based Code Generationcited by 7
  23. 2026CodeCircuit: Toward Inferring LLM-Generated Code Correctness via Attribution Graphscited by 5
  24. 2026The Confidence Manifold: Geometric Structure of Correctness Representations in Language Modelscited by 5
  25. 2026Code Is More Than Text: Uncertainty Estimation for Code Generationcited by 5
  26. 2025Multicalibration for LLM-based Code Generationcited by 4
  27. 2025Localized Calibrated Uncertainty in Code Language Modelscited by 4
  28. 2026Functional Entropy: Predicting Functional Correctness in LLM-Generated Code with Uncertainty Quantificationcited by 4
  29. 2026From Signals to Transfer: A Factorised Study of Probe-Based Uncertainty Estimation in Large Language Modelscited by 4
  30. 2026Diagnosing Correctness Probes under Self-Judgement Confoundingcited by 3
  31. 2026VERDI: Single-Call Confidence Estimation for Verification-Based LLM Judges via Decomposed Inferencecited by 2
  32. 2026Using Semantic Distance to Estimate Uncertainty in LLM-Based Code Generationcited by 1
  33. 2026When Uncertainty Isn't Enough: An Empirical Study of Self-Correction in Code Generationcited by 1
  34. 2026Characterizing Overconfident Failure in LLM-Based Code Generationcited by 1

Built on by

Not cited yet.