Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

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

Causal probes keep verdict signals more robust to language shift in code models

  • Problem Hidden-state predictors of code correctness are accurate in distribution but weaken when the benchmark or programming language changes. Checking verdicts by running tests is costly.
  • Method The authors adapt two causal localization methods to code. Instead of reading the whole hidden state, they learn a six-dimensional subspace that holds the verdict and fit a probe on it.
  • Results On Qwen3-Coder, the probe on the causal subspace stays 0.09 AUROC ahead of output confidence under language shift.

Why shift breaks cheap correctness signals

LLMs increasingly judge code, including their own, and without external feedback those judgments are unreliable. Running tests is costly, because it requires an environment and a test suite. Probes on hidden states are attractive here because they reuse activations the model computes anyway.

The weak point is distribution shift, since predictors fitted on hidden states are accurate in distribution but weaken under shift. That prior work largely focused on predicting program correctness. To the authors' knowledge, none of these studies includes causal methods or asks whether the model's own verdict can be trusted.

The study separates two targets, because a candidate can be correct while the model rejects it, or the reverse. Program correctness asks whether the candidate passes the tests, as operationalized by the test suite. The study compares six execution-free predictors from four families for these two targets on Qwen3-Coder-30B and gpt-oss-20b.

It tests them under benchmark shift between LiveCodeBench and BigCodeBench and under language shift across Python, C++ and Java.

How causal localization is adapted to code

The key idea is to find a small subspace of the hidden state that the model uses to settle its verdict, and then read it. Every predictor reads one judging pass, in which the model answers Yes or No at the last prompt token. The verdict is read from the answer probabilities, and the hidden state at that position feeds the probes. Because a concept such as correctness is spread across many dimensions, Distributed Alignment Search learns where to look instead of relying on named variables.

Distributed Alignment Search learns a k-dimensional subspace R with orthonormal columns, and the paper sets k to 6 per layer. An interchange intervention replaces the component of the base state inside R with the source's component and leaves the rest of the base state untouched. The forward pass of the base then continues through all later layers from the patched state, as written in equation (1).

Training uses only candidates the model judges correctly, so the verdict coincides with program correctness on those candidates.

Figure 1: (a) The judging pass: the model reads the problem, the candidate and
the question and answers Yes or No at the last prompt token. The confidence
ba…

Fig. 1 . (a) The judging pass: the model reads the problem, the candidate and the question and answers Yes or No at the last prompt token. The confidence baseline reads answer probabilities, the probe the hidden state hℓ of one layer, the value probe its projection onto the learned subspace. (b) An interchange intervention: the subspace coordinates of a source example’s hidden state replace those of a base example, and the base’s forward pass continues. DAS learns a subspace so that the base then answers like the source. Counterfactual simulation scores a candidate by making it the source for B = 16 fixed bases from the training set. A source state that firmly encodes its verdict should enforce it on the bases, one on which the model is unsure should not. The more consistently the bases adopt the candidate’s verdict, the more likely it is correct.

Original paper · CC BY 4.0 · Viola Campos, Thomas Klassert, Adrian Ulges · Which Signals of Code Correctness Survive Distribution Shift? Hidden-State and Causal Predictors of Program and Verdict Correctness · Original paper figure · Extracted the figure area from page 4 of the original PDF.

Counterfactual simulation uses the learned subspace to score each candidate by making it the source for a fixed set of B = 16 bases. The scores csprog and csverd average the probability of Yes or of the candidate's own verdict over the intervened bases. Counterfactual simulation costs B additional forward passes per candidate. The value probe instead fits a logistic regression on the k-dimensional projection R transposed times the hidden state, so it needs no forward pass beyond the judging pass.

For the verdict target, its score is the confidence |p(Yes) minus one half|, and for the program target its Yes probability.

Training and selection are set up in the study design, with the probe trained on 512 candidates per class. Because each subspace takes several GPU hours, DAS is trained only at a subset of layers, while the probe and LAT use every layer.

Verdict correctness under language shift

In distribution, the methods that read hidden states clearly beat output confidence on the language sets. For Qwen3-Coder, the probe, counterfactual simulation and the value probe are level at 0.758 to 0.761 on the language sets. For gpt-oss, confidence sits close to chance at 0.54 to 0.57, while counterfactual simulation is best at 0.808.

Table III breaks these numbers down by training language, which the in-distribution averages hide.

Under language shift, the Qwen3-Coder probe drops from 0.76 to 0.67 when the language changes. Both causal methods fall only from 0.76 to 0.73, while confidence reaches 0.64 under shift. It leads in each of the three partitions, by +0.035, +0.053 and +0.038. This makes the causal subspace the most robust verdict signal for Qwen3-Coder under language shift.

For gpt-oss, all trained methods lose 0.07 to 0.12 AUROC under language shift. Under benchmark shift from LiveCodeBench to BigCodeBench, all trained Qwen3-Coder methods fall to 0.453 to 0.485. That range sits below confidence at 0.552, so verdict prediction doesn't transfer reliably between benchmarks. The causal advantage therefore holds for one model and one shift type only.

Whether the learned subspace or the intervention carries the gain

The question is whether the causal advantage comes from the intervention, from the learned directions, or from the low dimension of the readout. The value probe reads the subspace directly in the judging pass, so it adds no forward pass beyond the one that defines the verdict. On Qwen3-Coder, the two are equally robust under language shift, with a mean difference of −0.000 ± 0.033 on the verdict target.

