cs.LGMay 8, 2026

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

Authors: Wenhua Nie, Zijie Meng, Kun Zou, Zheng Lin, Ziwei Li, Haoran Zheng, Jyh-Shing Roger Jang, Hao Zhang

Organizations: National Taiwan University

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 μprojμ^{\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[valid completion∣y]Φ_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=Φh=Φ, while local masking corresponds to setting hh 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.

Explore similar work

CardsList
  1. Grammar-Aligned Decoding

    May 31, 2024Kanghee Park, Jiayu Wang, Taylor Berg-Kirkpatrick +2Large Language Model GenerationCode Generation