Tractable Hierarchical Control of Autoregressive Language Models

Max Scribner, Antonio Vergari, Vaishak Belle
6/1/2026
cs.AI

No confident code implementation found for this paper.

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.

Show full abstract

These languages (such as SQL or 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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{scribner2026tractable,
  title  = {Tractable Hierarchical Control of Autoregressive Language Models},
  author = {Max Scribner and Antonio Vergari and Vaishak Belle},
  year   = {2026},
  eprint = {2607.20483},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.20483v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.20483.svg)](https://codeofpaper.com/paper/2607.20483)

Discussion