On the program target, the difference is +0.004 ± 0.007, so the two methods stay level there as well.

A six-dimensional readout could transfer better simply because it is small, so the authors tested random subspaces of the same size. They trained the value probe on three random subspaces of dimension six at the same layer. The same pattern holds at every trained layer, so the learned direction matters and the low dimension does not explain the gain.

Interchange intervention accuracy (IIA) measures how often DAS succeeds in swapping the model's verdict between two inputs. A high IIA shows that the subspace controls the decision, but it doesn't show that the decision is right. On gpt-oss-20b, the two diverge across layers, as Figure 4 illustrates. At L11 and L13, where DAS succeeds only partly with IIA 0.54 to 0.64, the learned subspace transfers better than random ones, at 0.56 to 0.68 against 0.52 to 0.55 under shift.

At L17 to L21, where DAS almost always succeeds with IIA 0.91 to 0.95, the subspace falls to 0.52 to 0.58, no better than random. Since IIA cannot separate these cases, the authors choose layers by held-out prediction instead.

Program correctness and problem-level agreement

For the program target the picture changes, because the full-state probe loses 0.088 AUROC for Qwen3-Coder under language shift. For Qwen3-Coder, LAT and both causal methods remain significantly ahead of confidence by 0.044 to 0.054 AUROC on average. The value probe and counterfactual simulation trail the best non-causal method by 0.010 and 0.014 AUROC, and neither gap is significant.

For gpt-oss the value probe is significantly behind at −0.068, while counterfactual simulation is statistically level at −0.025. So the robustness of causal localization seen for verdict correctness in RQ1 doesn't carry over to program correctness.

Program correctness does transfer between benchmarks in both directions, unlike the verdict target. Trained on LiveCodeBench and tested on BigCodeBench, the methods reach 0.580 to 0.656 for Qwen3-Coder-30B. Transfer from BigCodeBench back to LiveCodeBench is similarly strong, reaching 0.70 to 0.82 for Qwen3-Coder-30B. Pooled AUROC, however, mixes problem difficulty with the ability to rank candidates inside one problem.

Under language shift, within-problem AUROC lies between 0.58 and 0.64 for all methods and both models. Over the same shift, pooled AUROC lies between 0.67 and 0.81, so most of the pooled score comes from ranking problems.

The authors also ask whether the model's own generation already holds the signal, by probing its hidden states during generation. A probe on the generation's last code token scores 0.895 in distribution, against 0.886 for the judging pass on Qwen3-Coder-30B. Under language shift the same readout reaches 0.795, against 0.779 for the judging pass, while for gpt-oss it falls behind at 0.673 against 0.704.

EigenScore reads agreement among sampled candidates from the hidden states and needs no training, so it can't lose under shift. For Qwen3-Coder-30B, EigenScore sits at chance on LiveCodeBench at 0.504 and at 0.528 on the language sets. Agreement gives no consistent advantage over a single pass, and EigenScore doesn't help where it starts near chance.

Limits on what these results can support

The benchmark tests define correctness here, so an error those tests miss also counts as a correct program. The judging prompt asks for one token and no reasoning, which the authors chose because reasoning would be costly. When gpt-oss-20b reasons at medium effort, its median output is 1,101 tokens per candidate. On 498 program-target candidates, that reasoning raises its balanced accuracy from 62.4% to 67.8%.

Its AUROC for the Yes probability rises from 0.68 to 0.73, which remains below the trained internal methods. The authors don't count the reasoning tokens as free, so the comparison trades accuracy against extra generation.

The probe and LAT choose among layers 25 to 49, while the causal methods choose among the 4 to 7 layers where DAS was trained. A wider layer search could find a better layer, but a layer that is best in distribution may not transfer under shift. Counterfactual simulation uses one fixed set of 16 bases, and redrawing them from different problems moved one checkpoint's AUROC by at most 0.01.

EigenScore needs five non-empty generations per problem on LCB and the language sets, and ten on BCB. This leaves out 40 problems for Qwen3-Coder-30B, none of them solved, and 143 for gpt-oss-20b, 47 of them solved.

The study covers two open-weight models, so results for other models may differ. The competitive-programming tasks come from LiveCodeBench, and the Python, C++ and Java subset isolates the language. The practical Python tasks come from BigCodeBench, and no repository-level tasks were tested. The causal advantage holds for one of the two models, so the authors can't claim it generalizes to both.

No verdict predictor transferred reliably between benchmarks, which limits the verdict-target conclusions to language shift.

Paper info

Authors
Viola Campos, Thomas Klassert, Adrian Ulges
Venue
arXiv · Preprint
First published
2026-11-5
Added
2026-11-6
Updated
2026-11-5
Version
v1
arXiv
2611.07876
Category
cs.SE · cs.LG
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

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.

Quote from the paper

Viola Campos, Thomas Klassert, Adrian Ulges (2026). Which Signals of Code Correctness Survive Distribution Shift? Hidden-State and Causal Predictors of Program and Verdict Correctness. arXiv:2611.07876v1. https://arxiv.org/abs/2611.07876v1

BibTeX
@misc{campos2026which,
  title = {{Which Signals of Code Correctness Survive Distribution Shift? Hidden-State and Causal Predictors of Program and Verdict Correctness}},
  author = {Viola Campos and Thomas Klassert and Adrian Ulges},
  year = {2026},
  eprint = {2611.07876},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.07876v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up