Experiments #148
Grammar mask on the tuned decode step: a constrained request leaves `asyncEvalDecodeStep` (ops-only commit...
done
What was tested
Grammar mask on the tuned The writing phase: the model produces the reply one token at a time. Read more step: a Forcing the model's output to follow a strict JSON shape while it writes. request leaves `asyncEvalDecodeStep` (ops-only commit, `generate.zig:5868` against `:6031`), the head tail, and builds a 262,144-token mask on the CPU each step (`:5833`); first split the 10.7% (step trace of the constrained path, mask-only `row/146` against the best, the mask build timed), then move the mask onto the pipelined step (`2026-11-11-mac-format-fixes/README.md`, row 146 result)
Model and setup
the best
Expected gain
recovers most of 10.7% on constrained requests (inferred, unsplit)
Where the idea came from
none
Outcome
done 2026-11-12: the constrained step costs 10.1% decode with the same The text you send to the model before it starts answering., 9 points of it its full-row draw (no mask: -9.1%; no mask drawn from the head tail: +0.9%), the mask itself about 1 point; the Latin switch was a no-op (the head was already Latin); hands the fix to row 148f
Lesson
a JSON-constrained decode step in Lesto costs 10% because it builds and reduces the full 262,144-wide logits row while the greedy best reduces only the kept head rows on the A graphics card, used here as the chip that does the heavy arithmetic for a model.; drawn from the head tail, the same step decodes like the best, and the mask itself is about 1 point, so the fix is the grammar mask on the kept rows, not a faster mask build.
Adopted
no (a diagnostic; the pre-registered subject `lesto_p148ol` costs 10.1%, and the path it found is row 148f)