Learning and Enforcing Context-Sensitive Control for LLMs
Not on the map. Why?
Abstract (arXiv)
Controlling the output of Large Language Models (LLMs) through context-sensitive constraints has emerged as a promising approach to overcome the limitations of Context-Free Grammars (CFGs) in guaranteeing generation validity. However, such constraints typically require manual specification -- a significant barrier demanding specialized expertise. We introduce a framework that automatically learns context-sensitive constraints from LLM interactions through a two-phase process: syntactic exploration to gather diverse outputs for constraint learning, followed by constraint exploitation to enforce these learned rules during generation. Experiments demonstrate that our method enables even small LLMs (1B parameters) to learn and generate with perfect constraint adherence, outperforming larger counterparts and state-of-the-art reasoning models. This work represents the first integration of context-sensitive grammar learning with LLM generation, eliminating manual specification while maintaining generation validity.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 8 of its 19 references that are in the map. First posted on arXiv 12 Apr 2026.
Builds on
8 of 19 references.
References · 8
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 402
- 2024Spider 2.0: Evaluating Language Models on Real-World Enterprise Text-to-SQL Workflowscited by 223
- 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 186
- 2024The Effect of Sampling Temperature on Problem Solving in Large Language Modelscited by 168
- 2024From Decoding to Meta-Generation: Inference-time Algorithms for Large Language Modelscited by 136
- 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 99
- 2022BenchCLAMP: A Benchmark for Evaluating Language Models on Syntactic and Semantic Parsingcited by 12
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Neurosymbolic Embodied Agentscited by 0
- 2026Neurosymbolic Embodied Agents17 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2025Large-Scale Constraint Generation -- Can LLMs Parse Hundreds of Constraints?
- 2025CRANE: Reasoning with constrained LLM generation
- 2025SAGE:Specification-Aware Grammar Extraction for Automated Test Case Generation with LLMs
- 2024Benchmarking Large Language Models on Controllable Generation under Diversified Instructions
- 2026Hard Constraints Meet Soft Generation: Guaranteed Feasibility for LLM-based Combinatorial Optimization
- 2025Scaling Instruction-Tuned LLMs to Million-Token Contexts via Hierarchical Synthetic Data Generation
- 2024Adaptable Logical Control for Large Language Models
- 2025Step-by-Step Mastery: Enhancing Soft Constraint Following Ability of Large Language Models