arXiv:2611.04042cs.SENov 2026

Manuscript Offprint

arXiv:2611.04042

Testing Processor Contracts in Speculative Decoding Engines

Tianyu Ding, Yaocheng Tong, Muzhi Yang, Lei Yang, Fei Jiang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

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.

1 INTRODUCTION

Speculative sampling preserves the target distribution under algorithmic assumptions (Leviathan et al., 2023; Chen et al., 2023), including use of the processed target distribution at each verification position's logical prefix (Section 3). Logits processors modify token scores to enforce constraints or apply guidance. Even when the model logits are correct, a speculative implementation can give these processors the wrong inputs: a processor may read unverified draft tokens, or retain state from calls that sequential decoding would not make. We test this processor-prefix contract, together with stopping rules and probability records, in fixed engine builds.

Equal token support, frequency ordering and greedy outputs do not establish equal sampling distributions (Zhang et al., 2026; Li et al., 2026; Liu et al., 2026b). Reinforcement-learning (RL) rollout systems rely on distribution preservation (Iso et al., 2026; Xu et al., 2026; Kim et al., 2026; Hu et al., 2026; DeepSeek-AI, 2026). We test the engine boundary without a trainer–engine run or measured RL consequences.

BADC (branch-aware differential conformance testing) compares returned-output distributions with speculation enabled and disabled for deterministic drafters, including prompt

lookup (Fig. 1). On tiny random models, enumeration supplies a sequential reference for calibration, processor-contract checks, probability records and source-derived mechanism hypotheses. Fresh repaired-engine samples then bound remaining differences on events fixed before confirmation. The reference depends on adapters and floating-point evaluation; compatibility with a mechanism hypothesis does not uniquely identify the mechanism.

The preregistered study tests 26 configurations on 5 fixed Transformers (Wolf et al., 2020) and llama-cpp-python (Betlen, 2026) builds (Sections 4.4, 5). RQ1–RQ4 cover calibration, mechanisms, controlled comparisons and transfer to historical vLLM defects (Kwon et al., 2023; vLLM, 2025a).

Our contributions are:

  • A processor-prefix contract and conditional composition result, together with executable mechanism tests and simultaneous bounds for predefined output events (Sections 3–4).

  • Evidence that draft exposure and retained processor state can change sampling distributions, with two source-linked, intervention-confirmed causes. Held-out tiny-model tests and bounded trained-checkpoint guidance studies examine transfer (Sections 6.1–6.2).

  • Controlled comparisons showing no cause-recovery advantage from directed selection, plus unchanged-

¹Independent Researcher. Correspondence to: Tianyu Ding tid16@pitt.edu.

Preprint.

Figure

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).

rule detection on public historical vLLM families (Sections 6.3–6.4).

References (37)