Research log Small Model Experimentation
GitHub

Qwen3.5-4B Prefix Value Guided Search

Finished2026-06-26imported · line ZStructured Execution and CompilersGitHub ↗
A graded head start solves no extra problems

The one idea you need

Instead of writing eight complete programs and hoping one passes, the model writes four half-finished openings, secretly grades each by running the hidden answer tests, then finishes only the top-graded opening. Does a well-chosen head start beat brute-force full attempts?

The question

When a small model writes code, does grading half-finished attempts and finishing only the most promising one solve more problems than just writing full solutions?

What we found

No. Even when the half-finished drafts were graded with perfect knowledge of the hidden answer tests, finishing only the best-graded one solved the same share of problems as plain full-solution writing — 75% either way. Ungraded random drafts did worse, at 58%. The lone upside: the graded winner used about a quarter of the compute, but only because a flawless grader hand-picked it.

Why it matters

Don't build machinery to score and rank half-written code by promise: the good drafts reach no solutions plain writing misses. Spend compute finishing full attempts, not grading fragments, unless you already own a flawless grader.

Problems solved75% → 75%best graded head start vs plain full writing: a tie, no gain
First-try success rate42% → 75%each single attempt looked better, yet total problems solved never moved
Compute for the graded winnerabout 1/4of what full writing burned, but only a perfect grader could pick it
Ungraded random head start58% solvedworse than plain writing's 75%
On this page
  1. Results at a glance
  2. Overview
  3. Report
    1. Question
    2. Setup
    3. Results
    4. Gate Decision
    5. Interpretation
  4. Experiment log
  5. Figures
  6. Data files
  7. Reproduce
  8. Related

Results at a glance 3

Share of problems solved by each search method

How to read

Five methods along the bottom: plain full writing and four graded-draft variants. Darker bars show the share of twelve problems solved at all; lighter bars the first-pick success rate. Taller is better.

0%20%40%60%80%full samplingfull sampling75%41.7%prefix unionprefix union75%66.7%oracle-selected prefixoracle-selected prefix75%75%lexical-selected prefixlexical-selected prefix66.7%66.7%random-selected prefixrandom-selected prefix58.3%50%

Takeaway → Every draft variant's solved share tops out level with plain writing and none rises above it, so the graded drafts add no new solutions even as first-pick success climbs.

Data table
search armcoveragepass@1 proxy
full sampling75%41.7%
prefix union75%66.7%
oracle-selected prefix75%75%
lexical-selected prefix66.7%66.7%
random-selected prefix58.3%50%

Numbers from reports/report_summary.json

Technical framing

Hidden-test coverage by search arm (matched completion budget) — Gate failed: no prefix arm beats plain full-code sampling on coverage (all top out at 75%), so a prefix value model is not justified.

Compute used by each search method

How to read

Each bar is one method; height is the total compute it burned, so shorter is cheaper. Plain full writing sits on the left, the four graded-draft variants follow.

01k2k3kfull samplingfull sampling20.91kprefix unionprefix union18.39koracle-selected prefixoracle-selected prefix5541lexical-selected prefixlexical-selected prefix5592random-selected prefixrandom-selected prefix5614

Takeaway → The best graded-draft bar is about four times shorter than plain writing, so it is cheaper, but only because the hidden answers were already known when picking that draft.

Data table
search armforward tokens
full sampling20.91k
prefix union18.39k
oracle-selected prefix5541
lexical-selected prefix5592
random-selected prefix5614

Numbers from reports/report_summary.json

Technical framing

Compute cost of each arm (forward tokens) — The oracle-selected prefix matches full-sampling coverage at ~4x fewer tokens, but finding that prefix still required the full sweep.

How varied the generated programs are

How to read

Each method has two bars: how differently the programs behave when run, and how differently they are written. Taller means more varied. Neither direction is inherently better here.

0%25%50%75%100%full samplingfull sampling26%87.5%prefix unionprefix union33.3%97.6%oracle-selected prefixoracle-selected prefix70.8%95.8%lexical-selected prefixlexical-selected prefix75%95.8%random-selected prefixrandom-selected prefix79.2%100%

Takeaway → Graded-draft methods behave far more variously, yet that extra behavioral variety never converted into more problems solved.

