Source-linked AI summary

Hints Help But Do They Teach? Evaluating Skills Transfer in Code Generation

Will Badr

arXiv:2609.01106v1cs.SEcs.AIcs.CL

TL;DR

The paper asks whether hint-rescued code generation reflects newly supplied information or solutions already reachable by the model. It combines executable behavioral tests with activation interventions, context compression, and cross-benchmark hidden-state probes, finding that most hint rescues are also reachable through sampling while tested interventions do not establish task-general transfer.

  • Problem

    The paper examines whether a hint that converts a failing program into a passing one supplies missing information or redirects generation toward an already reachable solution.

  • Method

    The study compares relevant and unrelated hints with no-hint sampling, then tests activation interventions, virtual-KV context compression, and source-to-target hidden-state correctness probes on executable benchmarks.

  • Results

    Most relevant-hint rescues also occur among eight unhinted samples, while learned intervention effects are imprecise and probe readouts transfer across benchmarks without a resolved top-one advantage over token confidence.

  • Takeaways & Limitations

    Relevant hints can rescue failures, but the observed rescues mainly indicate accessibility under sampling rather than established task-general capability transfer.

  • Takeaways & Limitations

    The tested intervention, compression, and readout conclusions are method-specific, and the hint comparisons do not isolate semantic content because attempt budgets and stopping rules differ.

Abstract

from arXiv · show

When a hint turns a failing generated program into a passing one, does it provide missing information or merely steer the model toward a solution it could already produce? We test these hypotheses on HumanEval+ and MBPP+ using executable evaluation. For Qwen2.5-3B-Instruct, adaptive relevant hints rescue 36 of 79 selected failures; an unrelated hint rescues 19, while eight unhinted samples solve 46 and recover 31 of the 36 relevant-hint rescues. Phi-3.5-mini shows the same pattern: relevant hints rescue 42 of 101 failures, an unrelated hint rescues 17, and unhinted sampling solves 57, including 36 of the 42 relevant-hint rescues. Because the hint conditions use different attempt budgets, these comparisons do not isolate a purely semantic effect. Mechanistic tests on Qwen identify a stable activation direction shared by relevant and unrelated hints. Persistently adding this direction yields 14 rescues and 18 regressions, with no detectable net accuracy gain; learned low-rank interventions have a positive but imprecise estimated effect. Full textual specifications solve 22 of 24 context-defined problems, versus 5-11 for tested virtual-KV prefixes. Post-generation hidden-state probes transfer across benchmarks, with pooled AUROC 0.806 and 0.780, but their top-one selection advantage over token confidence is statistically unresolved. Overall, relevant hints can rescue failures, but most rescued solutions are already reachable through ordinary sampling, and the internal interventions tested here do not establish task-general capability transfer.

1. Introduction

The paper asks whether hint-induced code-generation rescues reflect missing information, redirection toward already reachable solutions, or implementation variation. It evaluates these explanations behaviorally and mechanistically, finding that relevant hints can rescue failures but do not establish general capability transfer.

  • A pass/fail change after hinting cannot distinguish supplied information from redirected generation or implementation-level variation.
  • HumanEval/117 shows that both a relevant hint and an unrelated hint can turn the same failing program into a passing one, while unhinted sampling also succeeds.
  • The study compares adaptive hints, unrelated prompts, no-hint sampling, activation directions, low-rank spaces, and virtual-KV prefixes using executable evaluation.
  • Most relevant-hint rescues also occur under unhinted sampling, while relevant and unrelated hints induce nearly the same activation direction.
  • The tested interventions do not establish task-general capability transfer, although full context enables synthetic procedures and the tested KV-prefix objective lacks consistent held-out transfer.
  • Cross-benchmark probes predict functional correctness, but unresolved top-one superiority over token confidence supports decodability rather than model self-knowledge.

3. Related Work

The paper situates its audit among work on activation steering, prompt and prefix compression, self-consistency, and hidden-state correctness probing. Its experiments use executable code benchmarks, controlled interventions, and source-to-target evaluation to separate behavioral change from transferable task capability.

  • Activation-direction studies motivate searching for compact representations of helpful hints, while this work evaluates long-form program correctness through execution.
  • The paper adds split-half stability, matched controls, positive-control interventions, held-out transfer, and full-population effects to address interpretive limits of causal patches.
  • Prior work establishes the value of sampling multiple trajectories, motivating comparisons between hint rescues and ordinary no-hint sampling.
  • Prefix and function-vector research does not support a blanket claim that prefixes cannot represent new behavior, so the paper tests a narrower virtual-KV training recipe.
  • Cross-dataset probe failures motivate source-benchmark training with target-benchmark evaluation for correctness readouts.
  • Behavioral analyses use Qwen and Phi, while mechanistic, compression, and correctness-readout analyses use Qwen only.

5. Most Hint Rescues Reappear Within Eight Unhinted Samples

