Abstract
Constraining the generation of autoregressive large language models (LLMs) is an important component of integrating language models into formal systems. In the generation of code and data for tasks like program synthesis, ensuring that language models produce syntactically valid output is a prerequisite for processing such output. These languages (such as SQLor JSON) are often designed as LR(k) context-free grammars. By distilling the LLM to a tractable probabilistic model, its autoregressive generation can be steered and masked to incorporate the probability of satisfying logical constraints, ensuring high quality output that is guaranteed to be valid. This paper demonstrates that the satisfaction of any LR(k)grammar of finite duration can be calculated in polynomial time, an improvement over the exponential time of applying previous methods to such grammars. This result enables efficient constraint and steering of LLM generation towards output that better satisfies formal syntactic constraints.
| Original language | English |
|---|---|
| Title of host publication | Proceedings of the 20th Conference on Neurosymbolic Learning and Reasoning |
| Publisher | PMLR |
| Publication status | Accepted/In press - 24 Apr 2026 |
| Event | 20th Conference on Neurosymbolic Learning and Reasoning - Universidade de Lisboa, Lisbon, Portugal Duration: 1 Sept 2026 → 4 Sept 2026 Conference number: 20 https://2026.nesyconf.org/ |
Publication series
| Name | Proceedings of Machine Learning Research |
|---|---|
| Publisher | PMLR |
| Volume | 284 |
| ISSN (Electronic) | 2640-3498 |
Conference
| Conference | 20th Conference on Neurosymbolic Learning and Reasoning |
|---|---|
| Abbreviated title | NeSy 2026 |
| Country/Territory | Portugal |
| City | Lisbon |
| Period | 1/09/26 → 4/09/26 |
| Internet address |
Fingerprint
Dive into the research topics of 'PASTA-G: Tractable grammar control of large language models'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver