Papers
Topics
Authors
Recent
Search
2000 character limit reached

Future-Validity Function in Speculative Decoding

Updated 5 July 2026
  • Future-Validity Function is a prefix-dependent statistic that estimates the probability a token sequence can be completed to form a fully grammatical sentence.
  • It reweights locally valid tokens using a Doob transform, thereby correcting standard masking pipelines to match the intended grammar-conditional law.
  • Approximate methods such as OneStep and MC rollout mitigate the #P-hardness of exact computation, ensuring practical decoding with explicit total-variation bounds.

The future-validity function is the prefix-dependent statistic that corrects grammar-constrained generation from “currently valid” tokens to the intended distribution conditioned on eventual grammatical completion. In the formulation of grammar-faithful speculative decoding, it is defined for a base autoregressive LLM pp, a prefix-checkable grammar C\mathcal C, and a candidate next token yy after prefix x<tx_{<t} as

Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].

The central claim is that standard serving pipelines combining local vocabulary masking with speculative decoding omit exactly this statistic, and therefore sample from the locally projected law μproj\mu^{\mathrm{proj}} rather than the intended grammar-conditional law μ\mu^\star. With exact Φ\Phi, the target distribution becomes a Doob transform of the base model; with approximate Φ\Phi, one obtains explicit total-variation guarantees; and for general context-free grammars, exact computation is #P\#P-hard, so practical use depends on estimator hierarchies and tractable grammar families (Nie et al., 8 May 2026).

1. Formal definition and probabilistic setting

The setup assumes an autoregressive base LLM C\mathcal C0 over a finite vocabulary C\mathcal C1, with per-step conditional

C\mathcal C2

together with a prefix-checkable constraint or grammar C\mathcal C3, and valid-next-token sets

C\mathcal C4

Within this setup, the future-validity function is

C\mathcal C5

The shorthand C\mathcal C6 suppresses the conditioning on the committed prefix, but the paper emphasizes that the quantity is really prefix-dependent. A “valid completion” means completion into a full terminal string in C\mathcal C7, including EOS as needed (Nie et al., 8 May 2026).

This definition makes C\mathcal C8 a survival probability under the base model C\mathcal C9: after appending yy0, one samples the suffix from yy1, and yy2 is the probability that the resulting full sequence remains in the grammar language. In principle this depends on the full committed history through yy3; if the language-model state is not Markov-compressible into grammar state, then grammar state alone is not sufficient. Operationally, for finite languages and regularized settings, the paper computes the grammar side from token tries or automaton states, while the model side still depends on prefix-conditioned probabilities (Nie et al., 8 May 2026).

2. From local masking to the grammar-conditional law

The paper distinguishes sharply between the deployed one-step masking law and the intended full-sequence conditional law. Local masking retains only yy4 and renormalizes: yy5 The intended target, however, is the base-model sequence law restricted to the language and renormalized: yy6 These are different objects: yy7 is the product of masked-and-renormalized one-step conditionals, whereas yy8 is the original sequence distribution conditioned on eventual grammaticality (Nie et al., 8 May 2026).

The future-validity function is the missing correction statistic because the exact per-step grammar-conditional kernel is

yy9

Relative to local masking, each locally valid token is reweighted by its probability of surviving to a full valid completion. Local masking is recovered by the degenerate approximation x<tx_{<t}0, i.e. by pretending that every locally valid token has identical future validity. The paper gives the exact condition under which this omission is harmless: x<tx_{<t}1 This identifies non-uniformity of x<tx_{<t}2 over x<tx_{<t}3 as the sole source of distortion (Nie et al., 8 May 2026).

The same point appears in the KL identity. If

x<tx_{<t}4

then

x<tx_{<t}5

Thus the divergence caused by ignoring future validity is controlled exactly by how non-uniform x<tx_{<t}6 is across the locally valid token set (Nie et al., 8 May 2026).

3. Doob transform, Bellman recursion, and survival semantics

