Skip to content

Feat/probe canvas alloc - #5

Open
mikl123 wants to merge 3 commits into
Li-Jinsong:mainfrom
mikl123:feat/probe-canvas-alloc
Open

mikl123 wants to merge 3 commits into
Li-Jinsong:mainfrom
mikl123:feat/probe-canvas-alloc

Conversation

@mikl123

@mikl123 mikl123 commented Aug 29, 2026

Copy link
Copy Markdown

No description provided.

Mykhailo Buleshnyi and others added 3 commits August 29, 2026 15:22
…th it

One forward pass over [prompt][MASK x c], before any token exists, predicts how long the
answer will be. Compared against DAEDAL's Stage-1, which finds the same number by growing
the canvas ~40 forward passes at a time, and against SmartCrop, which like the probe costs
one pass.

Only probe_outlen.py is new code. The rest already existed:
  capture   capture_task_features.py rebuilds THIS repo's prompt (task fn -> chat template
            -> assistant prefill) and reads the dataset from the task YAML, so doc_id here
            is the harness doc_id. Features captured under another prompt cannot be joined
            to labels measured under this one.
  label     metrics/math500.py already writes per_problem_tokens.csv; the informative column
            is effective_tokens, not total_raw_tokens, which is just the canvas.
  run       scripts/eval_LLaDA_ProbeLen.sh

Every arm runs the SAME decoder and differs only in the initial canvas. The baseline script
header records why: the vanilla LLaDA decoder and the DAEDAL decoder produced 0/34 identical
outputs at canvas 32 on the same problems, so a policy-vs-uniform delta measured across
decoders would mix allocation with decoding.

alloc_out on LLaDA_DAEDAL is additive and exists so Stage-1's prediction can be read per
problem -- scored as a predictor, not only as an end-to-end policy. SmartCrop already wrote
the same schema, so probe_outlen.py --compare reads all three from one function.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Five steps, in dependency order, with the two checks that decide whether to continue: the
truncation rate at canvas 2048 (a truncated answer is a lower bound, not a length -- at 1024
in the companion repo 55% of MATH answers were still running), and the Experiment 1 table,
which gates whether Experiment 2 is worth the GPU time.

Also makes TASKS overridable in eval_LLaDA_Baseline.sh. It was hardcoded to math500, and the
probe is fitted on math_train, so labelling the fit set needed either this one-line change or
a second near-identical script.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Not every dataset has a train split, and gsm8k/humaneval/mbpp have none here. --cv K fits
out-of-fold on the eval task itself using make_cv_folds copied from dllm_probe/probe/cv.py
-- stratified by level, 20%% test, 60/20 train/val, seed 0 -- so answer length is estimated
under the same protocol as difficulty and success in the companion repo.

CV is free in GPU terms: the expensive step is generation, not fitting, and out-of-fold
predictions concatenate into one allocation CSV that a single generation run consumes. Every
row was predicted by a model that never saw that problem.

fit() now takes explicit train/val indices instead of splitting internally, which is what
lets one function serve both the fixed-split and per-fold paths.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant