Skip to content

Paper §3-4 prose: the kernel paragraph explains candidate selection, §4 one job per sentence, condition names - #194

Merged
SamMausberg merged 4 commits into
mainfrom
writing/m2-head-setup
Oct 2, 2026
Merged

SamMausberg merged 4 commits into
mainfrom
writing/m2-head-setup

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

Why

This is the second pass of the main-text edit, after #183 (§1-2). It grades every unit of §3 and §4 as strong, uneven or weak; fixes the sentences that fail; and leaves strong units as they are. Two cold readers flagged §3.4's kernel paragraph as unparseable. §4 carried sentences doing four jobs, a circular pointer between §3.1 and §4.2, and repeated qualifications. One row per unit is at the end.

It is rebased onto main after #183 merged.

What changed

§3, The Certified Head

  • §3.1, the paragraph after Theorem 3.1: the error bound's name and meaning come first, then why the computed comparisons are sound, which hardware assumption the screen rests on, and how loose the bound is. The appendix pointer goes last without its jargon list ("group scales, exact outlier columns, blockwise bounds").
  • §3.3 ¶1: SGLang's seeded race cites SGLang's sampler (citation auditor S5). "as part of our engine patches" is dropped.
  • §3.3 ¶2: "It changes the rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: ..." replaces the "This is a change of rule, not a faster version of ..." contrast. "has not been checked for it" becomes "is unchecked for it".
  • §3.4: the kernel paragraph says what each GPU program keeps per chunk of vocabulary entries (the four largest upper ends and the largest upper end of the rest), how the selection step recovers a whole chunk when that remainder reaches the screen's threshold, and that an overflowing list falls back. The facts are from src/certified_head/kernels.py (epilogue 3 and the selection kernel). No number or evidence key changes.

§4, Measurements

  • §4.1, System: MTP-4B's settings leave the parenthesis.
  • §4.1, Capture: the analysis/held-out split drops its jargon examples, and one clause says why the kernel replay draws from both halves.
  • §4.1, A fixed configuration: "On a server that runs at most 16 requests at once and queues the rest, plain greedy decoding differs ... between a client that keeps 1 request in flight and one that keeps 32". Cold reader 3 read the old wording as a contradiction; Appendix D says "the rest queued". "divergence prompts" (used once in the main text) becomes "320 separate prompts". The repeat of §2.3's batch-shape rule goes.
  • §4.2: the kernel-replay count folds its model dependence into one sentence and names the moved Table 3's appendix. The held-out paragraph splits its first sentence and drops the repeat of §1's "half the bytes". It also drops the "not because its bound is tight" contrast and the circular pointer to §3.1, and puts "with the gap condition only" beside the speculative-capture claim.
  • §4.3: paragraph heads say "interval condition", the paper's name since Paper §1-2 prose: targeted fixes by unit, Sam's title, error-model qualifiers, terminology unified #183. The kernel-replay paragraph points to §2.2 for the FP32-output variant, whose 1/58 is stated there. The engine check no longer restates the previous paragraph's conclusion about the per-position fallback.
  • §4.4: the microbenchmark paragraph takes the two details leaving Figure 3(c)'s caption in the figures pass: times are medians of 30 graph replays, and under the Hopper model both expected times lie between the conservative ones and the all-certified time at every measured M. I checked the second against evidence/certified_head/head_path_time.csv at all nine M from 1 to 256, for both fallbacks. The paragraph's last sentence no longer has an unclear "that".
  • Tables 2 and 3: "gap rule"/"interval rule" become "gap condition"/"interval condition".

Not touched: float blocks and captions (figures pass), §4.5 and Table 5 (results content). Targeted notes for §4.5 are in the ledger.

