Skip to content
Preprint

On the Robustness of LLMs'Internal Representation of Code Correctness

Aug 2026 · 1 citation · 58 references
Computer Science

TL;DR

This work studies an internal signal of code correctness that is able to judge candidate solutions better than the model's token-level or stated confidence, leaving open an important question: whether it reflects a robust property of the model or an artifact of that choice.

Abstract

Code generated by modern language models often reads naturally. Yet, it also often fails to implement what was asked. This should be no surprise, as research shows the models'own confidence signals are poorly calibrated with actual correctness. A promising way to assess correctness looks inside the model: by contrasting the hidden states of correct and incorrect programs, recent work captured an internal signal of code correctness that is able to judge candidate solutions better than the model's token-level or stated confidence, with no test execution. However, this signal was captured under one particular way, leaving open an important question: whether it reflects a robust property of the model or an artifact of that choice. We study this question systematically, varying how the signal is extracted from the model internals. Besides this, we also ask if the signal's quality is limited by the data used to extract it, by constructing program pairs that differ only in the fault that makes them incorrect. Our results show that no single configuration is best, and that isolating the fault does not help.

View source

Similar papers

Preprint Aug 2026

Unreliable in Practice? A Comprehensive Study of Errors in LLM-Generated Code

It is observed that generated code often omits basic input validation or memory-safety checks, which can lead to overflows, resource exhaustion, or other reliability/security issues, and even the largest models frequently make simple mistakes.

Rodrigo Pato Nogueira, Marco Vieira, João R. Campos · 0 citations
Aug 2026

Increasing the Precision of Static Code Analysis Using Large Language Models

An approach to verifying the results of static code analysis using large language models (LLMs), which filters warnings to eliminate false positives, which was implemented in SharpChecker, an industrial static analyzer for C#.

D. D. Panov, N. V. Shimchik, D. A. Chibisov et al. · 0 citations
#artificial intelligence Review Sep 2026

When Models Edit Too Much: On the Fidelity of Minimal Code Edits

This work constructs an evaluation framework from 400 BigCodeBench problems by injecting controlled AST-level corruptions into reference solutions, giving each repair task a known minimal patch, and positions edit fidelity as a distinct axis of code-repair quality and shows that it can be measured and learned.

Tong-Yao Zhu, Wei-Lun Lim, Min-Yen Kan · 1 citation
#artificial intelligence Preprint Aug 2026

Beyond the Answer Key: Robustness Evaluation of Large Language Models for Step-Level Mathematical Verification

Evaluating state-of-the-art open LLMs reveals a significant robustness gap, and shows that reliable process-level verification remains challenging, and evaluator robustness should be measured separately from solver accuracy, even in a simple algebraic domain with exact ground truth.

Fatemeh Mazdarani, Carlos Toxtli · 2 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.