Adaptable Logical Control for Large Language Models
Honghua Zhang, Po-Nien Kung, Masahiro Yoshida, Guy Van den Broeck,, Nanyun Peng

TL;DR
This paper introduces Ctrl-G, a flexible framework that combines LLMs with automata to enforce logical constraints, improving task performance and controllability in language generation.
Contribution
It presents Ctrl-G, a novel method integrating Hidden Markov Models with LLMs for logical control, outperforming existing models on constrained text generation tasks.
Findings
Ctrl-G outperforms GPT4 in human satisfaction for text editing tasks.
Ctrl-G surpasses baseline models on standard constrained generation benchmarks.
Proof-of-concept shows Ctrl-G's potential in aiding LLM reasoning on math benchmarks.
Abstract
Despite the success of Large Language Models (LLMs) on various tasks following human instructions, controlling model generation at inference time poses a persistent challenge. In this paper, we introduce Ctrl-G, an adaptable framework that facilitates tractable and flexible control of LLM generation to reliably follow logical constraints. Ctrl-G combines any production-ready LLM with a Hidden Markov Model, enabling LLM outputs to adhere to logical constraints represented as deterministic finite automata. We show that Ctrl-G, when applied to a TULU2-7B model, outperforms GPT3.5 and GPT4 on the task of interactive text editing: specifically, for the task of generating text insertions/continuations following logical constraints, Ctrl-G achieves over 30% higher satisfaction rate in human evaluation compared to GPT4. When applied to medium-size language models (e.g., GPT2-large), Ctrl-G also…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsTopic Modeling · Semantic Web and Ontologies · Natural Language Processing Techniques
