Papers
Topics
Authors
Recent
Search
2000 character limit reached

Future Validity is the Missing Statistic: From Impossibility to $Φ$-Estimation for Grammar-Faithful Speculative Decoding

Published 8 May 2026 in cs.LG and cs.IT | (2605.07698v1)

Abstract: Grammar-constrained generation is often combined with local vocabulary masking and speculative decoding, but the resulting sampling law is not the grammar-conditional distribution users usually intend. We show that any speculative decoder with local mask access, Leviathan rejection, and rollback soundness samples from the locally projected distribution $μ{\mathrm{proj}}$ rather than the grammar-conditional distribution $μ\star$. This extends the GAD impossibility result to speculative decoding; on Dyck grammars with Qwen3-8B, the total-variation gap can reach 0.996. We identify the future-validity function $Φ_t(y)=\Pr_p[\mathrm{valid\ completion}\mid y]$ as the missing correction statistic. The target distribution is a Doob transform of the base model with $h=Φ$, while local masking corresponds to setting $h$ to one. With exact $Φ$, our oracle decoder FVO-Spec samples exactly from $μ\star$; with approximate $Φ$, we bound the resulting total-variation error. Because exact future validity is hard for general context-free grammars, we evaluate estimator hierarchies on tractable Dyck and finite JSON languages. OneStep reduces Dyck TV by 14% with under 1% throughput overhead, exact dynamic programming reduces it by 97%, and finite-language correction closes JSON gaps to numerical precision. All fidelity claims are scoped to enumerable grammars and token tries.

Summary

  • The paper introduces the future validity function (Φₜ) as the key statistic for correcting biases in grammar-constrained LLM decoding.
  • It demonstrates that local masking leads to a projected distribution that diverges significantly from the true grammar-conditional distribution, with high total variation gaps.
  • It proposes a hierarchy of Φ estimators (Uniform, OneStep, Monte Carlo, Exact DP) to balance computational cost and decoding fidelity.

Summary of "Future Validity is the Missing Statistic: From Impossibility to ΦΦ-Estimation for Grammar-Faithful Speculative Decoding"

Problem Formulation and Distributional Gap

The paper rigorously analyzes grammar-constrained generation in LLMs with local vocabulary masking and speculative decoding, widely deployed for structured outputs (e.g., code, JSON, SQL). The standard pipeline combines grammar-constrained masking with lossless acceleration mechanisms such as Leviathan-style speculative decoding. The authors prove that this approach samples from a locally projected distribution (μproj\mu^{proj})—the product of masked-and-renormalized per-step conditionals—not the true grammar-conditional distribution (μ\mu^\star), which is the full-sequence distribution renormalized on the grammar's valid language.

Empirical results demonstrate that this discrepancy is profound in nontrivial grammars. On Dyck languages D3,16D_{3,16} (balanced parentheses, max depth 3, length 16) using Qwen3-8B, the total variation distance between μproj\mu^{proj} and μ\mu^\star reaches $0.996$, indicating nearly maximal divergence. Finite canonical JSON languages exhibit gaps ranging from $0.17$ to $0.68$. Thus, outputs may be grammatically valid but distributionally misaligned—an issue for probabilistic reasoning and applications requiring uncertainty calibration. Figure 1

Figure 1: The future validity gap and its correction. Local masking samples μproj\mu^{proj}, which diverges from μproj\mu^{proj}0 whenever future validity μproj\mu^{proj}1 varies across valid tokens; μproj\mu^{proj}2 reweighting recovers μproj\mu^{proj}3 exactly. On Dyck μproj\mu^{proj}4, Uniform/OneStep/Exact reach TV μproj\mu^{proj}5 to μproj\mu^{proj}6.

LMS Characterization and GAD Extension

The authors formalize the LMS class—speculative decoders with local mask access, Leviathan rejection, and rollback soundness. They derive that such systems are forced to sample μproj\mu^{proj}7, extending the Grammar-Aligned Decoding (GAD) impossibility result to deployment pipelines. The LMS diagnostic is validated empirically across 33 grammar–model settings, confirming exact empirical-match between observed sampling and theoretical μproj\mu^{proj}8—the observed bias is not due to sampling fluctuations.

Future Validity as Sufficient Statistic

A central contribution is identifying the future validity function μproj\mu^{proj}9, defined as the probability under the base model μ\mu^\star0 that a given prefix extended by token μ\mu^\star1 can be completed to a grammar-valid sequence. The paper shows the true conditional μ\mu^\star2 is a Doob μ\mu^\star3-transform of μ\mu^\star4 with μ\mu^\star5, where local masking corresponds to μ\mu^\star6. The gap between locally projected and grammar-conditional distributions is entirely governed by the non-uniformity of μ\mu^\star7 across the valid token set.

When μ\mu^\star8 is constant over valid tokens, local masking is exact and safe; otherwise, the bias can be substantial. The authors introduce an oracle decoder (FVO-Spec) performing rejection against the μ\mu^\star9-reweighted target, which samples from D3,16D_{3,16}0 exactly.

D3,16D_{3,16}1 Estimation Hierarchy: Cost–Fidelity Pareto