Hint rescues frequently reappear among eight unhinted samples, indicating accessibility under a modest sampling budget rather than uniquely semantic hint effects. The interpretation is further constrained by unmatched attempt budgets and replay variability.

  • 36 Qwen failures are rescued by relevant hints and 19 by unrelated hints, but the conditions use unmatched attempt budgets and stopping rules.
  • 46 of 79 Qwen tasks and 57 of 101 Phi tasks are solved by eight no-hint samples, including 31 of 36 and 36 of 42 relevant-hint rescues.
  • 77 of 164 HumanEval+ tasks are mixed across eight samples, making one-shot before/after comparisons fragile near the competence boundary.
  • Replay flips 5 baseline failures and 4 baseline passes without changing prompt content, and the mechanistic rescued population has a separate replay reference.
  • Figure 1 emphasizes task overlap among conditions rather than treating their rates as independent because attempt budgets are not matched.

6. Mechanistic Results: Stability Is Not Specificity

The mean hint-response direction is highly reproducible but largely shared by relevant and unrelated hints. Persistent deployment changes both failures and passes without detecting net improvement, while held-out low-rank transfer remains imprecise and task-specific transfer is not detected.

  • Stability: Cosine 0.992–0.996 split-half stability shows that the mean hint-delta direction is highly reproducible across layers.It accounts for 35–63% of individual hint-delta energy under the tested protocol.
  • Specificity: Around 0.98 cosine similarity between relevant and unrelated directions in early and middle layers indicates that stability is not specific to useful hint content.A late-layer relevance contrast appeared on a selected subset but failed to survive robustness checks.
  • Persistent injection: 14 failures were rescued and 18 baseline passes were damaged under full-benchmark persistent injection, with no detected net accuracy change.The paired transition imbalance was not statistically resolved: exact McNemar p=0.597.
  • Control validation: Oracle-delta patching yielded 6 of 36 passes (16.7%), equal to separate replay, so the tested anchor was not validated as a positive-control channel.Equality of observed counts was not evidence of equivalence.
  • Held-out transfer: +8.3 percentage points for learned minus replay was estimated, but its 95% bootstrap CI [-2.8, 19.4] was wide and did not demonstrate a clear held-out advantage.Other comparisons were similarly imprecise, including +8.9 points versus matched random and +11.1 versus shuffled interventions.
  • Held-out transfer: 64% training delta-energy capture fell to approximately 9% on held-out tasks, while residual analyses detected no improvement over controls.Under the tested ranks, layers, strengths, channel, and cross-validation protocol, no task-specific transfer effect was detected.

7. Cross-Benchmark Correctness Readout

Post-generation hidden states support cross-benchmark correctness readout, but their advantage for choosing the single best candidate remains unresolved. The probe is a transferable readout rather than evidence of privileged self-knowledge or causal use during generation.

  • Cross-benchmark readout: Pooled AUROC was 0.806 on HumanEval+ and 0.780 on MBPP+ for hidden-state correctness probes.Within-task AUROC was lower but remained above chance: 0.654 and 0.634, respectively.
  • Baselines: Hidden probes outperformed mean log-probability and tested surface baselines in pooled AUROC, although textual controls retained substantial correctness information.The surface baselines did not exhaust possible textual confounds.
  • Candidate selection: Top-one selection improved over confidence by nine HumanEval+ tasks and four MBPP+ tasks, but paired tests were not statistically decisive.Exact McNemar p-values were 0.093 and 0.503, respectively.
  • Scope: The probe requires eight generations, white-box hidden states, and execution labels during training, so it provides transferable readout rather than privileged self-knowledge.Inference avoids test execution but still depends on the generated candidate set and hidden-state access.

8. Compressing Context-Defined Procedures

Full textual context strongly improves execution on context-defined procedures, whereas the tested virtual-KV prefixes fit exemplars without consistent held-out transfer. The result is method-specific and does not establish a general limit on context compression or representation classes.

  • Context-defined procedures: 22 of 24 held-out problems were solved with the full specification and three worked exemplars.No-context and unrelated-procedure contexts solved at most 1 of 6 held-out problems per family despite 13 attempts per problem.
  • Virtual-KV compression: Trained virtual-KV prefixes solved only 5–11 of 24 held-out problems despite reaching exemplar loss at or below 0.05.Their held-out performance overlapped untrained, random, and shuffled controls.
  • Virtual-KV compression: In the selected ordered-rewriting follow-up, five perturbed-initialization seeds each solved the same 3 of 6 problems, compared with 2 of 6 for size-matched controls.The effective held-out unit was six problems, not five seeds, making the one-problem difference insufficient evidence of procedure transfer.
  • Limitations: The tested exemplar-cross-entropy virtual-KV scheme did not reproduce full context on these families, but this does not isolate a representation-class limit from a training-recipe limit.Other objectives, interfaces, lengths, and pretrained adapters may behave differently.

10. Discussion

