Research log Small Model Experimentation
GitHub

Qwen Hidden VM On-Policy Canonical Repair

Folding verified fixes into training changes nothing

The one idea you need

Instead of blurting an answer, the model secretly writes a step-by-step recipe that a fixed calculator runs to reach the result. A checker can spot a corrected recipe sitting right next to the model's. The test: does feeding those corrections back as training make the model write better recipes on its own?

The question

When a checker can automatically repair a model's hidden step-by-step reasoning, does training the model on those repairs make it produce correct steps by itself?

What we found

No. Training the model on automatically corrected recipes reached 61% on new tasks, versus 59% for plain training — a 2-point gap that is basically noise, and it left longer tasks no better. The corrections are genuinely valuable live: a checker searching nearby recipes hits 89%. But that help evaporates the moment you try to bake it into the model itself.

Why it matters

If a checker can fix your model's outputs, use it live at answer time to pick or correct them. Feeding those fixes back into training recovered nothing here and slightly hurt accuracy on longer inputs.

Answering directly vs writing hidden steps9% → 61%accuracy on new tasks, before any repair training
Plain training vs training on the fixes59% → 61%the 2-point gain is noise, not a real change
How high a live checker can reach89%searching nearby recipes at answer time; a ceiling, not a shippable path
Fixes found on the hardest reworded tasks1 in 4just 26%, down from 95% on the easiest tasks
On this page
  1. Results at a glance
  2. Overview
  3. Report
    1. Abstract
    2. Setup
    3. Results
    4. Interpretation
    5. Decision
    6. Limitations
    7. Artifacts
  4. Experiment log
  5. Figures
  6. Data files
  7. Reproduce
  8. Related

Results at a glance 8

Direct answer vs hidden recipe vs best-case checker fixing

How to read

Accuracy on a fresh mixed-task set, taller is better. Four bars: answering directly, the hidden-recipe model trained plainly, the same model after training on the checker's fixes, and the best case if a checker patches each recipe.

0%25%50%75%100%direct logitsdirect logits8.6%hidden VM (trace-only control)hidden VM (trace-only control)59%hidden VM (on-policy repair)hidden VM (on-policy repair)60.9%state-verified repair (headroom)state-verified repair (headroom)89.1%

Takeaway → Both hidden-recipe bars tower over direct answering yet sit nearly level with each other, so training on fixes barely moved anything; only live checker patching reaches much higher.

Data table
conditionaccuracy
direct logits8.6%
hidden VM (trace-only control)59%
hidden VM (on-policy repair)60.9%
state-verified repair (headroom)89.1%

Numbers from analysis/all_final_metrics.csv (final, fresh_paired_mixed)

Technical framing

Fresh paired mixed accuracy: direct answer vs hidden VM vs repair headroom — Compiling to a hidden VM lifts accuracy from 8.6% to ~61%, but on-policy repair training adds only +2.0pp over the trace-only control.

Accuracy as tasks grow longer than anything trained on

How to read

Accuracy (higher is better) moving left to right toward longer tasks; training covered only the shorter lengths. Three lines: the model trained on fixes, the plainly-trained model, and the best case if a checker patches each recipe.