Data table
search armfunctional diversityprogram diversity
full sampling26%87.5%
prefix union33.3%97.6%
oracle-selected prefix70.8%95.8%
lexical-selected prefix75%95.8%
random-selected prefix79.2%100%

Numbers from reports/report_summary.json

Technical framing

Sample diversity: prefix-conditioned completions vary more — Prefix-selected arms produce far more functionally distinct programs per completion, but the extra diversity did not translate into coverage gains.

In the author’s words from the Overview · “Summary”

Can hidden-test-valued code prefixes expose a search state that is better than ordinary full-code sampling at matched completion budget?

Overview

This top-level README was generated during repository normalization because the imported experiment did not include one.

How To Read

Start with the primary report, then inspect data/, reports/, analysis/, src/, and scripts/ as available. This folder remains self-contained; do not move its run data into shared directories.

Summary

Can hidden-test-valued code prefixes expose a search state that is better than ordinary full-code sampling at matched completion budget?

Report

Rendered from reports/final_report.md

Question

Can hidden-test-valued code prefixes expose a search state that is better than ordinary full-code sampling at matched completion budget?

Setup

  • Dataset split: test.
  • Task count: 12.
  • Full-code samples per task: 8.
  • Prefix proposals per task: 4.
  • Completions per prefix: 2.
  • Matched completion budget: True.
  • Mean valid prefixes per task: 3.17.

Results

armcoveragepass@1 proxyvisible coveragefunctional diversityprogram diversityforward tokens
full_sample_base75.0%41.7%91.7%26.0%87.5%20906
prefix_lexical_selected66.7%66.7%75.0%75.0%95.8%5592
prefix_oracle_selected75.0%75.0%91.7%70.8%95.8%5541
prefix_random_selected58.3%50.0%66.7%79.2%100.0%5614
prefix_union75.0%66.7%91.7%33.3%97.6%18387

coverage

diversity

prefix validity

Gate Decision

Oracle-prefix gate: failed. Full sampling coverage was 75.0%; prefix union coverage was 75.0%; oracle-selected prefix coverage was 75.0%; lexical-selected prefix coverage was 66.7%. Do not train a prefix value model from this result.

Interpretation

This is an oracle-ceiling experiment. A positive result would mean the prefix state space contains selectable states whose completions solve tasks more efficiently than ordinary full-code sampling.

There is an efficiency hint: the oracle-selected prefix arm matches full-sampling coverage with only one selected prefix's completion set per task. But that is not enough to justify training here, because discovering that prefix still required the full prefix-completion sweep, and the prefix union did not improve coverage over ordinary full-code sampling at matched completion count. The strict gate therefore fails: this proposed prefix action space is not yet a useful enough MDP state representation for a learned value model.

Experiment log 3

Show the running log (3 entries)

Purpose

This standalone experiment tests whether partial code prefixes expose useful search states. The first gate is an oracle ceiling: if hidden-test oracle prefix selection cannot beat ordinary full-code sampling at matched completion budget, then training a prefix value model is not justified.

Protocol

  1. Implement MBPP execution, full-code sampling, prefix proposal, prefix completion, and prefix-search metrics.
  2. Run a smoke pass on a tiny held-out slice.
  3. Run a pilot oracle-prefix ceiling against matched full-code sampling.
  4. Only train a prefix value selector if the oracle ceiling clears.
  5. Generate a report with charts and a gate decision.

Running Notes

  • 2026-06-26: Created fresh standalone experiment and large-artifact directories.
  • 2026-06-26: Smoke run on 2 held-out test tasks completed. A summary bug initially reported zeros because per-task metrics were nested; fixed the aggregator and rebuilt the smoke summary.
  • 2026-06-26: Pilot run on 12 held-out test tasks completed with matched completion budget: 8 full samples versus 4 prefixes x 2 completions. Full sampling, prefix union, and oracle-selected prefix all covered 9/12. Lexical-selected prefix covered 8/12; random-selected prefix covered 7/12.
  • 2026-06-26: Gate decision: strict oracle-prefix coverage gate failed because prefix search did not improve coverage over full sampling at matched completion count. No value model was trained.

Figures 3

coverage
coverage · reports/figures/
diversity
diversity · reports/figures/
prefix validity
prefix validity · reports/figures/

Data files 3

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

Reproduce

Runnable scripts exist in the experiment folder, but the exact invocation was not written down.

Browse the experiment folder on GitHub ↗