Metraipolis › archive › dc_a9c9dcafc9cc
Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance — arXiv:2608.28229
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2608.28229
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-17T10:47:30.552Z
- SHA-256 of the archived text
b0ac034bf0fa6cedf24e69e047f1f2191dec04cacd99ed0d162e803b5027dba7- Stable URL of this page
https://metraipolis.com/documento/dc_a9c9dcafc9cc
How to cite
Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance — arXiv:2608.28229 — arXiv (en), https://arxiv.org/abs/2608.28229 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_a9c9dcafc9cc (Metraipolis archive dc_a9c9dcafc9cc, sha256 b0ac034bf0fa6cedf24e69e047f1f2191dec04cacd99ed0d162e803b5027dba7)
BibTeX
@misc{dca9c9dcafc9cc,
title = {Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance — arXiv:2608.28229},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2608.28229},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_a9c9dcafc9cc; sha256 b0ac034bf0fa6cedf24e69e047f1f2191dec04cacd99ed0d162e803b5027dba7},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2608.28229. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Grammar-constrained decoding helps large language models produce syntactically valid structured outputs, such as code, JSON, and SQL. For context-free grammars, many practical decoders enforce local prefix feasibility: each token must keep the current prefix extendable to some valid completion. Yet, under tokenizer-grammar mismatch and finite token budgets, feasible prefixes may still fail to reach acceptance. We propose a lookahead-guided decoding framework for context-free grammars based on pushdown automata. Offline, we compute bounded pushdown summaries with reachability labels and upper-bound distances to acceptance. Online, these estimates guide horizon-aware pruning and beam search. The resulting decoder is syntactically sound: every output is accepted by the target grammar. Experiments on JSON, SQL, and Linear Temporal Logic (LTL) show both consistent syntactic validity and improved completion quality over existing baselines. Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-08-31 in cs.AI). Categorie arXiv: Artificial Intelligence (cs.AI) ; Computation and Language (cs.CL); Formal Languages and Automata Theory (cs.FL); Machine Learning (cs.LG). Pagina del lavoro: https://arxiv.org/abs/2608.28229 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-17T10:33:42.404Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-08-31?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).