Language models that write code seem to carry an internal "this code is correct" signal. Researchers find it by feeding the model matched pairs of correct and buggy solutions and subtracting the average internal activations of the two groups. The result is a single direction in the model's hidden state that separates the two groups and can be added back during generation to push the model toward correct code. The strongest such result comes from benchmarks the model has very likely seen during training. That raises a question nobody has tested: does this direction measure whether code works, or whether code looks familiar? If it measures familiarity, it will fail exactly where we most need a correctness signal. That place is the refinement loop on new problems, where a model edits its code over several rounds and something has to decide whether each edit is an improvement. Today that decision is usually handed to another language model acting as a judge, and such judges are known to reward surface cues over substance.
We propose to test the correctness direction against a contamination split and to build a version that is controlled for familiarity. We then use it as the accept, revert, or stop signal inside a code refinement loop, and compare it directly with an LLM judge making the same decisions. The claim is falsifiable in both directions. If the published direction loses most of its predictive power on problems released after the model's training cutoff, the field's "correctness axis" is partly a memorization axis. If a familiarity-controlled direction keeps its power there, and is unmoved by cues that sway LLM judges, it becomes a cheap, white-box alternative to judge-in-the-loop refinement.
Core Claim
Interpreting Code Correctness in Language Models through Activation Steering extracted a one-dimensional correctness direction from Qwen2.5-Coder on MBPP+. A linear probe decodes correctness at up to 93.4% AUROC, and adding the direction raises pass@1 by 15.6% (1.5B) and 11.0% (7B). This paper supplies our method, but it evaluated only on a static public benchmark. Two contamination papers give us reason to doubt the interpretation. Reasoning or Memorization? Unreliable Results of Reinforcement Learning Due to Data Contamination showed that Qwen2.5-Math-7B reaches about 40% on MATH-500 from only the first 40% of each problem statement, while Llama3.1-8B scores near zero. Generalization or Memorization estimated a roughly 41.5% leak ratio for HumanEval. A third paper makes the worry mechanistic. The Reasoning-Memorization Interplay in Language Models Is Mediated by a Single Direction found a single linear direction that toggles between recall and reasoning, and it placed coding tasks midway along that direction. On a contaminated benchmark, "correct" and "memorized" overlap heavily. A difference of means between correct and buggy samples therefore cannot tell them apart, because nothing in the contrast holds familiarity fixed.
Our central claim has three parts. First, the published direction's ability to predict correctness is inflated on familiar problems. Second, a direction extracted from pairs matched for familiarity predicts hidden-test correctness on post-cutoff problems better than both the published direction and the model's own likelihood. Third, used as the decision rule in iterative repair, the matched direction reduces regressions and wasted rounds compared with an LLM judge, and it is less sensitive to the provenance and style cues documented by The Silent Judge.
The judge-bias thread matters here for a specific reason. Code judges plausibly carry a familiarity bias of their own: they prefer canonical-looking, textbook-shaped solutions. That is the same confound the activation direction may have, so we measure it in both.
Research Program
The work has three stages that share one set of models and problems.
Stage 1: build a familiarity-labeled problem pool. For each model we score every problem's familiarity in three independent ways. The first is release date relative to training cutoff, using LiveCodeBench's date tags (LiveCodeBench). The second is the partial-prompt completion audit from the RLVR contamination paper: truncate the problem to 40% and check whether the model still solves it. The third is output-distribution peakedness in the style of CDD from Generalization or Memorization, where near-zero edit distance across repeated samples signals recall.
The temporal split must actually straddle the cutoff, and the file lets us guarantee that for one model family. DeepSeek-Coder has a documented performance cliff on LiveCodeBench problems released after August 2023, which falls inside the benchmark's May 2023 to August 2024 window. It is therefore our primary model for the temporal split. Qwen2.5-Coder is kept because it is the model the prior steering paper used. Its cutoff may postdate much of the file's LiveCodeBench window, so for Qwen we rely on the truncation and peakedness scores rather than on dates. For both models we add rephrased HumanEval_R items, which bypass exact-match leakage filters.
Stage 2: re-examine and rebuild the direction. We first reproduce the MBPP+ difference-of-means direction on Qwen2.5-Coder-7B, sweeping layers 17–21 as the original paper did. We then measure how well it separates each model's own correct and incorrect samples, reported as AUROC and computed within each familiarity bin.
Next we build a matched direction. Positive and negative sets are the model's own passing and failing samples, drawn only from problems in the low-familiarity bin. Within each pair, the two samples also match on length and token-level log-likelihood. As a further step, we project out a memorization direction, obtained by contrasting activations on problems that are recoverable from a truncated prompt against problems that are not. This mirrors the recall-versus-reasoning construction of the reasoning-memorization paper.
We also keep the symmetry check from the code-correctness paper. That paper found that steering fails when the direction that fixes broken code is not the reverse of the direction that breaks correct code. We report whether the matched direction passes this check.
Stage 3: put the direction inside a refinement loop. The loop is the standard one: generate, run visible tests, feed back the traceback, revise, for up to K rounds. That is the loop in which LiveCodeBench reports GPT-4-Turbo rising from 24.5% to 36.9% with execution feedback, and in which Yan et al. report that gains plateau after a few rounds.
Each round the loop must make a decision under uncertainty: whether to keep the new edit, revert to an earlier version, or stop. The decision is uncertain because visible tests are weak and the hidden tests are what count. We treat the direction's projection, read at the final token of the candidate program, as the decision signal. This is a revert rule of the kind Fang et al. implement with state tracking, except the trigger is internal rather than conversational.
As a secondary arm, we also add the direction during regeneration. Readout and steering are separable, and we report them separately. The code-correctness paper shows that being able to read a signal does not guarantee being able to steer with it.
Baselines
The do-nothing reference is plain execution-feedback repair. It accepts every edit that passes at least as many visible tests as its predecessor and stops at K rounds or when all visible tests pass. It uses the same models, prompts, and budget of K rounds. Any proposed signal must beat it on final hidden-test pass@1 at matched rounds. Otherwise the internal signal adds nothing beyond the tests we already have.
The likelihood baseline replaces the direction with the model's mean token log-probability of the candidate program. This is the strongest simple competitor, for two reasons. It needs no labeled pairs, and it is the quantity most likely to be secretly driving a familiarity-confounded direction. The comparison is fair because both signals are scalars read from the same forward pass, and each gets a threshold tuned on the same held-out split.
The LLM-judge baseline asks a judge whether the new candidate is better than the previous one, given the problem, both programs, and the test logs. We run it in two versions: the coding model judging itself, and a larger open-weight judge. The judge gets a tuned prompt that includes explicit instructions to ignore authorship and style, and it receives the same held-out tuning budget as the direction.
The strongest existing refinement system is Adversarial Review from Adversarial Review: Cooperative Code Review through Structured Disagreement, in which a critic audits the reviewer before the coder edits. It reports an 87% pass rate on LiveCodeBench against 77% zero-shot and 82% for a five-agent debate, plus 75.2% on SWE-bench Verified, at about 4.5 times the tokens of zero-shot. Those numbers come from much stronger proprietary-scale models. We therefore re-run the protocol with our open models as all three agents, and we report pass rate against tokens. Matching its pass rate at a fraction of its token cost counts as a win, and so does exceeding it at equal cost. Merely approaching it at lower cost is reported as a tradeoff, not a win.
For the readout question itself, no reported result was found on Lacuna for correctness-probe AUROC on post-cutoff LiveCodeBench problems. The only anchor is the 93.4% MBPP+ AUROC, and we treat it as the number whose portability is in question.
The ablations isolate the key ingredient, familiarity matching. We compare the published MBPP+ direction, a direction built from the same number of pairs drawn from high-familiarity problems, the matched direction without the memorization projection removed, and the full matched direction.
Why not just…?
Why not just use the model's likelihood as the correctness score? This is the most serious threat. On clean problems, likelihood may carry most of what any linear correctness signal carries. We make it a covariate in every analysis. The claim survives only if the matched direction improves AUROC for hidden-test correctness over likelihood on the post-cutoff bin, and only if that improvement persists after partialling likelihood out of the projection. If it does not, we will report that the correctness axis is largely a fluency or familiarity axis. The loop contribution would then reduce to a likelihood-based revert rule, which is still a finding, but a different paper.
Why not just prompt the judge to ignore surface cues? The Silent Judge found that labeling an answer as recent shifted GPT-4o's verdicts by 30% on ELI5, and that judges acknowledged the cue in their written justifications 0% of the time. When the influence of a cue never appears in the explanation, an instruction to ignore it has nothing visible to act on. We test this directly in code rather than assuming it. We inject provenance comments into candidate programs, such as "reviewed by senior engineer," along with stylistic polish that leaves behavior unchanged. We then measure the verdict shift rate for the debias-prompted judge and the corresponding shift in the direction's projection.
Why not just run more tests or sample more candidates? More tests help whenever someone can write them. This proposal targets the gap between what visible tests catch and what hidden tests catch, and that gap exists precisely because tests are expensive to write. Sampling many candidates and filtering, including TED-style removal of memorized outputs from Generalization or Memorization, multiplies generation cost. It also cannot steer a revision already in progress. We include best-of-N at a token budget matched to the loop, so the reader can see where sampling wins.
Why not just use Adversarial Review? It works, and it applies to black-box models, which our method does not. Our argument is limited to efficiency and bias exposure. Its critic is itself an LLM judge, subject to the same cues, and its reported costs are 4.5 times the tokens plus documented over-editing. The regression-rate metric below measures over-editing directly for both systems.
Proposed Experiments
Models are DeepSeek-Coder-6.7B, which has the documented August 2023 cliff and is our primary model for the temporal split, and Qwen2.5-Coder-7B, which gives comparability with prior work and is the heavily contaminated case. We add Llama-3.1-8B as a low-contamination contrast, following the asymmetry reported in the RLVR contamination paper. Problems come from MBPP+, HumanEval and HumanEval_R, and LiveCodeBench split by release date. We add DyVal-generated algorithm tasks (DyVal), such as reachability and maximum-sum path rendered as code tasks, as a procedurally fresh control that no model can have memorized.
Readout metrics. We report AUROC for hidden-test pass, within each familiarity bin. We then report the drop in AUROC from the high-familiarity bin to the low-familiarity bin, and the partial correlation of the projection with correctness after controlling for likelihood and for the truncation-completion score.
Loop metrics. We report final hidden-test pass@1 after K rounds, and the regression rate, defined as the fraction of rounds that break a previously passing hidden test. We also report the mean number of rounds to stop, and tokens per solved problem.
Bias metrics. We report the verdict shift rate under provenance-cue and style-polish injection, measured for each judge and for the direction.
The decisive check is a single comparison. The published direction and likelihood should both lose substantial AUROC from high-familiarity to low-familiarity problems. The matched direction should lose clearly less, and it should still beat likelihood on the low-familiarity bin. If the published direction holds up on post-cutoff problems, the contamination concern is dismissed, and that is worth knowing given how widely such directions are now reused. If every signal collapses equally, internal correctness readouts are not ready for use in refinement loops.
The second check concerns loop outcomes on post-cutoff LiveCodeBench. There, the matched-direction revert rule must beat both plain repair and the self-judge on hidden-test pass@1 at equal rounds, with a lower regression rate.
The third check is the cue-injection experiment. It should show a nonzero verdict shift for the prompted judge and a near-zero shift in the direction's projection. We will also report the opposite outcome: if the direction shifts as well, that would mean the direction has inherited the judge's shortcut.
References
- Interpreting Code Correctness in Language Models through Activation Steering
- Reasoning or Memorization? Unreliable Results of Reinforcement Learning Due to Data Contamination
- Generalization or Memorization: Data Contamination and Trustworthy Evaluation for Large Language Models
- The Reasoning-Memorization Interplay in Language Models Is Mediated by a Single Direction
- The Silent Judge: Unacknowledged Shortcut Bias in LLM-as-a-Judge
- LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code
- CodeTransOcean: A Comprehensive Multilingual Benchmark for Code Translation
- MEIC: Re-thinking RTL Debug Automation using LLMs
- Adversarial Review: Structured Disagreement for Grounded Agentic Code Review
- DyVal: Dynamic Evaluation of Large Language Models for Reasoning Tasks