Verba/Rapida

Esperimenti #143fr

The answer mask's warm first-token cost (row 143fq: +1.12 ms [+0.69, +2.08] with the mask on, decode and...

done

Il testo degli esperimenti resta in inglese, come l'ha scritto il laboratorio.

Cosa è stato provato

The answer mask's first-token cost (row 143fq: +1.12 ms [+0.69, +2.08] with the mask on, and replies unchanged): `headTailPrepare` (`src/transformer.zig:29743` at LESTO 27081e53) caches the head tail's prepared kept-row state for one mask id and rebuilds it (`headTailPrepareImpl`, `:29813`) when the chosen mask changes; the choice reads `ctx.head_tail_answer`, false by default (`:4793`) and set only after a `sampleLazy` draw (`src/generate.zig:2541`), so a first decode forward before that draw may choose `suppress_mask` and the next `answer_mask`, two rebuilds a request with the mask on. Step 1 a build on lesto-r143f that counts and times `headTailPrepareImpl` calls per request and stamps them against the first SSE write, 10 sessions; then the fix (set `head_tail_answer` from the request before its first forward, or two cached slots), the 150 identity count, a pair on the warm first

Modello e configurazione

the best

Guadagno atteso

warm first token about -1.1 ms (0.05% of a warm reply), lossless

Da dove viene l'idea

row 143fq

Esito

done 2026-11-19: confirmed, one rebuild a request (`mask=suppress`, 0.86 ms) before the first content chunk with the mask on, none with it off; the fix is row 143fs

Lezione

the answer mask's warm first-token cost is one rebuild a request of the head tail's prepared kept-row state (median 0.86 ms), caused by a flag that is false until the request's first draw, so a thinking-off request first prepares the other mask: a one-slot cache keyed by a per-request choice must take that choice before its first use.

Adottato

no (a diagnostic probe, never ; its fix is row 143fs)

Vuoi vedere cosa hanno prodotto questi esperimenti? Lesto, il motore di inferenza per Gemma 4 sui Mac con Apple silicon, è su lestoengine.com

Creato da Federico Andrioli, @fedeandri su X Le misure di un laboratorio di ricerca, ricavate direttamente dai suoi file. Dati aggiornati al