20%40%60%80%100%120%678910repair headroom (on-policy run)repair headroom (…trace-only control (hidden VM)trace-only contro…on-policy repair (hidden VM)on-policy repair …

Takeaway → Past the trained length the fix-trained line sits at or below the plainly-trained line, so training on fixes buys no extra robustness on longer tasks.

Data table
program length (trained up to 6)on-policy repair (hidden VM)trace-only control (hidden VM)repair headroom (on-policy run)
672.9%68.2%96.4%
853.1%54.2%85.4%
1031.8%35.9%65.6%

Numbers from analysis/all_final_metrics.csv (final; fresh/hard/harder standard_mixed splits)

Technical framing

Length generalization: on-policy repair does not improve hard-length robustness — Beyond the trained length 6, the on-policy repair arm falls at or below the trace-only control, while verified local search keeps large headroom.

Four training approaches land on the same score

How to read

Four training approaches, taller is better. Each has two bars: the model's own recipe-writing accuracy on fresh tasks, and the best case if a checker patches the recipe. Compare heights across approaches.

0%25%50%75%100%gold-only controlgold-only control60.9%89.1%repair-onlyrepair-only60.9%89.1%repair-or-goldrepair-or-gold60.9%89.1%trace-only controltrace-only control59%89.5%

Takeaway → Every approach produces essentially identical heights, so training on the checker's fixes buys nothing over plain training.

Data table
training armhidden VMrepair headroom
gold-only control60.9%89.1%
repair-only60.9%89.1%
repair-or-gold60.9%89.1%
trace-only control59%89.5%

Numbers from analysis/all_final_metrics.csv (final, fresh_paired_mixed)

Technical framing

Main training arms are indistinguishable on fresh paired accuracy — All repair-target arms land on the same result as gold-only training, so distilling verified repairs adds nothing over the controls.

Accuracy by task type on fresh tasks

How to read

Six task types along the bottom, taller is better. Three bars each: answering directly, running the hidden recipe, and the best case if a checker patches the recipe.

0%25%50%75%100%arithmeticcalendarunitlistbooleanlookup

Takeaway → The hidden recipe beats direct answering in every task type, and the checker's best case recovers most of what the recipe still missed.

Data table
domaindirect logitshidden VMrepair headroom
arithmetic0%40.9%79.5%
calendar4.5%45.5%86.4%
unit0%61.9%85.7%
list2.4%81%100%
boolean45.2%85.7%95.2%
lookup0%52.4%88.1%

Numbers from analysis/final_metrics.csv (main_repair_or_gold_s512, fresh_paired_mixed row)

Technical framing

Per-domain accuracy on fresh paired tasks — The hidden VM beats direct answering in every domain, and verified local repair finds a correct program for most remaining failures.

Reworded questions hurt more as tasks get longer

How to read

Three length tiers left to right, taller is better. Bars pair plain wording against reworded wording, shown both for the raw hidden recipe and after a checker patches it.

0%25%50%75%100%Fresh lengthFresh lengthHard lengthHard lengthHarder lengthHarder length

Takeaway → The gap between plain and reworded bars widens sharply at longer lengths, and patching cannot close it, so rewording bites hardest on the hard tasks.

Data table
Task length tierHidden VM, standard wordingHidden VM, paraphrasedAfter repair, standard wordingAfter repair, paraphrased
Fresh length72.9%62%96.4%91.7%
Hard length53.1%27.6%85.4%64.1%
Harder length31.8%16.7%65.6%33.9%

Numbers from report table (reports/qwen_hidden_vm_onpolicy_canonical_repair_paper.md, final splits)

Technical framing

Paraphrase wording hurts more as tasks get longer — Paraphrasing costs ~11 points at fresh lengths but ~26-32 points at hard/harder lengths, and repair cannot close the gap.

Training heavily on fixes trades first-try quality for salvage

How to read

Four small-scale training recipes along the bottom, taller is better. Three bars each: the model's own recipe accuracy, the best case after a checker patches it, and how often the recipe was written exactly right.

0%25%50%75%100%Head-onlyHead-only63.5%91.7%46.9%Head-only, cap 24Head-only, cap 2460.4%86.5%42.7%Repair-targetRepair-target50%96.9%37.5%Stable mixStable mix47.9%91.7%34.4%

Takeaway → Recipes leaning hardest on fixes raise the patched best case but drop the model's own accuracy from about 64% to 50%, trading first-try quality for salvage.

Data table
Pilot training recipe (192 tasks)Hidden VMAfter repairProgram exact match
Head-only63.5%91.7%46.9%
Head-only, cap 2460.4%86.5%42.7%
Repair-target50%96.9%37.5%
Stable mix47.9%91.7%34.4%

Numbers from report table (reports/qwen_hidden_vm_onpolicy_canonical_repair_paper.md, run summary)

Technical framing

Pilot ablations: repair-heavy training trades compiler quality for repair rate — Training on repair targets lifts repaired accuracy to 96.9% but drops one-shot compiler accuracy from 63.5% to 50.0%.

The checker itself collapses on hard reworded tasks

How to read

Seven task groups left to right, getting harder and more reworded, taller is better. One bar is how often the checker found any fix; the other is how often that fix was exactly right.

0%25%50%75%100%Fresh standardFresh standard94.8%87.5%Fresh paraphraseFresh paraphrase90.1%80.7%Fresh pairedFresh paired88.3%73.4%Hard standardHard standard83.9%64.1%Hard paraphraseHard paraphrase61.5%39.6%Harder standardHarder standard60.4%39.6%Harder paraphraseHarder paraphrase26%10.9%

Takeaway → Both bars fall off a cliff on the hardest reworded group — fixes found drop from 95% to 1 in 4 — so the checker's help vanishes exactly where the model needs it.

Data table
Evaluation splitRepair candidate foundRepaired program exact
Fresh standard94.8%87.5%
Fresh paraphrase90.1%80.7%
Fresh paired88.3%73.4%
Hard standard83.9%64.1%
Hard paraphrase61.5%39.6%
Harder standard60.4%39.6%
Harder paraphrase26%10.9%

Numbers from report table (reports/qwen_hidden_vm_onpolicy_canonical_repair_paper.md, final splits)

Technical framing

The repair search itself collapses on harder paraphrased tasks — Verified repair finds a fix for 94.8% of fresh tasks but only 26.0% of harder paraphrased ones, so headroom vanishes exactly where needed.

What training adds over the untrained model

How to read

Two bars, before and after training, taller is better. Three measures each: running the hidden recipe, the best case after a checker patches it, and how often the recipe was written exactly right.

0%25%50%75%100%Base model (step 0)Base model (step 0)20.8%27.8%0%After training (step 701)After training (step 701)58.3%95.1%41.7%

Takeaway → The untrained model never writes a perfect recipe; training lifts the checker-patched best case from 28% to 95% on new validation tasks.

Data table
CheckpointHidden VM executionAfter verified repairProgram exact match
Base model (step 0)20.8%27.8%0%
After training (step 701)58.3%95.1%41.7%

Numbers from runs/main_repair_or_gold_s512/train_log.csv

Technical framing

What training buys over the base model on held-out validation — The base model never emits an exactly-correct program; training lifts repaired accuracy from 28% to 95% on validation.

In the author’s words from the Report · “Abstract”

This experiment tests whether a Qwen 4B model can improve a hidden virtual-machine compiler by training on canonical on-policy repair targets. The model emits invisible typed VM slots, a deterministic runtime executes those slots, and local candidate repairs are accepted only when their full intermediate state trajectory matches the canonical trajectory.

Overview

Standalone experiment for training Qwen/Qwen3-4B to compile mixed natural-language tasks into a hidden typed VM, then improve the compiler with canonical on-policy repair targets.

Small files live here:

experiments/qwen_hidden_vm_onpolicy_canonical_repair/

Large checkpoints live separately here:

large_artifacts/qwen_hidden_vm_onpolicy_canonical_repair/checkpoints/

The main question is whether verified state-equivalent local repairs can be folded back into a Qwen-attached hidden VM compiler without damaging the trace-trained policy.

Report

Rendered from reports/qwen_hidden_vm_onpolicy_canonical_repair_paper.md

Abstract

This experiment tests whether a Qwen 4B model can improve a hidden virtual-machine compiler by training on canonical on-policy repair targets. The model emits invisible typed VM slots, a deterministic runtime executes those slots, and local candidate repairs are accepted only when their full intermediate state trajectory matches the canonical trajectory.

Setup

  • Primary run: main_repair_or_gold_s512
  • Model: Qwen/Qwen3-4B
  • Variant: trace
  • Train examples: 512
  • Train steps: 700
  • On-policy rounds: 1
  • Epochs per round: 1
  • Target mode: repair_or_gold
  • Repair verifier mode: state
  • VM max steps: 10
  • Curriculum schedule: 4:240,6:700
  • Train length range: 1 to 6
  • Eval length: 6; hard length: 8; harder length: 10

The hidden VM uses typed operation slots and copied numeric arguments. Direct logits are the model's next-token numeric answer distribution at the answer marker. Hidden VM accuracy is execution of the compiled invisible program. Repair accuracy is target-aware state-verified local search around the compiled program and is reported as a headroom measurement, not as a deployable inference path.

Results

Final Splits

SplitDirectHidden VMRepairProgram exactRepair exactState prefixRepair found
val_mixed13.9%58.3%95.1%41.7%83.3%70.8%93.1%
fresh_standard_mixed7.3%72.9%96.4%56.8%87.5%76.3%94.8%
fresh_paraphrase_mixed12.5%62.0%91.7%46.9%80.7%74.5%90.1%
fresh_paired_mixed8.6%60.9%89.1%44.5%73.4%72.8%88.3%
hard_standard_mixed9.9%53.1%85.4%32.3%64.1%67.5%83.9%
hard_paraphrase_mixed12.0%27.6%64.1%8.3%39.6%60.5%61.5%
harder_standard_mixed9.4%31.8%65.6%11.5%39.6%60.7%60.4%
harder_paraphrase_mixed10.4%16.7%33.9%2.1%10.9%49.9%26.0%
domain_arithmetic3.1%34.4%90.6%34.4%90.6%62.5%90.6%
domain_calendar12.5%46.9%100.0%37.5%75.0%72.4%100.0%
domain_unit0.0%37.5%84.4%37.5%84.4%66.7%84.4%
domain_list0.0%81.2%93.8%46.9%53.1%82.8%90.6%
domain_boolean46.9%93.8%100.0%53.1%93.8%72.9%96.9%
domain_lookup0.0%71.9%93.8%43.8%62.5%71.4%90.6%

Split accuracy

Domain Breakdown

DomainnDirectHidden VMRepair
arithmetic44.000.0%40.9%79.5%
calendar44.004.5%45.5%86.4%
unit42.000.0%61.9%85.7%
list42.002.4%81.0%100.0%
boolean42.0045.2%85.7%95.2%
lookup42.000.0%52.4%88.1%

Domain accuracy

Training Dynamics

Fresh paired hidden VM accuracy moved from 23.4% at initialization to 60.9% after the full treatment. State-verified local repair on the same split reaches 89.1%. The trace-only control scores 59.0% on fresh paired, 54.2% on hard length 8, and 35.9% on harder length 10.

Training curve

On-Policy Target Quality

The final target pass used 512.00 source examples. Active rows were 100.0%; canonical repairs were found for 99.6%; changed-program repairs were 17.4%; program-exact repaired targets were 96.5%; average local candidates were 152.59.

Target quality

Run Summary

RunVariantDirectHidden VMRepairProgram exactState prefix
main_gold_control_s512trace8.6%60.9%89.1%44.5%72.8%
main_repair_only_s512trace8.6%60.9%89.1%44.5%72.8%
main_repair_or_gold_s512trace8.6%60.9%89.1%44.5%72.8%
main_trace_control_s512trace8.6%59.0%89.5%44.1%71.0%
pilot_onpolicy_canonical_headonly_cap24_s192trace8.3%60.4%86.5%42.7%71.0%
pilot_onpolicy_canonical_headonly_s192trace8.3%63.5%91.7%46.9%72.0%
pilot_onpolicy_canonical_repair_s192trace8.3%50.0%96.9%37.5%69.3%
pilot_onpolicy_canonical_stable_s192trace8.3%47.9%91.7%34.4%68.8%

Run summary

Interpretation

The primary measurement is fresh paired mixed-domain accuracy. Direct logits score 8.6%, while the on-policy canonical-repair hidden VM scores 60.9% (+52.3 pp). The trace-only control scores 59.0%, so the on-policy treatment changes fresh paired accuracy by +2.0 pp. State-verified local repair scores 89.1%, measuring how often the current top-k neighborhood contains a canonical executable program.

Program-exact accuracy is 44.5% and state-prefix accuracy is 72.8%. The gold-only control scores 60.9% on fresh paired and the repair-only control scores 60.9%; the repair arms therefore do not separate from an extra stabilized gold-trace pass.

The hard-length splits are the decisive stress test. The treatment trains up to length 6 and reaches 53.1% at length 8 and 31.8% at length 10. The trace-only control reaches 54.2% and 35.9% on those same standard hard splits, so the on-policy epoch does not improve length robustness.

Decision

Canonical on-policy repair should not be scaled in this form. The state verifier produces high-quality targets, but distilling those targets into the compiler gives the same fresh paired result as gold-only training and weakens hard-length robustness relative to the trace-only control. The useful outcome is the headroom measurement: state-verified local search still reaches 89.1% on fresh paired and 85.4% on hard length 8. The next step should keep repair as selection or reranking, or train only on uncertainty-targeted repairs with a much stricter preservation objective.

Limitations

  • The domains are synthetic and deterministic.
  • Answers are integers in a bounded value vocabulary.
  • Trace supervision supplies exact hidden programs during the curriculum phase.
  • Repair accuracy is target-aware and should be read as verifier-assisted headroom.
  • Canonical state verification uses synthetic trajectories available in this harness.
  • The runtime is fixed and hand-designed.
  • Each main arm is one run unless additional seeds are added.

Artifacts

Small experiment files live in:

experiments/qwen_hidden_vm_onpolicy_canonical_repair/

Large artifacts live in:

large_artifacts/qwen_hidden_vm_onpolicy_canonical_repair/checkpoints/

Primary files:

Experiment log 1

Show the running log (1 entry, 2026-06-23)

2026-06-23

Created a standalone hidden VM on-policy canonical repair experiment.

Design:

  • Use Qwen/Qwen3-4B with QLoRA and a hidden typed VM compiler.
  • Train on mixed task families: arithmetic chains, calendar shifts, unit transforms, list aggregation, boolean thresholding, and lookup/adjust rules.
  • Use a length curriculum before repair training.
  • Evaluate standard, paraphrase, paired, hard length, harder length, and per-domain splits.
  • Generate local repair candidates from the current compiler policy.
  • Accept a repair target only when the candidate's full intermediate state trajectory matches the canonical trajectory, not merely when the final answer matches.
  • Train directly on target slot values while retaining gold trace, gold selection, executor, and state losses as stabilizers.
  • Keep large model artifacts under large_artifacts/.

Initial planned runs:

  • smoke_onpolicy_canonical_repair: tiny end-to-end check.
  • pilot_onpolicy_canonical_repair_s192: small run to verify target quality and stability.
  • main_trace_control_s512: curriculum-only control.
  • main_gold_control_s512: curriculum plus one extra gold-only on-policy-format epoch.
  • main_repair_only_s512: curriculum plus canonical repair-only targets.
  • main_repair_or_gold_s512: curriculum plus canonical repair targets with gold fallback.

Smoke run:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name smoke_onpolicy_canonical_repair --variant trace \
  --train_examples 12 --val_examples 6 --eval_examples 6 --eval_pairs 4 --domain_eval_examples 2 \
  --train_steps 2 --onpolicy_rounds 1 --epochs_per_round 1 --train_batch_size 1 --eval_batch_size 2 \
  --max_steps 4 --train_max_len 3 --eval_length 3 --hard_length 4 --harder_length 0 --max_length 384 \
  --curriculum_schedule 2:1,3:2 --onpolicy_source_examples 12 --repair_train_topk 2 --repair_eval_topk 2 --repair_max_edits 1 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --log_every 1 --eval_every 2 --seed 121 --eval_seed 121001

Smoke result:

  • Completed successfully in 29.2 seconds.
  • The on-policy target pass produced active rows for 100.0% of the 12 source examples.
  • Canonical state-verified repairs were found for 41.7% of source examples.
  • Changed-program repairs were 33.3%; program-exact repaired targets were 25.0%.
  • Final smoke fresh paired hidden-VM accuracy was 25.0%; this is only a wiring check.
  • Analyzer generated markdown, HTML, CSV summaries, and charts.

Pilot 1:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name pilot_onpolicy_canonical_repair_s192 --variant trace \
  --train_examples 192 --val_examples 72 --eval_examples 72 --eval_pairs 48 --domain_eval_examples 16 \
  --train_steps 260 --onpolicy_rounds 1 --epochs_per_round 1 --train_batch_size 2 --eval_batch_size 4 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:120,6:260 --onpolicy_source_examples 192 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --gold_trace_loss_weight 0.25 --gold_selection_loss_weight 0.25 \
  --log_every 40 --eval_every 260 --seed 122 --eval_seed 122001

Pilot 1 result:

  • Completed in 367.6 seconds.
  • Curriculum transition before on-policy training was strong: fresh paired 74.0%, hard length-8 standard 63.9%, harder length-10 standard 43.1%.
  • State-verified local repair at transition was high: fresh paired 99.0%, hard length-8 standard 95.8%, harder length-10 standard 72.2%.
  • Canonical on-policy targets were dense: active rows 100.0%, found 100.0%, changed 17.7%, program-exact 98.4%.
  • After one full on-policy epoch, fresh paired fell to 50.0%, hard length-8 standard to 29.2%, and harder length-10 standard to 23.6%.
  • Interpretation: target availability is not the problem; the repair phase is too destabilizing at the initial learning rate and regularization strength.

Pilot 2 change:

  • Add --onpolicy_lr_multiplier.
  • Keep the same curriculum prefix seed, but run the on-policy epoch at a lower effective LR.
  • Increase gold trace and gold selection regularization during on-policy training.

Pilot 2:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name pilot_onpolicy_canonical_stable_s192 --variant trace \
  --train_examples 192 --val_examples 72 --eval_examples 72 --eval_pairs 48 --domain_eval_examples 16 \
  --train_steps 260 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 \
  --train_batch_size 2 --eval_batch_size 4 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:120,6:260 --onpolicy_source_examples 192 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 40 --eval_every 260 --seed 122 --eval_seed 122001

Pilot 2 result:

  • Completed in 361.3 seconds.
  • The curriculum prefix matched Pilot 1 on the important splits: fresh paired 74.0%, hard length-8 standard 63.9%, harder length-10 standard 43.1%.
  • Target quality also matched: active 100.0%, found 100.0%, changed 17.7%, program-exact 98.4%.
  • After the gentler on-policy epoch, fresh paired still fell to 47.9%, hard length-8 standard to 34.7%, and harder length-10 standard to 16.7%.
  • Interpretation: lower LR and stronger gold regularization are not enough. The likely failure is representation drift or over-updating during the repair phase.

Pilot 3 change:

  • Freeze Qwen/LoRA during on-policy training and update only the compiler head.
  • Reset the optimizer before on-policy training.
  • Keep the same curriculum prefix seed for direct comparison.

Pilot 3:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name pilot_onpolicy_canonical_headonly_s192 --variant trace \
  --train_examples 192 --val_examples 72 --eval_examples 72 --eval_pairs 48 --domain_eval_examples 16 \
  --train_steps 260 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 --no-onpolicy_train_lora \
  --train_batch_size 2 --eval_batch_size 4 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:120,6:260 --onpolicy_source_examples 192 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 40 --eval_every 260 --seed 122 --eval_seed 122001

Pilot 3 result:

  • Completed in 362.9 seconds.
  • Same curriculum transition as Pilot 1 and 2: fresh paired 74.0%, hard length-8 standard 63.9%, harder length-10 standard 43.1%.
  • Same target quality: active 100.0%, found 100.0%, changed 17.7%, program-exact 98.4%.
  • After head-only on-policy training, fresh paired fell to 63.5%, hard length-8 standard to 48.6%, and harder length-10 standard to 36.1%.
  • Interpretation: freezing Qwen/LoRA helps, but a full on-policy pass is still too large. The repair phase should be a limited nudge, not a full epoch.

Pilot 4 change:

  • Add --onpolicy_max_batches.
  • Keep head-only on-policy training, but cap the repair phase to 24 batches.

Pilot 4:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name pilot_onpolicy_canonical_headonly_cap24_s192 --variant trace \
  --train_examples 192 --val_examples 72 --eval_examples 72 --eval_pairs 48 --domain_eval_examples 16 \
  --train_steps 260 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 --no-onpolicy_train_lora --onpolicy_max_batches 24 \
  --train_batch_size 2 --eval_batch_size 4 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:120,6:260 --onpolicy_source_examples 192 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 40 --eval_every 260 --seed 122 --eval_seed 122001

Pilot 4 result:

  • Completed in 325.7 seconds.
  • Same curriculum transition: fresh paired 74.0%, hard length-8 standard 63.9%, harder length-10 standard 43.1%.
  • Same target quality: active 100.0%, found 100.0%, changed 17.7%, program-exact 98.4%.
  • After 24 head-only on-policy batches, fresh paired fell to 60.4%, hard length-8 standard to 47.2%, and harder length-10 standard to 31.9%.
  • Interpretation: limiting repair batches did not solve the problem. The main runs should treat canonical on-policy repair as a hypothesis under test, not as an assumed improvement.

Main run plan:

  • Use matched seed 124 and eval seed 124001.
  • Run a trace-only control.
  • Run a gold-only head-only on-policy control.
  • Run a repair-only head-only on-policy arm.
  • Run a repair-or-gold head-only on-policy arm.
  • Select the deployable result by fresh paired and hard-length accuracy, not by repair headroom alone.

Main trace control:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name main_trace_control_s512 --variant trace \
  --train_examples 512 --val_examples 144 --eval_examples 192 --eval_pairs 128 --domain_eval_examples 32 \
  --train_steps 700 --onpolicy_rounds 0 --train_batch_size 2 --eval_batch_size 8 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:240,6:700 --onpolicy_source_examples 512 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --log_every 70 --eval_every 700 --seed 124 --eval_seed 124001

Main trace result:

  • Completed in 619.6 seconds.
  • Fresh paired hidden-VM accuracy: 59.0%; state-verified repair headroom: 89.5%.
  • Hard length-8 standard: 54.2%; hard length-8 paraphrase: 36.5%.
  • Harder length-10 standard: 35.9%; harder length-10 paraphrase: 20.3%.

Main gold-only control:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name main_gold_control_s512 --variant trace \
  --train_examples 512 --val_examples 144 --eval_examples 192 --eval_pairs 128 --domain_eval_examples 32 \
  --train_steps 700 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 --no-onpolicy_train_lora \
  --train_batch_size 2 --eval_batch_size 8 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:240,6:700 --onpolicy_source_examples 512 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode gold_only --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 70 --eval_every 700 --seed 124 --eval_seed 124001

Main gold-only result:

  • Completed in 821.4 seconds.
  • Target pass sanity check: active 100.0%, changed 0.0%, program-exact 100.0%.
  • Fresh paired hidden-VM accuracy: 60.9%.
  • Hard length-8 standard: 53.6%; hard length-8 paraphrase: 27.6%.
  • Harder length-10 standard: 31.8%; harder length-10 paraphrase: 16.7%.
  • Interpretation: a head-only extra gold pass gives a small fresh paired gain but weakens hard-length paraphrase and length-10 robustness.

Main repair-only:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name main_repair_only_s512 --variant trace \
  --train_examples 512 --val_examples 144 --eval_examples 192 --eval_pairs 128 --domain_eval_examples 32 \
  --train_steps 700 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 --no-onpolicy_train_lora \
  --train_batch_size 2 --eval_batch_size 8 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:240,6:700 --onpolicy_source_examples 512 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_only --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 70 --eval_every 700 --seed 124 --eval_seed 124001

Main repair-only result:

  • Completed in 834.1 seconds.
  • Target pass: active 99.6%, found 99.6%, changed 17.4%, program-exact 96.5%.
  • Fresh paired hidden-VM accuracy: 60.9%.
  • Hard length-8 standard: 53.1%; hard length-8 paraphrase: 27.6%.
  • Harder length-10 standard: 31.8%; harder length-10 paraphrase: 16.7%.
  • Interpretation: repair-only does not separate from the gold-only control.

Main repair-or-gold:

python experiments/qwen_hidden_vm_onpolicy_canonical_repair/src/qwen_hidden_vm_onpolicy_canonical_repair_experiment.py \
  --run_name main_repair_or_gold_s512 --variant trace \
  --train_examples 512 --val_examples 144 --eval_examples 192 --eval_pairs 128 --domain_eval_examples 32 \
  --train_steps 700 --onpolicy_rounds 1 --epochs_per_round 1 --onpolicy_lr_multiplier 0.2 --no-onpolicy_train_lora \
  --train_batch_size 2 --eval_batch_size 8 \
  --max_steps 10 --train_max_len 6 --eval_length 6 --hard_length 8 --harder_length 10 --max_length 768 \
  --curriculum_schedule 4:240,6:700 --onpolicy_source_examples 512 --repair_train_topk 3 --repair_eval_topk 3 --repair_max_edits 2 \
  --target_mode repair_or_gold --repair_verifier_mode state \
  --lr 5e-5 --executor_loss_weight 0.2 --state_loss_weight 0.05 \
  --repair_trace_loss_weight 0.25 --gold_trace_loss_weight 1.0 --gold_selection_loss_weight 1.0 \
  --log_every 70 --eval_every 700 --seed 124 --eval_seed 124001

Main repair-or-gold result:

  • Completed in 836.3 seconds.
  • Target pass: active 100.0%, found 99.6%, changed 17.4%, program-exact 96.5%.
  • Fresh paired hidden-VM accuracy: 60.9%; state-verified repair headroom: 89.1%.
  • Hard length-8 standard: 53.1%; hard length-8 paraphrase: 27.6%.
  • Harder length-10 standard: 31.8%; harder length-10 paraphrase: 16.7%.
  • Interpretation: canonical repair targets are high quality, but folding them back into the compiler does not outperform gold-only training and reduces hard-length robustness relative to trace-only.

Main conclusion:

Canonical on-policy repair should not be scaled in this form. The state verifier is valuable as a headroom or candidate-selection mechanism, but direct distillation into the compiler behaves like an extra gold pass and weakens the length-generalization stress tests.

Figures 5

domain accuracy
domain accuracy · analysis/figures/
run summary
run summary · analysis/figures/
split accuracy
split accuracy · analysis/figures/
target quality
target quality · analysis/figures/
training curve
training curve · analysis/figures/

Data files 20

Result tables and metrics copied from the experiment folder — preview inline or open the raw file.

Reproduce

This entry is source code or analysis only — there is no separate run to reproduce.

Browse the experiment folder on GitHub ↗