Research log Small Model Experimentation
GitHub

Qwen Search-Augmented Rollout Distillation

Perfect one-step fixes still won't teach planning

The one idea you need

Picture a repair apprentice fixing a program one instruction at a time: it edits, runs the code, reads the result, edits again. Handed the correct single fix at every dead-end, it learns only local corrections, never a whole plan that reaches working code.

The question

If you show a code-editing model the verified correct fix for every mistake it makes, will it learn to reliably solve whole tasks?

What we found

No. An automatic search found a verified correct fix for 98% of the dead-ends the model wandered into, yet retraining on those single fixes matched or trailed the simpler training on four of five test sets. The model could pick the right next edit 60% of the time but solved at most 37.5% of whole tasks. Local fixes never became a winning plan.

Why it matters

If you build a step-by-step editing agent, don't expect verified next-step fixes to teach it. The hard part is planning a full sequence that ends in a passing result: reward whole runs, not isolated single edits.

Verified fixes found for nearly every dead-end98%of stuck states got a correct repair label, so labels were never the bottleneck
Picking the next edit versus solving the whole task60% → 37.5%right-next-edit rate versus best whole-task solve rate, the planning gap it could not close
What a perfect edit sequence reaches on these tasks69% to 100%solve rate of an all-knowing teacher, proving the tasks are solvable with the right sequence
Edit-and-run beat one-shot answering on reworded tasks25% → 37.5%plain model versus the step-by-step editor, the one real win the fix-retraining then eroded
On this page
  1. Results at a glance
  2. Overview
  3. Report
    1. Verdict
    2. What Was Tested
    3. Main Accuracy
    4. K Curves
    5. Training Diagnostics
    6. Repair Diagnostics
    7. Pilot Result
    8. Interpretation
    9. Next Experiment
  4. Experiment log
  5. Figures
  6. Data files
  7. Reproduce
  8. Related

Results at a glance 3

Whole-task solve rate by test set, four solver versions

How to read

Each cluster is one test set. Bars compare the plain model answering directly, the editor trained the normal way, the editor retrained on found fixes, and a perfect edit-sequence teacher. Taller means more tasks solved, so higher is better.

0%25%50%75%100%Val mixedVal mixedFresh standardFresh standardFresh paraphraseFresh paraphraseFresh pairedFresh pairedHard compositionHard composition

Takeaway → The fix-retrained bars sit at or below the normally-trained bars on most test sets, while the perfect-teacher bars tower far above every trained version.

Data table
Evaluation splitnative Qwenbehavior-cloned (active)search-distilled (active)oracle teacher
Val mixed43.8%6.2%12.5%100%
Fresh standard50%12.5%12.5%87.5%
Fresh paraphrase25%37.5%31.2%93.8%
Fresh paired25%18.8%18.8%100%
Hard composition50%37.5%18.8%68.8%

Numbers from experiments/qwen_search_augmented_rollout_distillation/analysis/main_summary.csv

Technical framing

Active VM-controller accuracy by split: search distillation did not beat behavior cloning — Search distillation helped only val mixed (6.2% to 12.5%); the oracle gap (69-100%) shows large headroom the recipe failed to capture.

Does allowing more edits raise the solve rate?

How to read

The horizontal axis is how many edits the model is allowed; the vertical axis is the share of tasks solved. Each line is one test set, and a higher line means more solved.

0%20%40%60%0510

Takeaway → Only one test set climbs as more edits are allowed; the rest stay flat or drop, so extra editing does not reliably help.

Data table
Edit budget Kval mixedfresh standardfresh paraphrasefresh pairedhard composition
012.5%0%0%37.5%12.5%
412.5%6.2%12.5%18.8%0%
812.5%0%12.5%18.8%6.2%
1212.5%6.2%25%18.8%6.2%

Numbers from experiments/qwen_search_augmented_rollout_distillation/runs/main_search_r1_rank00_e2_20260624/results.json (metrics, mode=learned, phase=search_r1_policy)

Technical framing

Accuracy vs edit budget K for the search-distilled policy (greedy learned mode) — No clean monotonic K-scaling: more VM edits help only fresh paraphrase, while other splits stay flat or degrade from the K=0 blank baseline.

Per-step correctness across the training stages

How to read

Bars are grouped by training stage, from basic training epochs to fix-retraining epochs. Colors show three kinds of per-step correctness: picking the edit type, its details, and when to stop. Taller means more steps right.

0%25%50%75%100%BC epoch 1BC epoch 137.3%21.5%87.8%BC epoch 2BC epoch 260%44.1%80.5%Search epoch 1Search epoch 138.2%42.6%73.4%Search epoch 2Search epoch 250.4%59.5%79.7%

Takeaway → Picking the right edit peaked during basic training and fell after fix-retraining, and stronger per-step scores never produced better whole solutions.

Data table
Training phase / epochaction accuracyargument accuracySTOP accuracy
BC epoch 137.3%21.5%87.8%
BC epoch 260%44.1%80.5%
Search epoch 138.2%42.6%73.4%
Search epoch 250.4%59.5%79.7%

