DS-1000 SMC Evaluation — Offline Proposal (weighted-SFT)

Qwen2.5-Coder-3B + all-layer LoRA · 254 held-out prompts, 6 libraries incl Tensorflow (Matplotlib excluded) · temperature 0.6, max_tokens 200 · particles M∈{1,5,10,20}, R=3 · prompt-level bootstrap 95% CIs · skyline 0.378 [0.332, 0.424].

SMC weighted accuracy vs checkpoint

IS-weighted correctness over the M particles, per checkpoint, one line per particle count. Error bars = prompt-level bootstrap 95% CI.

SMC weighted accuracy

SMC validity (no-error rate) vs checkpoint

Fraction of programs that run without error. Rises with M; no skyline (validity is not an accuracy).

SMC validity

iid sampling vs SMC weighted accuracy

Pure iid sampling from the proposal (no SMC, N=50 samples/prompt) overlaid on the SMC weighted-accuracy lines per M. Same prompt-level bootstrap 95% CI on every line (see Methods). The honest picture: iid ≈ SMC at M=1 (the twist only acts through resampling, which is inert at M=1) and the SMC lift at higher M stays within the CIs — on this held-out eval the no-error twist gives no measurable accuracy gain over raw sampling.

iid vs SMC weighted accuracy

Per-prompt: base vs best checkpoint (interactive)

Hover any point for the prompt text. Below the diagonal = the best checkpoint (iter 13000) improved that prompt. Color = library; marker symbol = difficulty (✕ hard, ◆ medium, ● easy). Difficulty (cross-setting ceiling): hard 76medium 51easy 127 of 254.

Per-library net-gain (base → best, per M)

Δmean = mean(best) − mean(base) per library. Every library is net-positive at every M.

MlibrarynbasebestΔmeangainedworsened
1Numpy660.2630.374+0.111206
1Pandas870.1570.303+0.146305
1Pytorch200.1500.283+0.13362
1Scipy320.1770.354+0.177113
1Sklearn350.1710.352+0.181123
1Tensorflow140.2380.405+0.16752
1ALL2540.1930.339+0.1468421
5Numpy660.3280.447+0.1192915
5Pandas870.1760.275+0.0982715
5Pytorch200.2270.303+0.07684
5Scipy320.2550.322+0.067123
5Sklearn350.1640.357+0.192205
5Tensorflow140.2950.368+0.07353
5ALL2540.2340.344+0.11010145
10Numpy660.3120.372+0.0602122
10Pandas870.2080.261+0.0532820
10Pytorch200.1610.342+0.181102
10Scipy320.3080.341+0.032137
10Sklearn350.2590.434+0.175196
10Tensorflow140.2650.410+0.14562
10ALL2540.2540.338+0.0849759
20Numpy660.3340.404+0.0693316
20Pandas870.2160.241+0.0252919
20Pytorch200.2850.348+0.06496
20Scipy320.2640.326+0.0621210
20Sklearn350.2310.415+0.185188
20Tensorflow140.3550.416+0.06173
20ALL2540.2680.336+0.06810862

Methods

Bootstrap 95% CIs — the error bars on the line plots

A prompt-level percentile bootstrap, done independently for each (checkpoint, M) cell. The two things to keep straight: (i) we bootstrap one number per prompt (M and R are collapsed first), and (ii) the CI is a pair of percentiles, not an average of averages.

  1. Collapse M and R → one scalar per prompt. For prompt p, run SMC R = 3 times; each run gives an IS-weighted correctness (Σi weighti·correcti over its M particles); average the R runs → waccp ∈ [0, 1]. This yields a vector v = [wacc₁, …, wacc₂₅₄] of length n = 254one value per held-out prompt (not per raw sample).
  2. Resample v with replacement to size n. The unit resampled is the prompt (some prompts repeat, some drop out) — not individual samples.
  3. Mean of that resample = one replicate. Repeat B = 2000× → 2000 bootstrap means.
  4. Point estimate = mean(v) (the plotted marker). 95% CI = the 2.5th and 97.5th percentiles of the 2000 bootstrap means (the error bar). It is not the mean of the 2000 means.
def boot(v):                     # v = 254 per-prompt weighted accuracies
    means = [mean(resample_with_replacement(v, size=len(v))) for _ in range(2000)]
    return mean(v), percentile(means, 2.5), percentile(means, 97.5)   # point, lo, hi

Fixed seed. Because the unit is the prompt, the interval reflects how much the mean would move on a different draw of held-out prompts; the percentile method keeps it inside [0, 1]. (This is the macro mean — equal weight per prompt; it does not bootstrap the within-prompt Monte-Carlo noise, which would be a separate 2-level bootstrap.)

Skyline CI (the red band) — a different estimator

The skyline (0.378 [0.332, 0.424]) is pooled, not macro: Σp correctp / Σp validp — a ratio of sums across prompts, so a prompt is implicitly weighted by how many valid samples it has. Its bootstrap re-pools each resample, so the interval is around the pooled value, not the per-prompt mean used above. The skyline band and the line-plot CIs are therefore not the same kind of interval.

iid sampling

“iid sampling” draws N = 50 independent samples per prompt straight from the proposal (temperature 0.6, no SMC, no twist). Per-prompt correctness = fraction of the 50 that run correctly; the plotted point is the macro-mean over the 254 prompts, with the same prompt-level bootstrap 95% CI as the SMC lines above. On this held-out eval the twisted SMC delivers no measurable lift over iid — iid ≈ SMC at M=1 (the twist acts only through resampling, which is inert at M=1) and the SMC lift at higher M stays within the CIs.

Difficulty — the scatter marker symbol

A fixed per-prompt “ceiling” = the max weighted accuracy that prompt reaches across every setting (base iter-0 and best iter-13000, over all M ∈ {1, 5, 10, 20}). hard: ceiling < 0.10 (no configuration solves it); medium: 0.10 ≤ ceiling < 0.50; easy: ceiling ≥ 0.50.