The paper characterizes x<tx_{<t}7 as a Doob x<tx_{<t}8-transform of the base model with x<tx_{<t}9. This gives a precise probabilistic interpretation: future validity is not an auxiliary heuristic, but the harmonic function that converts the unconstrained next-token kernel into the sequence law conditioned on eventual membership in Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].0 (Nie et al., 8 May 2026).

The appendix gives the recursive identity

Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].1

which is a Bellman or backward recursion. Future validity at the current decision equals the model-weighted sum of future validity at the next decision over valid next tokens. This makes the quantity directly analogous to inside or backward completion probabilities in constrained language modeling and parsing, a connection stated explicitly in the paper (Nie et al., 8 May 2026).

The same appendix shows why shallow lookahead is biased. For the “true one-step estimator,”

Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].2

and therefore

Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].3

One-step lookahead therefore overestimates true future validity by the expected future invalidity after the next step. This clarifies why local admissibility is insufficient: a token can be locally legal yet lead almost surely to future dead ends (Nie et al., 8 May 2026).

4. Speculative decoding, LMS impossibility, and oracle correction

A central negative result is that speculative decoding does not repair the mismatch between Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].4 and Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].5. The paper defines the LMS class by three axioms: B1 Local Mask, B2 Leviathan Rejection, and B3 Rollback Soundness. Under these assumptions, every decoder in LMS has per-step sampling kernel Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].6, hence marginal law Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].7. The corollary is an impossibility statement: whenever Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].8, no LMS method samples Φt(yx<t)=Przp ⁣[x<tyzt+1:TL(C)].\Phi_t(y\mid x_{<t})=\Pr_{z\sim p}\!\big[x_{<t}yz_{t+1:T}\in \mathcal{L}(\mathcal{C})\big].9 (Nie et al., 8 May 2026).

The appendix makes this explicit using masked verifier and draft distributions

μproj\mu^{\mathrm{proj}}0

together with the standard Leviathan accept/reject kernel: draw μproj\mu^{\mathrm{proj}}1, accept with probability

μproj\mu^{\mathrm{proj}}2

and on rejection resample from μproj\mu^{\mathrm{proj}}3. Because Leviathan rejection samples exactly from μproj\mu^{\mathrm{proj}}4, and μproj\mu^{\mathrm{proj}}5, speculative decoding faithfully preserves the wrong law when only local masks are visible (Nie et al., 8 May 2026).

The positive result is the oracle decoder FVO-Spec. Its modification is conceptually minimal: keep the speculative-decoding machinery, but replace the masked verifier target by the μproj\mu^{\mathrm{proj}}6-reweighted target μproj\mu^{\mathrm{proj}}7. With exact μproj\mu^{\mathrm{proj}}8, the resulting speculative decoder samples exactly from μproj\mu^{\mathrm{proj}}9 at every step. In pseudocode terms: compute μ\mu^\star0, compute corrected weights μ\mu^\star1 for μ\mu^\star2, normalize to obtain μ\mu^\star3, and run the usual speculative accept/reject step against this corrected target rather than μ\mu^\star4 (Nie et al., 8 May 2026).

5. Approximation, hardness, tractable regimes, and empirical behavior

Exact computation of μ\mu^\star5 is generally difficult. The paper proves that computing μ\mu^\star6 exactly is μ\mu^\star7-hard for general context-free grammars, even under a unigram base LLM. This motivates an estimator hierarchy. Uniform uses μ\mu^\star8, exactly recovering μ\mu^\star9. OneStep uses

Φ\Phi0

reusing Φ\Phi1 as a proxy for Φ\Phi2, with no extra neural forwards and Φ\Phi3 trie operations. MC rollout estimates

Φ\Phi4

with Hoeffding and union-bound guarantees but cost Φ\Phi5 target forwards. Exact methods use dynamic programming or enumeration on tractable subclasses: bounded Dyck grammars, finite languages via token tries, and regular languages via automaton-state backward recursion (Nie et al., 8 May 2026).

Approximate Φ\Phi6 leads to an explicit perturbed target

Φ\Phi7

If

Φ\Phi8

then

Φ\Phi9

The appendix also gives a telescoping sequence-level bound and a multiplicative certificate

