Speculative sampling can accelerate decoding without changing the target distribution. Its standard guarantee assumes that logits processors, which enforce constraints or modify token scores, receive the appropriate token prefix and state at each verification position. We formalize this processor-prefix contract and present BADC (branch-aware differential conformance testing). BADC combines enumerated references on tiny random models, checks of processor inputs and state, and simultaneous confidence bounds on output-event probabilities. Preregistered, source-informed experiments on selected Transformers and llama-cpp-python releases confirm two causes: processors read unverified drafts or advance state without rollback. For one pilot-selected prompt on a trained checkpoint, fresh samples give a 60.26-percentage-point lower bound on the difference in the probability of a predefined first-token event between ordinary and prompt-lookup decoding, with nominal simultaneous 95% coverage under within-arm i.i.d. sampling. Controlled comparisons establish no cause-recovery advantage of directed selection over random selection, while permutation testing detects each tested family at least as often as BADC. These findings connect processor-interface failures to observable decoding differences without establishing diagnostic superiority or workload prevalence.
Figures & tables
Figure 1: Badc pipeline (top) and the llama-cpp-python mechanism confirmed in Section 6.2 (bottom). Both arms run the unmodified engine; for vLLM the oracle is a CPU reference (Section 6.4 ).
Check
Supported interpretation
Detection
A contract witness or a confidence lower bound on the arms’ total-variation distance. Non-rejection is not conformance.
Compatibility
Consistency with one supplied mechanism law under the registered rule; alternatives are not excluded.
Repair
Fresh recurrence and upper bounds on frozen events, not a global conformance guarantee.
Exercise
Hooked draft proposals. The LCP repair acceptance counters are inexact; they do not establish precise acceptance or speedup.
Table 1: Assurance boundaries for prompt lookup. Calibration is non-rejection under the adapter and numerical assumptions.
Config
Feature probed
Role
Decision
Witness
D
Eligible
Hypothesis
Proposed
HF12-P2
plain sampling (5.12.0)
pos. control
FAIL S
623
0.0025
yes
–
925,878
HF17-N0
plain sampling ( T=1 )
neg. control
NR
0
− 0.0001
no
–
927,150
HF17-P1
stop_strings =[”cd”]
pos. control
FAIL S
1,144
0.0052
yes
–
925,554
LCP-N0-19/35
plain, generate()
neg. control
NR
0
− 0.0001
no
–
1,067,543/1,067,406
LCP-N1-19/35
plain, create_completion()
neg. control
NR
0
− 0.0001
no
–
985,359/984,606
HF17-3
T=0.7 , top- k 3, top- p 0.9, rep. 1.3
probe
INC.
0
− 0.0001
no
–
0
Table 2: The 26 sealed S1 controls and S2 probes, 200,000 draws/arm. HF17/HF12: Transformers 5.17.0/5.12.0; HFX: HF17 with xgrammar 0.2.8; LCP suffixes: 0.3.19/0.3.35. NR: not rejected; FAIL S : channel-S failure; INC.: inconclusive. Witness: speculative draws with a structural witness. D : simultaneous lower bound (Section 4.2 ); negative values mean that no event separates the arms. Eligible: witness or crash-free bound above 0.01. All listed hypotheses (H- prefix omitted) are compatible. Proposed: speculative draft-token count.
Config
Build
Frozen event
Recurrence
Repair gap
Witness UB
Confirmed
ΔB [interval]
HF17-6
5.17.0
AD2-cfg
0.0195
0.0032
6.8×10−6
yes
−0.0032 [ −0.0132 , 0.0067 ]
LCP-2-19
0.3.19
AD1-phys
0.1549
0.0020
3.4×10−5
yes
−0.0047 [ −0.0146 , 0.0053 ]
LCP-2-35
0.3.35
AD1-phys
0.1548
0.0023
3.4×10−5
yes
−0.0042 [ −0.0142 , 0.0057 ]
Table 3: Stage S3 confirmation on fresh seeds (repair arm 1,000,000 draws for Transformers and 200,000 for llama-cpp-python). Recurrence: Lon−Uoff on the event frozen in S2 (above 0.01). Repair gap: simultaneous upper bound on the repaired arm’s gap to the speculation-off arm on that event only (at most 0.01). Witness UB: the same for its witness rate (at most 10−4 ). ΔB : speculation-induced bias (Section 7 ), sealed Hoeffding interval at level 1−0.05/3 per configuration (95% jointly).
Evidence
Claim and limit
Historical repairs
Selected tiny-model probes; fresh-draw bounds on frozen repair events.
Trained scores
Four-prompt pilot and eight fixed matrix states; conditional-score/history checks, not returned-law inference.
Returned event
One selected prompt/checkpoint, 1,024 requests/arm; nominal event-gap bound under within-arm i.i.d. sampling.
Second host
Same collector, prompt, event and seeds; reproducibility without pooled N .
Table 4: Evidence units and limits of the follow-ups. Repeated calls or seeds do not add independent settings; none estimates workload prevalence.
(a) Selection, events
stateful processors
processor buffer
causes (of 20)
directed, with AH
10
9–10
19–20
directed, without AH
10
9–10
19–20
random, with AH
10
10
20
random, without AH
9
10
19
Table 5: RQ3, 10 campaigns on held-out models. (a) Campaigns in which each cause was recovered (repair-confirmed on fresh draws) and total recovered causes, per selection policy and event family; a range is a bound over missing units. (b) Configurations detected, of 10 per family and policy, by channel S with and without the hypothesis event AH and by the permutation comparator C.
directed
random
(a) Family
path
exp.
Badc
C
recurred
valid
exp.
Badc
C
allowed tokens
V1
5
5
5
5 of 5
4
4
4
4
bad words
V1
4
4
4
3 of 4 (1 missing)
5
4
4
4
minimum tokens
V1
5
5
5
5 of 5
5
5
5
5
stop strings
V1
5
5
5
5 of 5
5
3
3
3
logit bias
V1
5
5
5
5 of 5
5
5
5
5
Table 6: RQ4, vLLM 0.8.5.post1 on five held-out tiny models. (a) Positive families: configurations whose speculative arm gave the defect an opportunity (exp.), detected by Badc and by the permutation comparator C, and directed detections that recurred on fresh draws; random configurations also list the valid ones (one planned per campaign). The V1 rows sum to 45 exposed configurations (24 directed, 21 random), the V0 row to 7 (5 and 2). The V0 row is unattributed (V0’s negative controls failed), and its bounds and p-values lack their nominal guarantees. (b) Controls rejected by Badc per path, and fallback checks whose speculative arm proposed a draft token.
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
Marginal
Faulty/off
Intervention/off
HF first token
1.2971
0.1479
(0.8361,1.7581)
(0,0.5883)
HF length
0.8916
0.0441
(0.4672,1.3160)
(0,0.4565)
LCP first token
0.2686
0.2844
(0.1274,0.7162)
(0,1.0355)
Appendix
Table S1: Complete categorical-marginal TVs, in percent. Parentheses give the nominal simultaneous 95% bounds. HF denotes guidance; LCP denotes the minimum-length probe. All five planned marginals are retained.
Fixed repetitive prompt
Initial conditional TV (%)
Paris factual sentence
65.8317
Numerical sentence
4.1911
Unusual lexical sentence
3.8606
Short word sequence
45.3831
Appendix
Table S2: Initial committed-prefix conditional-score TVs on the trained checkpoint. The values match across the two pinned versions. Every prompt has 16 spec requests per version, all with eligible witnesses somewhere in the trace. These are four designed initial states, not independent repetitions over seeds.
Arm
Count
Rate
Interval
Ordinary
823
80.3711
[77.2287, 83.2620]
Native lookup
145
14.1602
[11.6540, 16.9638]
History control
833
81.3477
[78.2583, 84.1774]
Appendix
Table S3: Fixed returned-first-token event at one pilot-selected trained-checkpoint prompt, with 1,024 requests per arm. Rates and intervals are percentages. The intervals share one nominal simultaneous 95% construction. The three arms use native CFG with ordinary decoding, native CFG with prompt lookup, and functional prefix-history CFG with prompt lookup.
Prompt
Plain E
Repetition E
Native CFG E/W
Prefix CFG E/W
Native CFG initial TV
P01
2
2
2/2
2/0
0.0224984
P02
2
2
2/2
2/0
0.0347482
P03
2
2
2/2
2/0
0.136422
P04
2
2
2/2
2/0
0.00240589
P05
0
1
0/0
1/0
0
P06
2
2
2/2
2/0
0.380219
Appendix
Table S4: B1D main speculative matrix. Each prompt/arm has two planned and observed requests; the aggregate denominator is 16 per arm. E counts requests with any nonempty native candidate block; W counts requests with a qualifying CFG conditional-history witness. Plain/repetition columns report exposure, with their numerical reference agreements assessed separately. Initial TVs are native CFG first-target values as fractions, identical across the two seeds. Prefix CFG has 13 observed exposures; W=0 holds by definition because actual and intended histories coincide. Its numerical consistency check uses a shared reference implementation and can fail. Ordinary arms contribute the other 64 main requests and have no speculative exposure; their numerical controls pass.
Arm
Event
First
Full
Ordinary
823
1,024
1,024
Native lookup
145
1,024
998
Prefix control
833
1,024
939
Appendix
Table S5: Second-host returned-event reproduction using the original seeds. Each arm has 1,024 requests. First-token (First) and complete-sequence (Full) matches compare the two runs at the same seeds. The counts reproduce the original intervals, without increasing the sampling denominator.
Omitted class
N
CP-set
TV-nearest
HF-Bplus
256
128/0/0
0/114/14
HF-Bplus
2,048
128/0/0
128/0/0
HF-Bplus
16,384
128/0/0
128/0/0
HF-Bminus
256
1/48/79
0/124/4
HF-Bminus
2,048
128/0/0
128/0/0
HF-Bminus
16,384
128/0/0
128/0/0
Appendix
Table S6: Missing generating classes. Each entry gives abstain/null-only/ambiguous counts out of 128 panels. The generating class is absent, so every nonempty set excludes truth; null-only is a missed defect. All 15 missing-class cells are shown.
Generating class
CP-set
TV-nearest
null
46/0/82
121/0/7
HF-Bplus
128/0/0
128/0/0
HF-Bminus
0/0/128
128/0/0
HF-D
128/0/0
128/0/0
HF-Kx
128/0/0
122/6/0
HF-F
122/0/6
122/0/6
Appendix
Table S7: Complete-library controls at N=256 . Entries are correct singleton/abstain/ambiguous-including-truth counts out of 128. No wrong singleton or truth-excluding ambiguous set occurred in these cells. Ambiguity is not a correct single diagnosis; for null controls it includes non-null hypotheses.