Checks

  • Build at c4c462e (build_paper.sh, one core): 0 LaTeX warnings, 0 overfull boxes. The paper is 50 pages and the notes 53. The main text ends on p10. scripts/check_paper_references.py --rev HEAD is clean.
  • Length: setup.tex is 53 words shorter and head.tex 1 longer. On p10 the References heading sits about one line higher than on main (614.7pt against 625.3pt).
  • numdiff against main (6490520, Paper §1-2 prose: targeted fixes by unit, Sam's title, error-model qualifiers, terminology unified #183 merged): 0 numbers found nowhere. Dropped: one "1/58", because §4.3 now points to §2.2, where the 1/58 is stated with [E12]; and one "BF16", in the repeat of §1's "reads half the BF16 head's bytes". Added: "30", the replay count moved from the Figure 3(c) caption. Every \ev and \pend is still on its claim.
Old and new text, unit by unit

head.tex

Old:

Appendix~\ref{app:proofs} proves the general form (group scales, exact outlier columns, blockwise bounds; Theorem~\ref{thm:envelope-general}) and gives $\eta'$. We call $\beta_i$, the half-width of entry $i$'s interval $\tilde z_i\mp\beta_i$, the copy's \emph{error bound}. The kernel rounds the norms of $h$ up and the interval ends outward, so every computed comparison is sound, provided it evaluates the analysed operations (Table~\ref{tab:assumptions}). The screen therefore rests on a hardware assumption too, but always the conservative one; the \modelhopper{} enters only through the stock kernel's $G_i$. The bound assumes the worst alignment of $e_i$ and $h$, so it is loose: its median on captured states is 1.00 logit, about 75 times the median realized error \ev{stats}.

New:

We call $\beta_i$ the copy's \emph{error bound}: entry $i$'s real logit lies in the interval $\tilde z_i\mp\beta_i$. The kernel rounds the norms of $h$ up and the interval ends outward, so every comparison it computes is sound, provided it evaluates the analysed operations (Table~\ref{tab:assumptions}). The screen thus rests on a hardware assumption too, but always on the conservative one; the \modelhopper{} enters only through the stock kernel's $G_i$. The bound assumes the worst alignment of $e_i$ and $h$, so it is loose: its median on captured states is 1.00 logit, about 75 times the median realized error \ev{stats}. Appendix~\ref{app:proofs} proves a general form (Theorem~\ref{thm:envelope-general}) and gives $\eta'$.

head.tex

Old:

With a seed and no top-$k$ or top-$p$ truncation, SGLang samples a token as the winner of a race: it adds Gumbel noise, computed from a 32-bit hash of (seed, token position in the sequence, token), to the log-probabilities and takes the argmax. Because the noise is fixed before any score is known, the same five steps certify the race's winner, with the bounds applied to the noisy scores (Appendix~\ref{app:sampling}). \emph{Fixed-noise verification}~\cite{daliri2025} uses that race to check sampled drafts: a drafted token is accepted exactly when it wins the target's race at its position. We implemented it in SGLang as part of our engine patches.

New:

With a seed and no top-$k$ or top-$p$ truncation, SGLang samples a token as the winner of a race: it adds Gumbel noise, computed from a 32-bit hash of (seed, token position in the sequence, token), to the log-probabilities and takes the argmax~\cite{sglangsampler}. Because the noise is fixed before any score is known, the same five steps certify the race's winner, with the bounds applied to the noisy scores (Appendix~\ref{app:sampling}). \emph{Fixed-noise verification}~\cite{daliri2025} uses that race to check sampled drafts: a drafted token is accepted exactly when it wins the target's race at its position. We implemented it in SGLang.

head.tex

Old:

This is a change of rule, not a faster version of SGLang's speculative sampler, which verifies drafts by rejection sampling: for sampled drafts, fixed-noise verification can accept as little as half as often, and for deterministic drafts, SGLang's default, as often (Appendix~\ref{app:coupling}). Its output follows the target's sampling distribution only for idealized continuous noise and logits that depend only on the prefix, which the 32-bit hash and the engine do not guarantee (Appendix~\ref{app:fixednoise}). The stock seeded sampler exists only in SGLang's deterministic-inference mode, whose head kernel is DeepGEMM's deterministic GEMM rather than cuBLAS; the \modelcons{} covers it, and the \modelhopper{} has not been checked for it.

New:

It changes the rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: it can accept sampled drafts as little as half as often, and deterministic drafts, SGLang's default, as often (Appendix~\ref{app:coupling}). Its output follows the target's sampling distribution only for idealized continuous noise and logits that depend only on the prefix, which the 32-bit hash and the engine do not guarantee (Appendix~\ref{app:fixednoise}). The stock seeded sampler exists only in SGLang's deterministic-inference mode, whose head kernel is DeepGEMM's deterministic GEMM rather than cuBLAS; the \modelcons{} covers it, and the \modelhopper{} is unchecked for it.

head.tex

Old:

The certified head for $M$ head inputs runs as a short pipeline with grids fixed by $M$, recorded as a CUDA graph once per batch size together with its fallback. The int8 pass multiplies int8 weights by the BF16 head inputs (W8A16), accumulates on tensor cores in FP32, and evaluates the error bound in its epilogue with directed rounding. Instead of writing the $M\times V$ logits, each chunk of vocabulary entries it processes keeps its four largest upper bounds and one bound for the rest of the chunk; a chunk whose remaining bound still reaches the threshold has all its entries kept, so compaction into a candidate list of fixed capacity loses no candidate, and a position whose list overflows goes to the whole-batch fallback. A kernel inherits the error bound only if it computes the modelled arithmetic, which is checked, not proved: each compiled variant must pass a self-test before it certifies, and every call checks eight exactly computed vocabulary entries per position \ev{kernel-impl}. The checks have caught faulty compiled kernel configurations, which are now refused (Appendix~\ref{app:kernel-checks}) \ev{kernel-tma,triton-tma}. The int8 copy, 0.64~GB, is held in addition to the resident BF16 head (derived).

New:

The certified head runs as a short pipeline of GPU launches whose grids depend only on $M$, recorded with its fallback as one CUDA graph per batch size. The int8 pass multiplies the int8 weights by the BF16 head inputs (W8A16), accumulates in FP32 on tensor cores and computes each interval in its epilogue with directed rounding. Instead of writing the $M\times V$ logits, each GPU program keeps, per position and per chunk of vocabulary entries, only the four largest upper ends and the largest upper end among the rest. Once each position's largest lower end is known, a selection step keeps every stored entry that reaches the screen's threshold. If the largest upper end among the rest of a chunk reaches it too, the step keeps the whole chunk, so no candidate is lost. A position whose candidates overflow the list's fixed capacity goes to the whole-batch fallback. A kernel inherits the error bound only if it computes the modelled arithmetic, which is checked, not proved: each compiled variant must pass a self-test before it certifies, and every call checks eight exactly computed vocabulary entries per position \ev{kernel-impl}. The checks have caught faulty compiled kernel configurations, which are now refused (Appendix~\ref{app:kernel-checks}) \ev{kernel-tma,triton-tma}. The int8 copy takes 0.64~GB beside the resident BF16 head (derived).

setup.tex

Old:

\paragraph{System} One NVIDIA GH200 with SGLang~\cite{sglangpaper} at commit \sourcepin{}, PyTorch 2.13 for CUDA 13.0 and the FlashInfer attention backend (Appendix~\ref{app:pins} lists every version). The target is Qwen3.5-4B at revision \modelpin~\cite{qwencard}. The drafters are MTP-4B, the model's native MTP layer (top-$k$ 1; four draft steps in the captures, three in the profile of Figure~\ref{fig:breakdown}), and DFlash-4B, the public block drafter for this target~\cite{dflashpaper,dflash4bcard}, which drafts blocks of 16 tokens and projects them through the target's head.

New:

\paragraph{System} One NVIDIA GH200 with SGLang~\cite{sglangpaper} at commit \sourcepin{}, PyTorch 2.13 for CUDA 13.0 and the FlashInfer attention backend (Appendix~\ref{app:pins} lists every version). The target is Qwen3.5-4B at revision \modelpin~\cite{qwencard}. The drafters are MTP-4B, the model's native MTP layer, run with top-$k$ 1 and four draft steps in the captures (three in the profile of Figure~\ref{fig:breakdown}), and DFlash-4B, the public block drafter for this target~\cite{dflashpaper,dflash4bcard}, which drafts blocks of 16 tokens and projects them through the target's head.

setup.tex

Old:

\paragraph{Capture} A capture-only engine patch records each position's head input as BF16 bit patterns, with the token the engine chose; under speculation it also records the drafter's head inputs and pairs each drafted token with the target head input that verifies it. The capture servers ran without CUDA graphs or the overlap scheduler, with at most 16 running requests in plain decoding (Appendix~\ref{app:transport-capture}). The 320 \emph{capture prompts} come from eight public datasets in four domains and were decoded greedily for 384 tokens. They were split by prompt into an analysis half, on which data-dependent choices were made (such as which columns of $h$ to compute exactly, or a rotation of $h$), and a held-out half. The deployed copy and its bound depend on the weights alone, so the kernel replay need not be held out, and it is not: its positions come from both halves. In plain decoding the FP64 argmax of the captured head input equals the engine's token at 99.51\% of positions, and every disagreement lies within one BF16 spacing of the FP64 winner \ev{alignment}.
\paragraph{A fixed configuration}\label{sec:same-shape} Bit-equality is a useful test only within one configuration, because the stock engine's own output varies across configurations: on one server running at most 16 requests, plain greedy decoding with the client keeping 1 or 32 requests in flight differs within 256 tokens in 52\% of 320 \emph{divergence prompts}, a separate test set (Appendix~\ref{app:divergence}) \ev{state-noise}. A bit-exact trace places the first differences upstream of the head, in kernels whose results depend on the batch or the memory pools, never in the head GEMM or the tie rule \ev{state-mech}. Every comparison here therefore holds the serving configuration fixed and compares a speculative configuration with stock speculative verification, not with plain decoding; the contract also fixes the head's batch shape $M$ (Section~\ref{sec:kernel-fallback}).

New:

\paragraph{Capture} A capture-only engine patch records each position's head input as BF16 bit patterns, with the token the engine chose; under speculation it also records the drafter's head inputs and pairs each drafted token with the target head input that verifies it. The capture servers ran without CUDA graphs or the overlap scheduler, with at most 16 running requests in plain decoding (Appendix~\ref{app:transport-capture}). The 320 \emph{capture prompts} come from eight public datasets in four domains and were decoded greedily for 384 tokens. They were split by prompt into an analysis half, on which the data-dependent choices were made, and a held-out half. The deployed copy and its bound depend on the weights alone, so the kernel replay draws its positions from both halves. In plain decoding the FP64 argmax of the captured head input equals the engine's token at 99.51\% of positions, and every disagreement lies within one BF16 spacing of the FP64 winner \ev{alignment}.
\paragraph{A fixed configuration}\label{sec:same-shape} Bit-equality is a useful test only within one configuration, because the stock engine's own output varies across configurations. On a server that runs at most 16 requests at once and queues the rest, plain greedy decoding differs within 256 tokens on 52\% of 320 separate prompts between a client that keeps 1 request in flight and one that keeps 32 (Appendix~\ref{app:divergence}) \ev{state-noise}. A bit-exact trace places the first differences upstream of the head, in kernels whose results depend on the batch or the memory pools, never in the head GEMM or the tie rule \ev{state-mech}. Every comparison here therefore holds the serving configuration fixed, and speculative runs are compared with stock speculative verification.

setup.tex

Old:

\paragraph{Kernel replay, \Rstock{} rule} On the first 60,000 captured positions, at their engine batch shapes, the certified head recomputes about 1.8 entries per decision on average, and one at the median (Table~\ref{tab:fallback}) \ev{kernel-replay}. The count depends on the stock-kernel model through the margin $\delta_{\max}$; the copy's own bound always uses the conservative constant.

New:

\paragraph{Kernel replay, \Rstock{}} On the first 60,000 captured positions, the certified head recomputes about 1.8 entries per decision on average and one at the median, depending on the stock-kernel model through the margin $\delta_{\max}$ (Table~\ref{tab:fallback} in Appendix~\ref{app:candidates}) \ev{kernel-replay}.

setup.tex

Old:

\paragraph{Held-out replay, \Rreal{} rule} This replay of 6,005 held-out plain-decoding positions, drawn as whole decode steps, compares copies of the head on the simpler \Rreal{} decision, whose screen needs no margin; no error bound was violated and the exact winner was always a candidate \ev{selfevidence,selfevidence-csv}. Int8 with one scale per entry reads half the BF16 head's bytes and needs 1.55 candidates on average. FP8 needs about three times as many, and int4 leaves tens of thousands (Figure~\ref{fig:candidates}a; Table~\ref{tab:candidates}). Int8 suffices because of the margins, not because its bound is tight (Section~\ref{sec:envelope}). Its intervals are about two logits wide, while the median gap between the two largest logits is 7.3 logits \ev{stats}, so tightening the bound helps little (Appendix~\ref{app:candidates}). On the verification positions of the speculative captures, the counts are about the same as in plain decoding (Appendix~\ref{app:candidates}) \ev{selfevidence-dflash,selfevidence-mtp}; there only the gap condition of Theorem~\ref{thm:stock} has been evaluated offline.

New:

\paragraph{Held-out replay, \Rreal{}} This replay compares copies of the head on 6,005 held-out plain-decoding positions, drawn as whole decode steps, with the simpler \Rreal{} decision, whose screen needs no margin. No error bound was violated, and the exact winner was always a candidate \ev{selfevidence,selfevidence-csv}. Int8 with one scale per entry needs 1.55 candidates on average; FP8 needs about three times as many, and int4 leaves tens of thousands (Figure~\ref{fig:candidates}a; Table~\ref{tab:candidates}). Int8 is enough because the margins are wide: its intervals are about two logits wide, while the median gap between the two largest logits is 7.3 logits \ev{stats}, so a tighter bound would help little (Appendix~\ref{app:candidates}). On the verification positions of the speculative captures, evaluated offline with the gap condition only, the counts are about the same as in plain decoding (Appendix~\ref{app:candidates}) \ev{selfevidence-dflash,selfevidence-mtp}.

setup.tex

Old:

\paragraph{Kernel replay, \Rstock{} interval rule} The certified head leaves 0.28\% of positions to the stock head under the \modelhopper{} and 1.46\% under the \modelcons. With that fallback, every token equals the engine's \ev{kernel-replay}. The held-out replay gives nearly the same shares, 0.35\% and 1.40\% (Table~\ref{tab:fallback} in Appendix~\ref{app:candidates}). Under the gap rule its fallback share never falls below about 2\%, because that rule demands a margin of more than one BF16 spacing. This agreement cannot tell the models apart: even an IEEE FP32 summation tree, with a $\gamma_{\rm stock}$ about 360 times smaller than the conservative one, certifies every held-out position and gets every token right \ev{rstock}. It is consistent with each model, not a proof of any; the stock FP32-output kernel's largest observed error, 1/58 of the \modelhopper's bound, is the more direct test (Section~\ref{sec:limits}).

New:

\paragraph{Kernel replay, \Rstock{}, interval condition} The certified head leaves 0.28\% of positions to the stock head under the \modelhopper{} and 1.46\% under the \modelcons, and with that fallback every token equals the engine's \ev{kernel-replay}. The held-out replay gives nearly the same shares, 0.35\% and 1.40\%; under the gap condition, which needs a margin of more than one BF16 spacing, its share never falls below about 2\% (Table~\ref{tab:fallback}). This agreement is consistent with each model, not a proof of any: even an IEEE FP32 summation tree, with a $\gamma_{\rm stock}$ about 360 times smaller than the conservative one, certifies every held-out position and gets every token right \ev{rstock}. The observed error of the stock GEMM's FP32-output variant (Section~\ref{sec:headcontracts}) is the more direct test.

setup.tex

Old:

\paragraph{Engine check, \Rstock{} interval rule}\label{sec:engine} The engine check ran the kernel inside SGLang, untimed and under the \modelcons, on plain decoding, greedy verification and the drafters' projections. In concurrent runs (up to 16 requests for plain decoding, 8 for speculation) none of 196,734 certified positions differed from the stock head at the same batch shape \ev{kernel-engine}. Runs with one request at a time gave identical certified and stock outputs on all 64 prompts for plain decoding and MTP-4B; DFlash-4B's outputs were not compared end to end. Every path used the whole-batch fallback except one plain-decoding run, which used the per-position fallback. Plain decoding fell back at 1.38\% of positions, close to the kernel replay's 1.46\%, and MTP-4B verification at 1.74\%. DFlash-4B verification sends up to 128 positions per call and left only 3.99\% of them open, yet ran the whole-batch fallback in 90\% of its verify head calls. We infer that the per-position fallback would have to carry the result there; the engine check exercised it only in plain decoding.

New:

\paragraph{Engine check, \Rstock{}, interval condition}\label{sec:engine} The engine check ran the kernel inside SGLang, untimed and under the \modelcons, on plain decoding, greedy verification and the drafters' projections. In concurrent runs (up to 16 requests for plain decoding, 8 for speculation) none of 196,734 certified positions differed from the stock head at the same batch shape \ev{kernel-engine}. Runs with one request at a time gave identical certified and stock outputs on all 64 prompts for plain decoding and MTP-4B; DFlash-4B's outputs were not compared end to end. Every path used the whole-batch fallback except one plain-decoding run, which used the per-position fallback. Plain decoding fell back at 1.38\% of positions, close to the kernel replay's 1.46\%, and MTP-4B verification at 1.74\%. DFlash-4B verification sends up to 128 positions per call and left only 3.99\% of them open, yet ran the whole-batch fallback in 90\% of its verify head calls. The engine check exercised the per-position fallback only in plain decoding.

setup.tex

Old:

In the microbenchmark (the head alone at $M=1$ to 256, CUDA graphs, warm L2 cache) a fully certified batch at $M=1$ takes 239.6~\textmu s, against 370.5~\textmu s for the stock head. Adding each fallback's measured cost at its measured rate gives an expected time of about 0.7 of the stock head's up to 16 positions, with the per-position fallback under the \modelcons{} (Figure~\ref{fig:candidates}c) \ev{kernel-rowwise,kernel-path}. From 128 positions every mode is slower, because the int8 pass alone is slower than the stock head there; with the whole-batch fallback, 77\% of calls also pay for the stock head. The pass is not bound by memory bandwidth: at one position its directed-rounding epilogue keeps the streaming multiprocessors 79\% busy while it draws 62--63\% of DRAM bandwidth, so its time grows with $M$ faster than the stock GEMM's \ev{kernel-micro}. At one position the expected time under the \modelcons{} is 0.66--0.67 of the stock head's with either fallback \ev{kernel-path}. Since the head takes 10.3\% of a plain decode step at batch 1, that would shorten the step by at most about 3.4--3.5\% (derived; the effect on served decoding is not yet measured \pend{bench-cert}).

New:

In the microbenchmark (the head alone at $M=1$ to 256, CUDA graphs, warm L2 cache; medians of 30 graph replays) a fully certified batch at $M=1$ takes 239.6~\textmu s, against 370.5~\textmu s for the stock head. Adding each fallback's measured cost at its measured rate gives an expected time of about 0.7 of the stock head's up to 16 positions, with the per-position fallback under the \modelcons{} (Figure~\ref{fig:candidates}c) \ev{kernel-rowwise,kernel-path}. Under the \modelhopper{}, with its lower fallback rates, both expected times lie between these and the all-certified time at every measured $M$ \ev{kernel-path}. From 128 positions every mode is slower, because the int8 pass alone is slower than the stock head there; with the whole-batch fallback, 77\% of calls also pay for the stock head. The pass is not bound by memory bandwidth: at one position its directed-rounding epilogue keeps the streaming multiprocessors 79\% busy while it draws 62--63\% of DRAM bandwidth, so its time grows with $M$ faster than the stock GEMM's \ev{kernel-micro}. At one position the expected time under the \modelcons{} is 0.66--0.67 of the stock head's with either fallback \ev{kernel-path}, so with the head at 10.3\% of a plain decode step at batch 1, the step would shorten by at most about 3.4--3.5\% (derived; the effect on served decoding is not yet measured \pend{bench-cert}).

app_register.tex

Old:

Held-out replay & FP64 replay of held-out plain-decoding positions & \Rreal{} to compare copies; gap and interval rules & 6,005 positions\\\addlinespace[2pt]
Kernel replay & the GPU kernel on the first captured positions, both halves, at their batch shapes & interval rule; seeded race & 60,000 positions\\\addlinespace[2pt]
Engine check & the kernel inside SGLang, \modelcons & interval rule; fixed-noise verification & 64 prompts\\\addlinespace[2pt]

New:

Held-out replay & FP64 replay of held-out plain-decoding positions & \Rreal{} to compare copies; gap and interval conditions & 6,005 positions\\\addlinespace[2pt]
Kernel replay & the GPU kernel on the first captured positions, both halves, at their batch shapes & interval condition; seeded race & 60,000 positions\\\addlinespace[2pt]
Engine check & the kernel inside SGLang, \modelcons & interval condition; fixed-noise verification & 64 prompts\\\addlinespace[2pt]

app_register.tex

Old:

Speculative captures & aligned draft and target head inputs; verification positions & \Rreal{}, gap rule; drift & 40,000 pairs per drafter\\\addlinespace[2pt]

New:

Speculative captures & aligned draft and target head inputs; verification positions & \Rreal{}, gap condition; drift & 40,000 pairs per drafter\\\addlinespace[2pt]

app_proofs.tex

Old:

\caption{Recomputation and fallback by the model assumed for the stock kernel: mean candidates and the share of positions left to the stock head. Held-out replay columns: the gap and interval rules, and the share of decode steps (8.0 held-out positions each) with a position the interval rule leaves. The last row is a sensitivity check, not a model of the stock kernel. By rule and step in full: Table~\ref{tab:rstock}.}\label{tab:fallback}

New:

\caption{Recomputation and fallback by the model assumed for the stock kernel: mean candidates and the share of positions left to the stock head. Held-out replay columns: the gap and interval conditions, and the share of decode steps (8.0 held-out positions each) with a position the interval condition leaves. The last row is a sensitivity check, not a model of the stock kernel. By rule and step in full: Table~\ref{tab:rstock}.}\label{tab:fallback}
Ledger: one row per unit
id file:unit grade action one-line reason render
H0 head.tex: §3 lead strong kept one sentence; the contrast with transport is deliberate p4
H1 head.tex: §3.1 ¶1 uneven targeted (in #183)
H2 head.tex: Theorem 3.1 strong kept p4-5
H3 head.tex: ¶ after Thm 3.1 uneven targeted (reordered) name and meaning of beta first; appendix pointer last, without the jargon list p5
H4 head.tex: §3.2 five steps strong kept p5
H5 head.tex: ¶ after the steps strong kept p5
H6 head.tex: §3.3 ¶1 uneven targeted S5 cite (sglangsampler); "We implemented it in SGLang."; fixed-noise name (in #183) p5
H7 head.tex: §3.3 ¶2 uneven targeted (first sentence, one phrase) "It changes the rule of SGLang's speculative sampler" replaces the not-X-but-Y opening; "is unchecked for it" p5
H8 head.tex: §3.3 ¶3 strong (after #181) kept p5
H9 head.tex: §3.4 weak rewritten says what each program keeps per chunk, how a whole chunk is recovered, and the overflow path; kernels.py checked p5
S0 setup.tex: §4 lead uneven kept #181 already tightened it; the list of sources is the main text's only definition of their names p5-6
S1 setup.tex: §4.1 System uneven targeted no semicolon inside the parenthesis p6
S2 setup.tex: §4.1 Capture uneven targeted jargon examples out; one clause for the kernel replay's halves p6
S3 setup.tex: §4.1 A fixed configuration uneven targeted "queues the rest" beside the 16; "320 separate prompts"; §2.3's batch-shape rule not repeated p6
S4 setup.tex: §4.2 Kernel replay uneven targeted model dependence folded into the sentence; moved table's appendix named; §3.1 repeat dropped p6
S5 setup.tex: §4.2 Held-out replay uneven targeted first sentence split; half-the-bytes repeat and circular §3.1 pointer out; gap-condition scope beside its claim p6
S6 setup.tex: §4.3 Kernel replay, interval condition weak rewritten four jobs in five sentences; points to §2.2 for the FP32-output variant p6
S7 setup.tex: §4.3 Fallback grows with the batch strong kept sound logic; numbers each carry their source p6
S8 setup.tex: §4.3 Engine check uneven targeted head renamed; last sentence no longer restates S7's conclusion p6-7
S9 setup.tex: §4.4 equation and baseline strong kept p7
S10 setup.tex: §4.4 microbenchmark weak targeted Fig 3(c) caption details moved in (30 replays; Hopper between the lines, checked in the CSV); unclear "that" fixed p7
S11a setup.tex: §4.5 The stock baseline uneven notes for P2's owner "...for every drafter; at c=1, DFlash-4B ..." joins two claims with a semicolon; "excluding losses above about 3.3 points (derived), not smaller ones" is hard to parse ("which excludes losses above about 3.3 points but not smaller ones") p7-8
S11b setup.tex: §4.5 Engine changes uneven notes for P2's owner "gain 3.4-3.5% for plain decoding at c=1 and 0.991 times for MTP" mixes a percent gain with a ratio ("but leave MTP at 0.991 times its throughput") p8
T2-AppF app_register.tex: Table 2 cells -- targeted (terminology) "gap/interval condition" App F
T3-AppA app_proofs.tex: Table 3 caption -- targeted (terminology) "gap and interval conditions", "interval condition" App A

…andidate is lost, S5 cites SGLang's sampler

§3.1, the paragraph after Theorem 3.1: the error bound's name and meaning
come first, then why the computed comparisons are sound, which hardware
assumption the screen rests on, and how loose the bound is; the appendix
pointer goes last without its jargon list.

§3.3 ¶1: the seeded sampler's race cites SGLang's sampler (citation
auditor S5); "as part of our engine patches" is dropped.

§3.4: the kernel paragraph says what each GPU program keeps per chunk of
vocabulary entries (the four largest upper ends and the largest upper end
of the rest), how the selection step recovers a whole chunk when that
remainder reaches the threshold, and that an overflowing list falls back.
Facts from src/certified_head/kernels.py (epilogue 3 and the selection
kernel); no number or evidence key changes.
…es, §4.3 points back to §2.2

§4.1: the capture split drops its jargon examples and says in one clause
why the kernel replay draws from both halves; the fixed-configuration
paragraph keeps "queues the rest" beside the 16-request cap (cold reader 3)
and no longer repeats §2.3's batch-shape rule; MTP-4B's settings leave the
parenthesis.
§4.2: the kernel-replay count folds its model dependence into one
sentence and gives the moved Table 3's appendix; the held-out paragraph
splits its first sentence, drops the half-the-bytes repeat and the
circular pointer to §3.1, and puts "gap condition only" beside the
speculative-capture claim.
§4.3: paragraph heads say "interval condition"; the kernel-replay
paragraph points to §2.2 for the FP32-output variant (its 1/58 is stated
there); the engine check no longer restates §4.3's per-position
conclusion.
§4.4: the microbenchmark paragraph takes the two details leaving Figure
3(c)'s caption (medians of 30 graph replays; under the Hopper model both
expected times lie between the conservative ones and the all-certified
time at every measured M, checked against head_path_time.csv) and fixes
the unclear "that would shorten".
§3.3 ¶2: "It changes the rule of SGLang's speculative sampler" replaces
the "not X but Y" opening; "is unchecked for it".
…s the main text does

The last uses of "gap rule" and "interval rule" were in the moved Table 2
(Appendix F) and Table 3's caption (Appendix A); one name per thing.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T09:46:45.806588Z 2ca57a9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: c4c462e8d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES at c4c462e

Reviewer 2 (paper fidelity and quality). I diffed every changed paragraph against main (6490520) and checked the new and changed facts against the code and the evidence. The PR is careful. Every number, condition and \ev survives, and the §3.4 rewrite is accurate and much clearer. One sentence in §3.3 has become ambiguous in a way that can invert a comparison, and that blocks.

Checked and correct

  • §3.4 against src/certified_head/kernels.py:
    • _compact_tiles_kernel reads the per-tile top entries and their indices, plus rest, the largest upper end among the tile's other entries.
    • It appends every top entry with hv >= t, where t is the threshold from the position's largest lower end.
    • For a tile whose rest >= t it appends all TILE_ROWS rows ("so the list stays complete").
    • "Only a list longer than CAP falls back."
    • "four largest upper ends and the largest upper end among the rest", "keeps the whole chunk", "overflow ... goes to the whole-batch fallback": all as described.
  • §4.4 "Under the Hopper model ... both expected times lie between these and the all-certified time at every measured M": I checked head_path_time.csv at M = 1, 2, 4, 8, 16, 32, 64, 128 and 256. hopper_w8a16_expected_us lies within [w8a16_us, w8a16_expected_us] and hopper_columns_expected_us within [w8a16_us, columns_expected_us] at every M (for example, at M = 16: 273.2 in [256.9, 335.0] and 262.8 in [256.9, 271.5]).
  • "Medians of 30 graph replays" moves from the Fig. 3(c) caption.
  • §3.3 now cites sglangsampler (S5).
  • Cuts, all repeats:
    • "reads half the BF16 head's bytes" (§1, App);
    • the 1/58 (§2.2 with [E12]; §4.3 now points there);
    • "at their engine batch shapes" (the §4 lead says "the kernel replay at the captured batch shapes");
    • "the copy's own bound always uses the conservative constant" (§3.1);
    • the M-fixing pointer (§2.3);
    • the per-position-fallback inference (the paragraph before draws it).
  • "With the gap condition only" now stands beside the speculative-capture claim. "Queues the rest" removes cold reader 3's apparent contradiction.
  • Tables 2 and 3 now say "gap/interval condition", as the main text does.

Blocking

  1. head.tex, §3.3 ¶2: "It changes the rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: it can accept sampled drafts as little as half as often, and deterministic drafts, SGLang's default, as often (Appendix B.2)."
    • The second "it" has two candidates: the subject (fixed-noise verification) and the nearest noun (SGLang's speculative sampler).
    • "As little as half as often" has lost its comparison, so a reader can take the sentence to mean that SGLang's sampler accepts half as often, which is the reverse of App B.2.
    • "Changes the rule of SGLang's speculative sampler" also reads as if fixed-noise verification modifies that sampler, rather than using a different acceptance rule.
    • The old text named the subject: "fixed-noise verification can accept as little as half as often".
    • Suggested: "Fixed-noise verification replaces the acceptance rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: it can accept sampled drafts as little as half as often as that sampler, and deterministic drafts, SGLang's default, as often (Appendix B.2)."

Optional

  • O1 head.tex, §3.1: "We call β_i the copy's error bound: entry i's real logit lies in the interval z̃_i ∓ β_i" now states the containment without the theorem's hypotheses. It sits right after Theorem 3.1 and is followed by "provided it evaluates the analysed operations", so a reader can recover them, but "...lies in the interval z̃_i ∓ β_i under the theorem's assumptions" would close it.

Build at c4c462e (my own, one core, niced, during an untimed hold): 0 LaTeX warnings, 0 overfull or underfull boxes. The paper is 50 pages and the notes 53. The Conclusion and the References heading are both on p10. check_paper_references.py --rev HEAD is clean. numdiff against 6490520: "58" and one "6" (BF16) dropped, both found elsewhere; "30" added. I rendered p5-p7 at 150 dpi and found no layout problems. Codex is clean on c4c462e.

…t sentence, and "half as often as that sampler"

The second "it" could attach to SGLang's sampler, and "half as often" had
lost its comparison, so the sentence could read as the reverse of App B.2.
§3.1: the error bound's interval holds "under the theorem's assumptions".
@SamMausberg

Copy link
Copy Markdown
Owner Author

Reviewer 2's change is in 2ca57a9. §3.3 ¶2 now opens: "Fixed-noise verification replaces the acceptance rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: it can accept sampled drafts as little as half as often as that sampler, and deterministic drafts, SGLang's default, as often (Appendix B.2)." I checked it against Proposition B.2: the standard rule accepts with probability sum_i min(p_i, q_i), and fixed-noise acceptance is at least half that. The optional §3.1 point is also in: "under the theorem's assumptions, entry i's real logit lies in the interval". The build is clean, the main text ends on p10, and numdiff is unchanged.

@SamMausberg

SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE at 2ca57a9

Reviewer 2. I checked the delta from c4c462e to 2ca57a9. It changes two sentences in head.tex, and both are right. This approves the PR, which I reviewed in full at c4c462e (issuecomment-5949440580).

  • §3.3 ¶2 now reads "Fixed-noise verification replaces the acceptance rule of SGLang's speculative sampler, which verifies drafts by rejection sampling: it can accept sampled drafts as little as half as often as that sampler, and deterministic drafts, SGLang's default, as often (Appendix B.2)." The subject and the point of comparison are now explicit. The sentence matches App B.2: the standard rule accepts with probability Σ min(p_i, q_i), and fixed-noise acceptance is at least half of that. For point-mass drafts the two rules accept equally often.
  • §3.1: "under the theorem's assumptions, entry i's real logit lies in the interval z̃_i ∓ β_i".

Build at 2ca57a9 (my own, one core, niced, during an untimed hold): 0 LaTeX warnings, 0 overfull or underfull boxes. The paper is 50 pages and the notes 53. The Conclusion and the References heading are both on p10. check_paper_references.py --rev HEAD is clean. numdiff against c4c462e: no change. numdiff against main 6490520: as before ("58" and one BF16 "6" dropped, both found elsewhere; "30" added).

Codex was clean on c4c462e (09:40) but has not been re-requested on 2ca57a9. The delta is two prose sentences with no number, citation or evidence change. If main wants a Codex pass on this head before merging, I will confirm this approval afterwards.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 2ca57a9d64

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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