Numbers from report table (reports/search_augmented_rollout_distillation_report.md, Training Diagnostics)

Technical framing

Local training accuracy by phase and epoch: search labels lowered action accuracy — Retraining on search-repaired labels dropped action accuracy from 60.0% to 50.4%, and local gains never translated into better active rollouts.

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

The experiment gives a clear negative result for this specific recipe. The bottleneck is not simply obtaining verified repair labels: the main run found verified completions for 98.1% of policy-visited states. The problem is turning those labels into a policy that chooses useful global trajectories at inference time. The strongest evidence is the gap between local and global metrics. Behavior cloning reached 60.0% action accuracy, and the oracle teacher reached 68.8% to 100.0% by split, but the best active deployable VM score was only 37.5%. Search-distillation increased neither the best active score nor the K-scaling pattern.

Overview

This standalone experiment trains Qwen/Qwen3-4B as a recurrent controller for a typed bytecode VM.

The model receives a task prompt plus dense projected VM-state tokens. It predicts one VM edit action or STOP, the VM executes the edited program, and the same model is called again for the next recurrent step.

The central intervention is search-augmented rollout distillation: policy-visited states are labeled by bounded answer-verified repair search, not only by a gold-program edit trace. The model also receives pairwise action-ranking supervision from repair-positive and repair-negative edits.

Large checkpoints are stored outside this directory:

large_artifacts/qwen_search_augmented_rollout_distillation/checkpoints/

Read experiment_log.md for the iteration record. Final reports are written under reports/.

Main outputs:

Report

Rendered from reports/search_augmented_rollout_distillation_report.md

Verdict

Search-augmented rollout distillation did not improve the main active VM controller. The behavior-cloned VM controller already produced the best active score on three of five splits, tied search on one, and search improved only val mixed from 6.2% to 12.5%, still far below native Qwen. The oracle teacher remained much higher at 68.8% to 100.0%, so the task and VM action space still have large headroom.

The main positive result is narrow: the behavior-cloned VM controller beat native Qwen on fresh paraphrase tasks when using active K>0 edits (37.5% vs 25.0%). The search-distilled controller did not preserve that gain and did not close the oracle gap.

What Was Tested

This experiment trains Qwen/Qwen3-4B as a recurrent controller for a typed bytecode VM. Each recurrent step is one Qwen forward pass over the task prompt plus dense VM-state tokens. The model predicts one structured edit action or STOP; the VM executes the current program; then the updated VM state is fed back into the model for the next step.

The intervention is search-augmented rollout distillation. After behavior cloning on gold traces, the learned policy is rolled out on training tasks. For each policy-visited state, bounded repair search finds a verified completion when possible. The model is then trained on the first action of that repaired trajectory.

Main Accuracy

These are active K>0 VM-editing scores except for the explicit blank column. This avoids counting passive K=0 blank-program hits as real recurrent computation.

SplitNative QwenBlank K=0BC VM activeSearch VM activeOracle teacher
Val mixed43.8%12.5%6.2%12.5%100.0%
Fresh standard50.0%0.0%12.5%12.5%87.5%
Fresh paraphrase25.0%0.0%37.5%31.2%93.8%
Fresh paired25.0%37.5%18.8%18.8%100.0%
Hard composition50.0%12.5%37.5%18.8%68.8%

Main active accuracy

K Curves

The greedy learned policy shows no clean monotonic K-scaling. Some splits improve with more edits, but others stay flat or degrade. The oracle curve confirms that high accuracy is reachable in the same VM environment when the trajectory is chosen correctly.

K curves

Training Diagnostics

PhaseEpochAction accArg accSTOP accPair-rank accStates
bc_policy137.3%21.5%87.8%0.0%901
bc_policy260.0%44.1%80.5%0.0%901
search_r1_policy138.2%42.6%73.4%55.2%1703
search_r1_policy250.4%59.5%79.7%62.1%1703

Training metrics

Behavior cloning reached 60.0% local action accuracy, but active solve accuracy remained much lower. Search-distillation collected many verified repair labels, but training on those labels reduced local action accuracy to 50.4% and did not improve the active controller.

Repair Diagnostics

Search-state collection found verified completions for 787 of 802 policy-visited states (98.1%). It also saw 41 false-stop states and 43.8% rollout success before retraining.

Repair diagnostics

Pilot Result

The first pilot used pairwise positive-vs-negative ranking with weight 0.5. It did not improve rollout accuracy and made the second on-policy collection worse. The selected main recipe disabled the ranking loss and trained two epochs on search-labeled states.

Pilot comparison

Interpretation

The experiment gives a clear negative result for this specific recipe. The bottleneck is not simply obtaining verified repair labels: the main run found verified completions for 98.1% of policy-visited states. The problem is turning those labels into a policy that chooses useful global trajectories at inference time.

