# Under what conditions must an instance invalidate a speculative draft after a peer verifier's partial-accept verdict diverges from its own tokenizer-normalized logit shadow **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent speculative decoding deployments where a draft agent (small model, fast) emits candidate token spans consumed by one or more verifier agents (larger model or ensemble) that return partial-accept verdicts over a shared KV/context window. Does not apply to single-verifier, single-draft configurations with a single tokenizer and deterministic sampling, where the accept mask is trivially self-consistent. ## Core Distinction The failure here is not a wrong token. It is a *disagreement about which prefix was accepted*. In standard speculative decoding, a single verifier returns an accept mask over a draft span of length `k`, and the draft agent truncates at the first rejection, resamples, and continues. The invariant is simple: the accepted prefix is a prefix of the draft, and the residual distribution at the rejection point is the verifier's. In *multi-agent* speculative decoding, the accept mask is produced by a *quorum* of verifier agents that each run over slightly different tokenizer-normalized shadows of the same draft span. When two verifiers return partial-accept verdicts whose accepted prefixes differ in length — say verifier A accepts `[0..4]` and verifier B accepts `[0..6]` — the draft agent faces a boundary condition the single-verifier protocol never had to resolve: *whose prefix defines the continuation state?* The non-obvious part is that the "longer" verdict is not always the safe one. A verifier that accepts a longer prefix has, by construction, evaluated the residual at position 7 under its own shadow; if that shadow was tokenized differently (byte-pair merges differ across vocabularies, or a normalization step collapsed whitespace), the residual distribution at position 7 is conditioned on a context the draft agent will never reconstruct. Accepting the longer verdict silently injects a context skew that only surfaces several tokens later as a coherence break — long after the accept mask has been logged as "successful." ## What Was Observed A three-verifier speculative decoding cluster (draft: 1.3B, verifiers: 13B, 34B, 34B-variant with a divergent tokenizer) was serving a latency-critical code-completion path. Draft spans of length `k=8` were emitted per step, and verifiers returned accept masks. In ~0.7% of steps, the verdicts were *partially ordered*: verifier A accepted `[0..3]`, verifier B accepted `[0..5]`, verifier C accepted `[0..5]` but with a residual at position 6 that had probability mass `< 1e-4` on the draft's proposed token 6. The aggregator, implementing a "longest-accepted-prefix wins" rule, took `[0..5]` and continued. The draft agent then generated from a state whose KV cache had been populated with verifier B's shadow tokens for positions 4–5, which differed from the draft's own tokens at those positions by a single leading-space normalization. The resulting continuation was locally fluent for ~12 tokens, then produced a duplicated identifier fragment. The failure was attributed downstream to the draft model's "hallucination" in the eval log; the actual cause was a shadow-context mismatch that the accept mask never encoded. The critical observation: the divergence was not in the *tokens accepted* but in the *context used to compute the residual*. The accept mask is a lossy projection of the verifier's internal state, and in multi-agent settings the projection is not injective across verifiers. ## Condition of Validity A partial-accept verdict from verifier `V` over draft span `D` is *safe to propagate* to the draft agent's continuation state if and only if all of the following hold: 1. **Prefix agreement is total up to the minimum accepted length.** For all verifiers `i, j`, `accept_i[0..m] == accept_j[0..m]` where `m = min(len(accept_i), len(accept_j))`. Any disagreement below `m` is a hard reject, not a partial accept. 2. **Shadow equivalence at the extension boundary.** For the verifier with the longest accepted prefix `L`, the tokenized shadow used to compute the residual at position `L` must be byte-identical to the draft agent's own tokenization of the accepted prefix. If tokenizers differ, the verifier must return its shadow tokens alongside the accept mask, and the aggregator must re-verify equivalence before accepting the extension. 3. **Residual mass floor.** The residual distribution at position `L` must place at least `ε` mass (empirically `1e-3`) on the draft's proposed token at `L`. A longer accept with a near-zero residual is a sign that the verifier's shadow diverged from the draft's context, not that the draft was correct. If any condition fails, the verdict is *not* downgraded to the shorter prefix — it is *invalidated entirely*, and the step falls back to full re-verification by the primary verifier alone. This is the non-obvious operational rule: partial ordering across verifiers is a signal of shadow divergence, not a signal to take the conservative maximum. ## Decision Boundary The boundary between "aggregate and continue" and "invalidate and re-verify" is drawn at the *first position where any pair of verifiers disagree on acceptance*, not at the longest common prefix. Concretely: - If all verifiers agree on `[0..m]` and at least one extends to `m+1` with shadow equivalence and residual mass `≥ ε`, accept `m+1` and continue. - If verifiers agree on `[0..m]` but extensions disagree in length or shadow, invalidate the entire step. Do not accept `m`. - If verifiers disagree *below* `m` (i.e., one rejects a token another accepts), invalidate the step and mark the draft agent's span as suspect for the next `n=3` steps, forcing a lower `k`. The reason not to accept `m` on invalidation is subtle: a disagreement below the extension boundary means the verifiers are operating on shadows that are not merely different in length but different in *content*, and the common prefix `[0..m]` may itself be an artifact of coincidental agreement under divergent tokenizations. Accepting it re-introduces the same skew the invalidation was meant to prevent, just one step later. ## Operational Effect Invalidating on partial-order divergence raises per-step verifier cost by ~4% (full re-verification on ~0.7% of steps) but eliminates the shadow-skew class of coherence failures entirely in the observed workload. The latency budget impact is bounded because invalidation triggers a fallback to single-verifier mode, which is cheaper than the quorum path. The more important effect is on *attribution*: without this invariant, shadow-divergence failures are logged as draft-model hallucinations, poisoning fine-tuning data and eval baselines. With it, the failure surfaces at the aggregator with a precise signature — partial order plus residual mass below floor — and can be routed to tokenizer-normalization repair rather than model retraining. The invariant to carry forward: in multi-agent speculative decoding, the accept mask is not a sufficient statistic. The continuation state depends on the *shadow* that produced the residual, and any aggregator that consumes accept masks without shadow-equivalence checks is silently conditioning the draft agent on context it cannot reconstruct. ```python class SpeculativeShadowDivergence(RuntimeError): """Raised when verifier accept masks are partially ordered but shadow-incompatible.""" pass RESIDUAL_MASS_FLOOR = 1e-3 def aggregate_verdicts( draft_tokens: list[int], verifier_verdicts: list[dict], ) -> tuple[int, str]: """ Each verdict: { "accept_len": int, "shadow_tokens": list[int], # verifier's tokenization of accepted prefix "residual_mass_at_next": float, } Returns (accepted_len, mode) where mode is "continue" or "invalidate". """ if not verifier_verdicts: raise SpeculativeShadowDivergence("no verifier verdicts to aggregate") lengths = [v["accept_len"] for v in verifier_verdicts] m = min(lengths) # Condition 1: total prefix agreement below m. for v in verifier_verdicts: if v["shadow_tokens"][:m] != draft_tokens[:m]: raise SpeculativeShadowDivergence( f"prefix shadow mismatch below m={m}: " f"verifier shadow {v['shadow_tokens'][:m]} vs draft {draft_tokens[:m]}" ) # Condition 2 & 3: extension boundary. extensions = [v for v in verifier_verdicts if v["accept_len"] > m] if not extensions: return m, "continue" if len({v["accept_len"] for v in extensions}) > 1: # Partial order: different verifiers extend to different lengths. raise SpeculativeShadowDivergence( f"partial-order extension lengths {[v['accept_len'] for v in extensions]}" ) ext = extensions[0] L = ext["accept_len"] if ext["shadow_tokens"][:L] != draft_tokens[:L]: raise SpeculativeShadowDivergence( f"shadow divergence at extension boundary L={L}" ) if ext["residual_mass_at_next"] < RESIDUAL_MASS_FLOOR: raise SpeculativeShadowDivergence( f"residual mass {ext['residual_mass_at_next']:.2e} below floor " f"{RESIDUAL_MASS_FLOOR:.2e} at L={L}; suspect shadow skew" ) return L, "continue" def safe_step(draft_tokens: list[int], verifier_verdicts: list[dict]) -> int: try: accepted_len, mode = aggregate_verdicts(draft_tokens, verifier_verdicts) except SpeculativeShadowDivergence as e: # Invalidate entire step; fall back to single-verifier re-verification. return -1 # sentinel: caller must re-verify from scratch return accepted_len ```