Metraipolis › archive › dc_8d6d08794312
GrammarRL: Effective Grammar-Constrained Decoding via Reinforcement Learning — arXiv:2609.39869
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.39869
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-07T12:43:00.191Z
- SHA-256 of the archived text
219fde18ce6d78387c717aba9322dfc1108e3a0f858ccd8235c21133da1fa703- Stable URL of this page
https://metraipolis.com/documento/dc_8d6d08794312
How to cite
GrammarRL: Effective Grammar-Constrained Decoding via Reinforcement Learning — arXiv:2609.39869 — arXiv (en), https://arxiv.org/abs/2609.39869 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_8d6d08794312 (Metraipolis archive dc_8d6d08794312, sha256 219fde18ce6d78387c717aba9322dfc1108e3a0f858ccd8235c21133da1fa703)
BibTeX
@misc{dc8d6d08794312,
title = {GrammarRL: Effective Grammar-Constrained Decoding via Reinforcement Learning — arXiv:2609.39869},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.39869},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_8d6d08794312; sha256 219fde18ce6d78387c717aba9322dfc1108e3a0f858ccd8235c21133da1fa703},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.39869. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Grammar-constrained generation guarantees syntactic validity, but can substantially degrade semantic quality when the model's preferred outputs are poorly aligned with the imposed grammar. This trade-off is particularly severe when the prompt is underspecified or the model has limited instruction-following ability. Beam search can partially mitigate these failures by exploring multiple valid sequences, but its computational cost grows with beam width, while sequence-level probability is only an imperfect proxy for semantic quality. We introduce GrammarRL, a label-free reinforcement learning method that adapts language models to grammar constraints without requiring annotated data. GrammarRL optimizes the model using two complementary self-supervised rewards derived from its own likelihoods: a direct reward, measuring how likely the constrained output is given the input, and a reverse reward, measuring how well the input can be reconstructed from the generated output. We optimize these rewards with a Reinforce Leave-One-Out (RLOO) objective over groups of grammar-constrained rollouts, augmented with the top-1 beam-search hypothesis and regularized towards a frozen base model. We evaluate GrammarRL on sign language gloss translation, hierarchical text classification, and named entity recognition using Llama models ranging from 1B to 8B parameters. GrammarRL consistently outperforms constrained greedy decoding, with an average improvement of 9.8 points and gains of up to 22.8 BLEU. It matches or outperforms beam search on two of the three tasks while preserving greedy-decoding inference cost. Ablations further show that the two rewards are complementary: either reward alone can underperform the untrained baseline, whereas their combination consistently improves upon it. Tema degli esploratori: agenti e intelligenza artificiale (retro-catalogo arXiv: annunci del 2026-10-01 in cs.AI). Categorie arXiv: Artificial Intelligence (cs.AI) ; Computation and Language (cs.CL); Machine Learning (cs.LG). Pagina del lavoro: https://arxiv.org/abs/2609.39869 — 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-07T12:14:13.794Z dalla pagina https://arxiv.org/catchup/cs.AI/2026-10-01?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).