The discussion narrows capability-transfer claims: relevant hints can rescue failures, but many rescues are reachable through ordinary sampling, and tested interventions do not establish task-specific transfer. Cross-benchmark correctness probes are promising, yet their selection advantage remains unresolved.

  • Most relevant-hint rescues also occur among eight unhinted samples, while unrelated hints rescue many failures.
  • Stable activation directions shared by relevant and irrelevant prompts changed outputs without supporting the label “task-specific capability vector.”
  • The tested intervention results are method-specific: single-position patching and learned subspaces showed no detected held-out advantage, while persistent injection changed outcomes.
  • Post-generation readouts transfer across benchmark directions, but their top-one gain over confidence is statistically unresolved and they select only successes already present among candidates.
  • The paper extends control questions to executable long-form code generation without invalidating positive findings from other task families.

11. Limitations

The evidence is constrained by model, benchmark, experimental-design, intervention, synthetic-procedure, and probe limitations. These boundaries limit claims about generality, causal effects, contamination resistance, and practical deployment.

  • Intervention, prefix, and probe results cover only Qwen2.5-3B-Instruct, so the study does not establish scale or broad architecture generality.
  • HumanEval+ and MBPP+ improve outcome validity with augmented tests, but possible benchmark exposure limits external validity.
  • Relevant hints receive up to three rescue opportunities, unrelated hints one, and no-hint pass@8 uses a different decoding rule.
  • Nominal replay can change outcomes, complicating small causal effects, especially after selecting rescued tasks.
  • Exploratory searches create multiple comparisons, while the causal subset contains only 36 tasks and lacks a prespecified smallest effect of interest.
  • Null intervention results apply only to tested positions, strengths, channels, and constructions, not other components or learned interfaces.
  • The synthetic-procedure experiment lacks randomized secrets and rule permutations, and its virtual-KV objective has no demonstrated method-positive control.
  • Probe utility may reflect surface artifacts and requires white-box access, eight generations, and execution-labeled training data.

12. Conclusion

Across two small models, relevant hints help under the implemented conditions, but ordinary sampling covers most successful rescues. Mechanistic interventions do not establish task-general transfer, whereas hidden-state readouts show cross-benchmark signal with preliminary selection utility.

  • Across two small models, no-hint sampling covers most successful relevant-hint rescues.
  • A stable hint direction changes outputs without detected net accuracy gain, while learned activation subspaces have positive but imprecise held-out estimates.
  • Capability-transfer claims should report replay, matched placebos, no-hint sampling boundaries, held-out comparisons, and damage alongside rescue.

Data and Artifact Availability

The released artifact supports reproducing reported analyses from ledgers and cached features, while full intervention reconstruction requires archived tensors and checkpoints.

  • The compact reproducibility artifact includes experimental source, configurations, ledgers, sampled programs, execution labels, cached probe representations, replication results, reanalysis, and figures.
  • Released ledgers and cached features reproduce reported tables, intervals, paired tests, and figures without model inference.
  • Approximately 5.9 GB of omitted activation tensors and checkpoints are required to rerun intervention construction, but not the released analyses.

Appendix A. Evidence and Reproduction Map

The appendix maps claims to archived outputs, registries, and procedures, while documenting the context-defined families and a reproducibility boundary in the CRW follow-up.

  • Evidence map: The Qwen evidence map links behavioral, geometric, intervention, selection, and context-compression claims to archived result files.The listed artifacts cover hint rescues, no-hint sampling, activation analyses, causal deployment, candidate selection, and context-defined procedures.
  • Reproduction map: The main registry records timestamped experimental stages with git commits, while Phi uses a separate registry and source configuration.The corrected analysis uses seed 20260828 for bootstrap resampling.
  • Context-defined procedures: The context-defined evaluation covers balanced-ternary notation, an eight-operation stack language, ordered string rewriting, and a keyed codec.Table B1 reports any-of-eight held-out success, with cells expressed as counts out of six.
  • Reproducibility boundary: The CRW k=2 follow-up repeatedly solves the same three of six cases, so it demonstrates problem-level overlap rather than five independent replications.Size-matched controls solve two cases.

Appendix C. Design Boundaries at a Glance

The appendix separates behavioral comparisons from stronger semantic or causal interpretations by identifying mismatched decoding budgets, accessibility overlap, and nondeterministic execution paths.

  • Behavioral comparisons: The relevant-hint versus no-hint comparison does not isolate a semantic increment because the implemented procedures differ.The contrast uses adaptive one-to-three attempts versus one greedy attempt, while another comparison contrasts a greedy hint ladder with eight stochastic draws.
  • Interpretation limits: Overlap with unhinted accessibility does not establish mechanistic equivalence between generic steering and replay.The evidence supports an empirical overlap claim rather than a mechanistic identity claim.
  • Reproducibility: Benchmark tasks use the same reported decoding settings, but batch and kernel paths are not deterministic.This constrains exact reproducibility even when nominal settings match.
  • Causal interpretation: Causal intervention outcomes extend beyond an empirical replay reference, so associated transitions should not be treated as fully identified mechanisms.The boundary concerns interpretation of outcome transitions rather than their mere observation.
  • Control design: The appendix distinguishes learned subspace evaluation from replay, shuffled, and random controls, alongside held-out-task and hidden-readout analyses.These design axes include rescued tasks held out by fold, hidden readout versus confidence, and eight candidates for the same target task.
Loading 2609.01106v1…