Φ\Phi0

when Φ\Phi1 uniformly on positive-mass candidates. The paper emphasizes that additive guarantees become hard when Φ\Phi2 is small, precisely the recursive-grammar regime where future validity matters most (Nie et al., 8 May 2026).

Empirically, the distortion is often dominant rather than marginal. For Qwen3-8B on Dyck Φ\Phi3, the paper reports

Φ\Phi4

and in a bounded-Dyck analytic confirmation on the same 988-string support,

Φ\Phi5

In the Dyck estimator hierarchy, Uniform, OneStep-Cheap, and Exact achieve TV Φ\Phi6 to Φ\Phi7; thus OneStep reduces Dyck TV by Φ\Phi8 with under Φ\Phi9 throughput overhead, and exact dynamic programming reduces it by #P\#P0. The speed model reports AR baseline #P\#P1 tok/s, SD with no #P\#P2 #P\#P3 tok/s, SD + OneStep-Cheap #P\#P4 tok/s, and SD + exact DP #P\#P5 tok/s. On Dyck, local projection also overproduces deeper and longer strings, with mean nesting depth #P\#P6 versus #P\#P7 under #P\#P8, and mean length #P\#P9 versus C\mathcal C00 (Nie et al., 8 May 2026).

For finite canonical JSON under Qwen3-8B, exact-token-trie experiments report

C\mathcal C01

across schemas with 3 to 2000 valid strings, while exact C\mathcal C02-correction reduces the residual to numerical zero,

C\mathcal C03

In one 3-string status schema, C\mathcal C04 gives C\mathcal C05 mass to "error", local projection emits it C\mathcal C06 of the time, and exact C\mathcal C07 brings it to C\mathcal C08 in the verifier-path pilot. The online finite-trie FVO-Spec loop samples within TV C\mathcal C09 of C\mathcal C10 on the 24-string schema and mean TV C\mathcal C11 across five finite schemas, with mean acceptance C\mathcal C12. In a production-like DFlash finite-trie pilot, exact C\mathcal C13 reduces mean terminal TV on schemas A–D from C\mathcal C14 to C\mathcal C15, a C\mathcal C16 pooled reduction, while throughput changes from C\mathcal C17 tok/s to C\mathcal C18 tok/s (Nie et al., 8 May 2026).

The paper is explicit about scope. Its strongest fidelity claims are limited to enumerable grammars and token tries, where C\mathcal C19 and C\mathcal C20 can be computed exactly. Exact C\mathcal C21 is tractable for finite languages, regular languages, and bounded-depth or bounded-length grammars small enough for dynamic programming, but not for arbitrary open grammars such as general CFG-style JSON with arbitrary nesting or free-text fields (Nie et al., 8 May 2026).

6. Relation to other “future validity” notions

The phrase “future validity” appears elsewhere in arXiv literature, but it refers to different objects. In conformal prediction for future insurance claims, the closest analogue is the conformal plausibility function

C\mathcal C22

which calibrates whether a candidate future claim value is retained in a prediction set, with finite-sample guarantee

C\mathcal C23

under exchangeability (Hong, 5 Mar 2025). In consonant conformal prediction and related inferential-model work, the central object is a plausibility contour C\mathcal C24 satisfying

C\mathcal C25

or, more generally, an IM validity property of the form

C\mathcal C26

for assertions C\mathcal C27 (Cella et al., 2020, Cella et al., 2021, Martin, 2021).

By contrast, the future-validity function in grammar-faithful speculative decoding is not a coverage-calibration device for future observations. It is a base-model completion probability: C\mathcal C28 used to transform one-step local admissibility into the correct law conditioned on eventual grammaticality. The paper explicitly relates this C\mathcal C29 to expected futures in Grammar-Aligned Decoding, to a Doob harmonic function, and to inside or backward completion probabilities in constrained language modeling and parsing (Nie et al., 8 May 2026). This suggests that the shared vocabulary of “future validity” spans two quite different traditions: one centered on calibration of uncertainty about future observations, the other on model-based survival mass over future constrained completions.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Future-Validity Function.