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

분포 이동에서도 살아남는 코드 정확성 신호는 무엇인가? 프로그램 및 판정 정확성에 대한 은닉 상태 및 인과적 예측 변수

Viola Campos, Thomas Klassert, Adrian Ulges · arXiv · 2026년 11월 5일

- **연구 문제** LLM이 코드의 정답 여부나 자기 판단의 신뢰도를 예측할 때, 테스트 실행 없이 얻는 신호가 벤치마크와 프로그래밍 언어가 바뀌어도 유지되는지가 핵심 문제입니다.
- **연구 방법** Huang 등의 인과 국소화를 코드에 적응하여 DAS로 판단을 결정하는 6차원 부분공간을 학습하고, 이를 counterfactual simulation 또는 value probe로 읽어 기존 confidence, probe, LAT, EigenScore와 비교합니다.
- **주요 결과** Qwen3-Coder에서는 인과 부분공간 위의 value probe가 언어 전이에서 verdict 목표의 가장 강건한 예측자로 나타났고, 이득은 학습된 부분공간에서 왔습니다. 그러나 gpt-oss나 벤치마크 전이에서는 일관되지 않았고, 프로그램 목표에서는 인과 방법의 우위가 사라졌습니다.

## 실행 없는 정확성 신호는 분포 변화에서 살아남는가

LLM이 코드를 스스로 판단할 때, 외부 피드백 없이는 그 판단을 신뢰하기 어렵고 테스트 실행이나 긴 추론으로 검증하는 비용도 큽니다. 이 논문은 테스트를 실행하지 않고 모델의 출력 확률, 샘플 간 일관성, hidden state에서 정확성을 예측하는 방법들이 벤치마크나 프로그래밍 언어가 바뀔 때에도 작동하는지를 다룹니다. 두 가지 목표를 구분합니다. 하나는 모델이 내린 verdict 자체를 신뢰할 수 있는지이고, 다른 하나는 프로그램이 실제로 맞는지입니다. 두 목표는 같은 판단 패스에서 나온 신호를 쓰지만 서로 다른 질문에 답합니다.

## 인과 국소화를 코드 판단에 적응하는 방법

Huang 등이 자연어 질의응답에 제안한 인과 국소화를 코드에 적응합니다. Distributed Alignment Search(DAS)는 판단 결과를 결정하는 k차원 부분공간 R을 학습합니다. 개입은 base 상태의 부분공간 성분을 source 상태의 성분으로 바꾸고 나머지는 유지하는 교환 개입입니다. 학습에서는 LLM을 고정한 채 판단이 맞았던 후보만 사용하며, 개입된 base가 source의 verdict를 따르도록 R을 학습합니다. 논문은 k=6으로 설정하고 층별로 학습합니다.

## 부분공간을 읽는 두 가지 점수

학습된 부분공간에서 점수를 얻는 방식은 두 가지입니다. Counterfactual simulation은 후보를 source로 삼아 고정된 B=16개 base에 교환 개입을 적용하고, 그 base들의 답변 확률 평균으로 점수를 냅니다. 프로그램 목표에서는 Yes 확률의 평균이고, verdict 목표에서는 base들이 후보의 verdict를 얼마나 따르는지의 평균입니다. 반면 value probe는 개입을 하지 않고 판단 패스에서 부분공간 투영값 R⊤h를 로지스틱 회귀로 읽습니다. 따라서 counterfactual simulation은 base마다 추가 순전파가 필요하지만 value probe는 판단 패스만으로 계산됩니다.

