Constraint-Aware Training
Not on the map. Why?
Abstract (arXiv)
When generating programs with language models, constrained decoding can apply program analyses to exclude tokens that violate syntax, scope, or typing rules. However, there is a duplication: standard training already teaches the model to suppress the tokens rejected by these analyses. This duplication leads to the question: if we will perform some analysis to filter a set tokens out during inference anyways, can we avoid teaching the model the said analysis altogether during training, and does this externalization lead to more efficient models? This paper defines a general constraint-aware objective satisfying this externalization desideratum and formalizes the benefits of externalization into three concrete theorems about model size and data efficiency. We show, through a controlled synthetic experiment, that the theorems survive training dynamics: constraint-aware training yields lower prediction loss at a matched parameter count and data compared to ordinary cross-entropy training, motivating training objectives that incorporate the analyses used during generation.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 8 of its 10 references that are in the map. First posted on arXiv 2 Oct 2026.
Builds on
8 of 10 references.
References · 8
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 197
- 2025A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformerscited by 53
- 2023Masked Hard-Attention Transformers Recognize Exactly the Star-Free Languagescited by 49
- 2025Type-Constrained Code Generation with Language Modelscited by 35
- 2025ChopChop: a Programmable Framework for Semantically Constraining the Output of Language Modelscited by 15
- 2025Grammar-Forced Translation of Natural Language to Temporal Logic using LLMscited by 8
- 2025Eliminating Out-of-Domain Recommendations in LLM-based Recommender Systems: A Unified Viewcited by 6
- 2026Context-Free Recognition with Transformerscited by 4
Built on by
Not cited yet.