Syntactic Control of Language Models by Posterior Inference
Not on the map. Why?
Abstract (arXiv)
Controlling the syntactic structure of text generated by language models is valuable for applications requiring clarity, stylistic consistency, or interpretability, yet it remains a challenging task. In this paper, we argue that sampling algorithms based on the posterior inference can effectively enforce a target constituency structure during generation. Our approach combines sequential Monte Carlo, which estimates the posterior distribution by sampling from a proposal distribution, with a syntactic tagger that ensures that each generated token aligns with the desired syntactic structure. Our experiments with GPT2 and Llama3-8B models show that with an appropriate proposal distribution, we can improve syntactic accuracy, increasing the F1 score from 12.31 (GPT2-large) and 35.33 (Llama3-8B) to about 93 in both cases without compromising the language model's fluency. These results underscore both the complexity of syntactic control and the effectiveness of sampling algorithms, offering a promising approach for applications where precise control over syntax is essential.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 17 of its 40 references that are in the map. First posted on arXiv 8 Jun 2025.
Builds on
17 of 40 references.
References · 17
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Expertscited by 441
- 2021PICARD: Parsing Incrementally for Constrained Auto-Regressive Decoding from Language Modelscited by 411
- 2020GeDi: Generative Discriminator Guided Sequence Generationcited by 378
- 2021FUDGE: Controlled Text Generation With Future Discriminatorscited by 376
- 2016Assessing the Ability of LSTMs to Learn Syntax-Sensitive Dependenciescited by 354
- 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 337
- 2018Constituency Parsing with a Self-Attentive Encodercited by 199
- 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 163
- 2019Neural Language Models as Psycholinguistic Subjects: Representations of Syntactic Statecited by 138
- 2018Multilingual Constituency Parsing with Self-Attention and Pre-Trainingcited by 117
- 2023Sequential Monte Carlo Steering of Large Language Models using Probabilistic Programscited by 80
5 more
- 2023Evaluating Large Language Models on Controlled Generation Taskscited by 73
- 2024SynCode: LLM Generation with Grammar Augmentationcited by 69
- 2019Controllable Paraphrase Generation with a Syntactic Exemplarcited by 44
- 2018Constituent Parsing as Sequence Labelingcited by 26
- 2019Tetra-Tagging: Word-Synchronous Parsing with Linear-Time Inferencecited by 17
Built on by
Citing papers per year: 2026: 3.
3 papers.