![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…](https://refivu.com/papers/0cbbef5d-6f26-4244-9958-7dc3b8200eac/figures/figure-7ba6c83941460a0653e11c70dd3d3572.png?thumb=512)

**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.

[원문](https://arxiv.org/abs/2611.07876v1) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.

## 비교 대상인 나머지 방법들

비교는 네 계열의 여섯 예측자로 이루어집니다. Output token probabilities(confidence)는 판단 패스의 답변 확률을 씁니다. EigenScore는 여러 생성 후보의 마지막 층 hidden state에 대한 정규화된 로그 행렬식으로 샘플 간 퍼짐을 측정하며, 논문은 이를 부호를 바꿔 정확성 지표로 사용합니다. Correctness probe는 hidden state에 대한 로지스틱 회귀이고, LAT는 정답과 오답 후보 차이 벡터의 첫 주성분을 방향으로 삼습니다. LAT는 프로그램 정확성 목표에서만 평가됩니다.

## 모델, 데이터, 분할과 학습 설정

Qwen3-Coder-30B-A3B-Instruct와 gpt-oss-20b가 후보를 생성하고 스스로 판단합니다. 각 문제에서 온도 1로 10개 후보를 샘플링합니다. 데이터는 LiveCodeBench(release\_v6)와 BigCodeBench이며, 언어 전이를 위해 LiveCodeBench 문제의 Python, C++, Java 버전을 씁니다. 분할은 문제 단위 60/20/20입니다. 로지스틱 회귀 probe는 각 클래스 512개 후보로 학습하며, 층 선택은 분포 내 교차적합으로 이뤄지고 shift 결과는 선택에 쓰지 않습니다.

## verdict 정확성 예측과 언어 전이

분포 내에서는 hidden state를 읽는 방법이 confidence보다 훨씬 높은 AUROC를 보입니다. 언어 전이에서 Qwen3-Coder의 경우 probe는 0.76에서 0.67로 떨어지지만, 인과 두 방법은 0.76에서 0.73 정도로만 떨어집니다. 여섯 언어 쌍에 평균하면 value probe는 가장 좋은 비인과 방법보다 0.042±0.021 높고 세 분할 모두에서 앞섭니다. 이 우위는 Qwen3-Coder에만 나타나며, gpt-oss에서는 모든 학습된 방법이 0.07–0.12 AUROC 떨어지고 인과 방법이 유의하게 앞서지 않습니다. 벤치마크 전이는 방향에 따라 다르며 대부분의 방법이 약해집니다.

## 학습된 부분공간이 이득의 원천인지

Value probe와 counterfactual simulation은 Qwen3-Coder에서 언어 전이 평균 차이가 0.000±0.033으로 같습니다. 두 방법 모두 confidence보다 앞섭니다. 같은 차원의 랜덤 부분공간 세 개는 전이 시 0.48–0.61로 전체 hidden state probe(0.668)보다 낮아, 이득은 단순한 저차원 크기가 아니라 학습된 방향에서 옵니다. IIA는 개입이 판단을 얼마나 통제하는지를 나타낼 뿐 판단이 맞는지 예측하는 유용성을 보장하지 않습니다. gpt-oss에서는 IIA가 0.91–0.95로 수렴한 층의 부분공간이 랜덤과 다르지 않았습니다.

![Figure 4: Value probe on the learned DAS subspace against value probes on three random 6-dimensional subspaces at the same layer, verdict target, mean over shi…](https://refivu.com/papers/0cbbef5d-6f26-4244-9958-7dc3b8200eac/figures/figure-024871261b2050ffd8c531ee6825514e.png?thumb=512)

**Fig. 4** . Value probe on the learned DAS subspace against value probes on three random 6-dimensional subspaces at the same layer, verdict target, mean over shifted languages (the band is the range over the random subspaces). Shaded: layers where DAS has converged (IIA≥0.9). On Qwen3-Coder the learned subspace is above random at every layer; on gpt-oss it is above random before convergence and near chance once DAS has converged.

[원문](https://arxiv.org/abs/2611.07876v1) · [CC BY 4.0](https://creativecommons.org/licenses/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 · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 프로그램 정확성 예측과 문제 내 순위

프로그램 정확성 목표에서 모든 방법은 분포 내에서 0.70–0.88 AUROC로 우연보다 높습니다. 언어 전이에서는 인과 방법이 비인과 방법에 대한 우위를 잃습니다. Qwen3-Coder의 value probe는 가장 좋은 비인과 방법보다 0.010 AUROC 뒤지며 유의하지 않습니다. 반면 프로그램 목표는 LCB와 BCB 사이에서 양방향으로 전이됩니다. 다만 pooled AUROC는 문제 난이도 순위와 후보 순위를 섞으므로, 같은 문제 안의 후보 쌍만 쓴 within-problem AUROC는 언어 전이 시 대부분 0.58–0.64로 낮습니다.

## 샘플 간 일관성은 문제 수준에서 도움이 되는가

EigenScore는 같은 샘플 수 조건에서 단일 패스 방법과 비교됩니다. Qwen3-Coder의 LCB에서 EigenScore는 AUROC 0.504로 우연 수준이며, 언어 전이에서는 0.528입니다. 같은 조건의 단일 패스 방법들은 0.77–0.91로 유의하게 앞섭니다. BCB에서는 EigenScore가 비슷하거나(0.658), gpt-oss에서는 벤치마크별로 역전됩니다. 따라서 샘플 일관성이 일관된 이점을 주지는 않습니다. 이 비교는 문제를 적어도 절반이 통과했는지로 정의한 문제 수준 예측이며, EigenScore를 계산할 수 있는 문제만 포함합니다.

## 결과의 적용 범위와 한계

결과는 두 개의 오픈웨이트 모델, LiveCodeBench와 BigCodeBench, Python·C++·Java 설정에 한정됩니다. 저장소 수준 과제는 평가하지 않았습니다. gpt-oss의 판단은 reasoning 없이 한 토큰으로 얻었으며, medium 수준 reasoning을 쓴 498개 program-target 후보 부분 실험에서는 balanced accuracy가 62.4%에서 67.8%로 올라갔습니다. 이는 여전히 학습된 내부 방법보다 낮습니다. 또한 counterfactual simulation의 base 집합을 바꾸면 한 체크포인트의 AUROC가 최대 0.01 변했고, 같은 설정을 다른 기계에서 다시 실행하면 최대 0.02 차이가 났습니다.

## 논문 정보

- **저자**: Viola Campos, Thomas Klassert, Adrian Ulges
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2026년 11월 5일
- **등록일**: 2026년 11월 6일
- **수정일**: 2026년 11월 5일
- **버전**: v1
- **arXiv**: 2611.07876
- **분류**: cs.SE · cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2611.07876v1) · [원문 PDF ↗](https://arxiv.org/pdf/2611.07876v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

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.

## 원문 인용

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}
}
```

## 이 논문의 용어

- [AUROC](https://refivu.com/terms/096f06e69425-auroc)
- [balanced accuracy](https://refivu.com/terms/bc9870524813-balanced-accuracy)
- [LiveCodeBench](https://refivu.com/terms/a42eecb00259-livecodebench)
- [gpt-oss-20b](https://refivu.com/terms/7c2c46471ee9-gpt-oss-20b)
- [BigCodeBench](https://refivu.com/terms/94d9c99677f6-bigcodebench)
- [Distributed Alignment Search](https://refivu.com/terms/e87ba500a7d6-distributed-alignment-search)
- [counterfactual simulation](https://refivu.com/terms/ec3ead350a0b-counterfactual-simulation)
- [interchange intervention accuracy](https://refivu.com/terms/8ae04504ab44-interchange-intervention-accuracy)
- [EigenScore](https://refivu.com/terms/388f265445ae-eigenscore)
- [interchange intervention](https://refivu.com/terms/190f3725abe0-interchange-intervention)
- [Linear Artificial Tomography](https://refivu.com/terms/0c9d7c217765-linear-artificial-tomography)
- [Pooled AUROC](https://refivu.com/terms/75da2b2ae56e-pooled-auroc)

## 다른 논문 해설

- [Same Answer, Different Future: Matched Predictions Do Not Imply Matched Belief Updating in Language Models](https://refivu.com/papers/1c4e0b5a-5dfa-492f-8851-faab3ac5be5e-same-answer-different-future-matched-predictions-do-not.md)
- [When, Where, How: Active In-Context Learning for Tabular Foundation Models](https://refivu.com/papers/99fdd3a7-e7be-4373-8676-17d03cbe3ed5-when-where-how-active-in-context-learning-for.md)
- [Do Recommenders Need to Think in Words? Latent Reasoning for Efficient LLM-Based Recommendation](https://refivu.com/papers/3093e855-ef02-47fd-8189-1dbbe9cce18e-do-recommenders-need-to-think-in-words-latent.md)
- [How Far Can Lightweight LLMs Go in Intent-to-SLO Translation?](https://refivu.com/papers/ca5909b6-36ad-4e52-8ffb-c9da84098ad9-how-far-can-lightweight-llms-go-in-intent.md)
- [Evaluating Token Probabilities as Confidence Estimators in Human Behavior Simulations: A Case Study in Luxembourgish Next Like Prediction](https://refivu.com/papers/721697d6-a796-4857-b5eb-1a474366cd5c-evaluating-token-probabilities-as-confidence-estimators-in.md)
- [Different Corpora, Different Skills? A Paired Study of Small Language Models](https://refivu.com/papers/92415e72-d2fa-4387-aaaf-fa025de3e11c-different-corpora-different-skills-a-paired-study-of.md)
- [The Blindfolded Controller: Decision Model-Guided Training for Reinforcement Learning](https://refivu.com/papers/8b0c1912-26f5-471f-b40d-89a647fb35f7-the-blindfolded-controller-decision-model-guided-training.md)
- [MUSS: A Multi-scale and Sequence-based Model for Single-cell Gene Regulation](https://refivu.com/papers/0901b972-c0e8-47ef-82a0-78af4cea5cd9-muss-a-multi-scale-and-sequence-based-model.md)
- [Should We Pay This Much for Robustness? Efficient Proxy Certificates with Marginal Guarantees](https://refivu.com/papers/c7418da2-ead3-4426-8309-52573d3c8d63-should-we-pay-this-much-for-robustness-efficient.md)
- [Identifying Neural Dynamics Using Nonlinear Interventional State Space Models](https://refivu.com/papers/6d8b1ab9-5598-4aa3-a01e-80f79a7452f0-identifying-neural-dynamics-using-nonlinear-interventional.md)
- [XDecideBench: Evaluating Typed Decision Models and Confidence Policies Across Languages](https://refivu.com/papers/049194cb-43e0-4de8-8af2-c4f41dd6c424-xdecidebench-evaluating-typed-decision-models-and-confidence.md)
- [TactileLab: Sim-to-Real Dexterous Robot Manipulation with Efficient Shear-Sensitive Tactile Simulation](https://refivu.com/papers/8a52874c-bf9c-4d89-8662-3048f0ff3e34-tactilelab-sim-to-real-dexterous-robot-manipulation-with.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/0cbbef5d-6f26-4244-9958-7dc3b8200eac-which-signals-of-code-correctness-survive-distribution-shift)
