Metraipolis › archive › dc_5266a09c1520
Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validation — arXiv:2609.35425
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.35425
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-07T21:03:36.434Z
- SHA-256 of the archived text
3b163e72ad8cf0d31bd6b9bd452e38ec7e28cf68e8a84f8e58d5ed9c79d31312- Stable URL of this page
https://metraipolis.com/documento/dc_5266a09c1520
How to cite
Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validation — arXiv:2609.35425 — arXiv (en), https://arxiv.org/abs/2609.35425 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_5266a09c1520 (Metraipolis archive dc_5266a09c1520, sha256 3b163e72ad8cf0d31bd6b9bd452e38ec7e28cf68e8a84f8e58d5ed9c79d31312)
BibTeX
@misc{dc5266a09c1520,
title = {Semantic Prefix Oracles for LLM Decoding: Contracts and Differential Validation — arXiv:2609.35425},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.35425},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_5266a09c1520; sha256 3b163e72ad8cf0d31bd6b9bd452e38ec7e28cf68e8a84f8e58d5ed9c79d31312},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.35425. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Constrained decoding can enforce regular or context-free output formats, but many program-generation failures are semantic: scope, typing, and declaration effects depend on context. We present semantic grammar specifications, a declarative formalism that attaches such constraints to a context-free surface and executes them during Earley descent. Our implementation enforces \emph{safe pruning}: it rejects only prefixes whose semantic contradictions cannot be repaired by any continuation. A separate, grammar-dependent, \emph{dead-end freedom} property guarantees the existence of a realizable witness for each remaining branch. We give simple sufficient conditions based on surface productivity, type coverage, and left-to-right constraint flow. Our finite-lambda, core ML, and C-like fragments satisfy them, while the STLC instance used in our experiments does not: plain STLC can violate type coverage, and we show how restricting its type universe recovers it. A tokenizer-lifting lemma carries character-level witnesses to token sequences under an explicit vocabulary-coverage hypothesis. We validate the implementation differentially against production compilers (\texttt{ocamlc}, \texttt{cc}). Across every prefix of 65 compiler-valid programs we observe zero false prunes. The semantic oracle localizes 25/30 invalid programs mid-stream, against 0/30 for a syntax-only oracle, and agrees on 42/42 recursion probes. A twelve-model generation study, including a matched semantic-versus-syntactic ablation for nine models, finds nonnegative observed semantic-minus-syntactic point estimates for every model-language pair, with maxima of $+15.2$ points on STLC task correctness and $+14.3$ points on ML validity.
Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-09-29 in cs.AI).
Categorie arXiv: Programming Languages (cs.PL) ; Artificial Intelligence (cs.AI); Computation and Language (cs.CL).
Pagina del lavoro: https://arxiv.org/abs/2609.35425 — 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-07T20:29:03.353Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-09-29?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).