Exact computation of D3,16D_{3,16}2 is shown to be D3,16D_{3,16}3-hard for general CFGs. Therefore, the authors introduce a hierarchy of estimators spanning the cost–fidelity Pareto frontier:

  • Uniform (D3,16D_{3,16}4): recovers D3,16D_{3,16}5, zero computational cost—baseline.
  • OneStep: one-step lookahead using materialized logits and trie queries, amortized D3,16D_{3,16}6 overhead; reduces TV by D3,16D_{3,16}7 on Dyck D3,16D_{3,16}8.
  • Monte Carlo (MC): adjustable rollout with sample complexity guarantees; provides significant improvement in fidelity at higher computational cost.
  • Exact DP: viable for finite or regular grammars, achieves D3,16D_{3,16}9 TV reduction; infeasible for CFGs of arbitrary complexity.

Empirical results quantify these improvements: on Dyck μproj\mu^{proj}0, Uniform/OneStep/Exact achieve TV gaps of μproj\mu^{proj}1, respectively.

Structural Bias and Distributional Consequences

The distortion is not only quantitative. Local projection overproduces deep and long strings in structured outputs; for Dyck, mean nesting depth under μproj\mu^{proj}2 is μproj\mu^{proj}3 vs μproj\mu^{proj}4 for μproj\mu^{proj}5, and mean length μproj\mu^{proj}6 vs μproj\mu^{proj}7. Figure 2

Figure 2: Maximum nesting depth distribution on Dyck μproj\mu^{proj}8. Local masking (μproj\mu^{proj}9, mean depth 1.72) diverges from the true conditional (μ\mu^\star0, mean depth 1.09); μ\mu^\star1-correction recovers the true distribution.

These structural diagnostics highlight why local masking is tolerable for permissive grammars but introduces strong bias in recursive or concentrated grammars—an issue for downstream applications relying on sequence statistics.

Speed–Fidelity Tradeoff

The speed–fidelity Pareto analysis shows that correction via the OneStep estimator adds negligible runtime overhead (μ\mu^\star20.5ms/position), preserving throughput on typical servers. MC estimation trades speed for improved fidelity. Where exact μ\mu^\star3 is available (finite or regular languages), correction can be offline and achieves optimal fidelity without runtime slowdown. Figure 3

Figure 3: Speed–fidelity Pareto frontier (cost-model estimate) on Dyck μ\mu^\star4. OneStep achieves 14\% TV reduction with near-baseline SD throughput.

Real-Model Validation

Extensive experiments with Qwen3-8B validate that local masking introduces substantial bias in real-model settings (finite JSON supports spanning 3–2,000 strings). Exact token-trie μ\mu^\star5 correction closes TV gaps to numerical zero. Production-like pilots with DFlash+xgrammar show that integrating μ\mu^\star6 estimation maintains high throughput and recovers intended distributional guarantees.

Theoretical Analysis and Fidelity Bounds

The paper provides sharp theoretical bounds on total variation resulting from μ\mu^\star7 approximation error. In recursive grammars with low μ\mu^\star8, only highly accurate estimators provide meaningful guarantees—a rigorous justification for estimator hierarchy development. A rigorous analysis connects the gap to Doob μ\mu^\star9-transforms, establishing the correction as structurally optimal. Figure 4

Figure 4: Empirical TV vs.\ theoretical bound $0.996$0 across grammar families and estimator tiers; bounds are tightest for permissive grammars and vacuous when $0.996$1 is small.

Implications and Future Directions

Practical Implications

The results demonstrate that current production pipelines (local masking spec-decoding) systematically misrepresent LLM beliefs about structured outputs. Where calibrated uncertainty and distributional guarantees are critical (probabilistic program synthesis, database queries, reasoning chains), correction with future validity estimation is essential.

The estimator hierarchy provides actionable diagnostics for distributed systems engineering: where finite or regular grammars are used, exact correction is feasible and costless at runtime; otherwise, low-cost approximations such as OneStep can provide meaningful fidelity improvement for certain grammar classes.

Theoretical Implications and Future Research

The identification of future validity ($0.996$2) as the missing statistic rigorously grounds grammar-faithful decoding in probability theory (Doob h-transform), setting a foundation for further research into amortized estimator design, deep grammar integration, and task-specific correction strategies. Addressing the computational hardness for general CFGs remains open; learned or specialized estimators offer a promising direction, especially for finite-trie grammars.

Concurrently, the analysis exposes potential distributional failure modes in text generation systems, clarifying the limitations of local masking and suggesting corrective integration paths for speculative decoding stacks.

Conclusion

This paper provides a comprehensive theoretical and empirical framework for diagnosing and correcting distributional bias in grammar-constrained speculative decoding, rigorously extending GAD impossibility to deployed LLM systems. The future validity function $0.996$3 is identified as the sufficient statistic for exact grammar-faithful generation, underpinned by the Doob h-transform formalism. Empirical evidence demonstrates strong TV gaps between locally projected and grammar-conditional distributions on both toy and real LMs, with estimator hierarchies offering practical routes to fidelity improvement at modest computational cost and strong guarantees where offline enumeration is viable. The implications span structured inference, uncertainty quantification, and agentic LLM design, motivating further research into scalable future validity estimation and integration into production serving frameworks.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

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

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 2 likes about this paper.