Skip to content
aiqbench takeAI Research

aiqbench analysis

This research addresses the computational bottleneck in constrained language generation by leveraging recent advances in approximating #NFA counting problems. The proposed NFA-LM engine offers a polynomial-time solution that maintains theoretical guarantees on approximation error while avoiding the distribution distortion common in existing methods. This work represents a significant step forward in making hard-constrained text generation both efficient and mathematically rigorous for language models.
Source coveringarXiv
What this isA model's reading of the article and related coverage, written for aiqbench. Not the publisher's words.

Provably Tractable NFA-Constrained Language Generation via HMMs

arXiv1 min read

arXiv:2609.40185v1 Announce Type: new Abstract: Constrained generation aims to sample from language models (LMs) conditioned on hard constraints. Existing constrained-generation techniques for nondeterministic finite automaton (NFA) constraints either distort the distribution or sacrifice efficiency. Theoretically, this task reduces to counting the length-$n$ sequences accepted by an NFA (#NFA), and the exact #NFA problem is #P-complete. Recent work has shown that #NFA admits a fully polynomial randomized approximation scheme (FPRAS). Inspired by this result, we propose NFA-LM, a polynomial-time engine for NFA-constrained generation with theoretical guarantees under mild assumptions. Experiments show that NFA-LM efficiently generates high-quality outputs with theoretically bounded approximation error.

Abstract:Constrained generation aims to sample from language models (LMs) conditioned on hard constraints. Existing constrained-generation techniques for nondeterministic finite automaton (NFA) constraints either distort the distribution or sacrifice efficiency. Theoretically, this task reduces to counting the length-$n$ sequences accepted by an NFA (#NFA), and the exact #NFA problem is #P-complete. Recent work has shown that #NFA admits a fully polynomial randomized approximation scheme (FPRAS). Inspired by this result, we propose NFA-LM, a polynomial-time engine for NFA-constrained generation with theoretical guarantees under mild assumptions. Experiments show that NFA-LM efficiently generates high-quality outputs with theoretically bounded approximation error.

Computation and Language (cs.CL); Formal Languages and Automata Theory (cs.FL)

arXiv:2609.40185 [cs.CL]

(or arXiv:2609.40185v1 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2609.40185 Focus to learn more arXiv-issued DOI via DataCite (pending registration)

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Full text under the publisher's open licence · 197 words

Related coverage