Implement n_sec.mode = "stop_token" (per-token EOS for the AR secondary decoder) #40
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The single most "v0.3" thing missing from the v0.3 branch.
Stage 2 is now autoregressive, but multiplicity is still predicted the v0.2
way: a one-shot classifier over
{0..K_MAX}reading conditioning alone (plusthe stage-1 context), run before any token is generated; the AR loop then always
executes
k_maxslots and throws the tail away (sample_secondaries_ar,giant/sample.py:297—for k in range(k_max), unconditionally).So the one-shot assumption survives inside the autoregressive decoder. A real
EOS token — one extra stop logit per token, sampled per slot, terminating the
loop — would:
the entire point of going autoregressive (a 12th secondary's existence depends
on what the first 11 took from the energy budget;
n_sec_headcannot see that)K_MAX = 15as a modeling ceiling, leaving it as a safety capk_max × stepsmodel calls per physics stepto
n_sec × steps— on a distribution where most steps produce 0–2secondaries, that's most of stage 2's rollout cost
Everything needed is in place: the schema key exists (
n_sec.mode = "stop_token", currently rejected as unimplemented atconfig.py:1252), the ARloop is written, the prefix mask (
StageTrainer._sec_mask) and the per-tokenloss already exist. The work is a stop head, a per-token BCE term with the same
mask, and a
breakcondition in the sampler.Migrated from
issues.md(v0.3.0 branch review, 2026-08-13), Issue 15.