The strongest evidence is the gap between local and global metrics. Behavior cloning reached 60.0% action accuracy, and the oracle teacher reached 68.8% to 100.0% by split, but the best active deployable VM score was only 37.5%. Search-distillation increased neither the best active score nor the K-scaling pattern.

Next Experiment

The next high-impact experiment should stop treating repaired trajectories as ordinary one-step imitation labels. The more direct attack is rollout-level optimization: sample complete VM rollouts, score them with exact VM reward and false-stop penalties, then train preference or policy-gradient updates over full trajectories. The assets from this experiment are enough to do that: a recurrent dense-state controller, a value/distance head, exact executable rewards, and a repair procedure that can produce successful contrastive rollouts.

Experiment log 1

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

2026-06-24

  • Created a fresh standalone experiment directory.
  • Selected intervention: search-augmented rollout distillation for a dense-state recurrent VM agent.
  • Core idea: after behavior cloning on oracle traces, roll out the learned policy, run bounded answer-verified repair search from policy-visited states, and train on the first repair edit plus pairwise positive-vs-negative action ranking.
  • Main failure targeted: local edit competence without reliable global trajectory selection.
  • Large artifacts will be stored under large_artifacts/qwen_search_augmented_rollout_distillation/checkpoints/.
  • Implemented the standalone harness:

    • behavior cloning from gold VM traces,
    • on-policy state collection,
    • bounded answer-verified repair search from each visited state,
    • first-repair-action supervision,
    • same-state positive-vs-negative action ranking,
    • greedy, value-gated, forced-step, and value-beam evaluation modes.
  • Static syntax check passed for the training script and shared VM core.
  • Smoke run smoke_search_rollout_distill_20260624 completed end to end. It exposed a weak search-label source: shallow two-edit repair found verified completions for only 1 of 12 policy-visited states.
  • Added bounded target-guided completion: candidate first actions are evaluated by whether they can still reach a verified answer within the shortest remaining edit budget.
  • Smoke run smoke_search_rollout_distill_guided_20260624 completed end to end. Search found verified completions for 11 of 11 policy-visited states, so the pilot will use guided repair with repair_max_edits=12.
  • Pilot pilot_search_r2_rank05_20260624 was stopped after the second-round state collection because the first search-distilled policy did not improve rollout accuracy and the second-round collection regressed.

    • BC K=8 best deployable accuracy: val mixed 25.0%, fresh standard 8.3%,

    fresh paraphrase 8.3%, paired 0.0%, hard 8.3%.

    • Search-r1 K=8 best deployable accuracy: val mixed 16.7%, fresh standard

    8.3%, fresh paraphrase 8.3%, paired 0.0%, hard 8.3%.

    • Search-r1 state collection found verified completions for 492/502 states,

    but one epoch of rank-weight 0.5 training only reached 53.6% pairwise rank accuracy and reduced action accuracy.

    • Search-r2 collection had 46 false-stop states and lower rollout success,

    so the run was intentionally interrupted.

  • Added --eval_modes so subsequent pilots can skip expensive value-beam sweeps during iteration.
  • Pilot pilot_search_r1_rank00_e2_20260624 completed with pairwise ranking disabled and two search-distillation epochs.

    • Search-r1 K=8 improved best deployable accuracy over BC on fresh paired

    (0.0% to 16.7%), fresh paraphrase (8.3% to 16.7%), and fresh standard (8.3% to 16.7%).

    • Hard composition stayed flat at 8.3% and val mixed stayed flat at 16.7%.
    • Search-r1 action accuracy recovered to 39.6%, better than the rank-0.5

    pilot but still below BC action accuracy.

  • Main recipe selected: rank loss disabled, one search-augmented on-policy round, two search epochs, no value-beam in the broad evaluation sweep.
  • Main run main_search_r1_rank00_e2_20260624 completed.

    • Native Qwen accuracy: val mixed 43.8%, fresh standard 50.0%, fresh

    paraphrase 25.0%, fresh paired 25.0%, hard composition 50.0%.

    • BC VM active K>0 best: val mixed 6.2%, fresh standard 12.5%, fresh

    paraphrase 37.5%, fresh paired 18.8%, hard composition 37.5%.

    • Search VM active K>0 best: val mixed 12.5%, fresh standard 12.5%, fresh

    paraphrase 31.2%, fresh paired 18.8%, hard composition 18.8%.

    • Oracle teacher best: val mixed 100.0%, fresh standard 87.5%, fresh

    paraphrase 93.8%, fresh paired 100.0%, hard composition 68.8%.

    • Search-state repair found verified completions for 787/802 states, but

    search retraining reduced local action accuracy from 60.0% to 50.4% and did not improve the active VM controller.

  • Generated charts under analysis/ and standalone reports under reports/.

Figures 5

main active accuracy
main active accuracy · analysis/
main k curves learned
main k curves learned · analysis/
main repair diagnostics
main repair diagnostics · analysis/
main training metrics
main training metrics · analysis/
pilot comparison
pilot comparison · analysis/

Data files 12

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 ↗