In this article we show how the problem of neural text generation can be
constructively reformulated in terms of transitions between the states of a
finite-state machine. This framework leads to an efficient approach to guiding
text generation with regular expressions and context-free grammars by allowing
the construction of an index over a language model's vocabulary. The approach
is model agnostic, allows one to enforce domain-specific knowledge and
constraints, and enables the construction of reliable interfaces by
guaranteeing the structure of the generated text. It adds little overhead to
the token sequence generation process and significantly outperforms existing
solutions. An implementation is provided in the open source Python library
Outlines
Description
Efficient Guided Generation for Large Language Models
%0 Generic
%1 willard2023efficient
%A Willard, Brandon T.
%A Louf, Rémi
%D 2023
%K artificial_intelligence generative_ai large_language_model translation
%T Efficient Guided Generation for Large Language Models
%U http://arxiv.org/abs/2307.09702
%X In this article we show how the problem of neural text generation can be
constructively reformulated in terms of transitions between the states of a
finite-state machine. This framework leads to an efficient approach to guiding
text generation with regular expressions and context-free grammars by allowing
the construction of an index over a language model's vocabulary. The approach
is model agnostic, allows one to enforce domain-specific knowledge and
constraints, and enables the construction of reliable interfaces by
guaranteeing the structure of the generated text. It adds little overhead to
the token sequence generation process and significantly outperforms existing
solutions. An implementation is provided in the open source Python library
Outlines
@misc{willard2023efficient,
abstract = {In this article we show how the problem of neural text generation can be
constructively reformulated in terms of transitions between the states of a
finite-state machine. This framework leads to an efficient approach to guiding
text generation with regular expressions and context-free grammars by allowing
the construction of an index over a language model's vocabulary. The approach
is model agnostic, allows one to enforce domain-specific knowledge and
constraints, and enables the construction of reliable interfaces by
guaranteeing the structure of the generated text. It adds little overhead to
the token sequence generation process and significantly outperforms existing
solutions. An implementation is provided in the open source Python library
Outlines},
added-at = {2023-08-15T17:55:01.000+0200},
author = {Willard, Brandon T. and Louf, Rémi},
biburl = {https://www.bibsonomy.org/bibtex/2ff08eb7d01b22ee120aabef13b8f182a/lumeng},
description = {Efficient Guided Generation for Large Language Models},
interhash = {f1c3c2a29a18820e70adee389ccbd909},
intrahash = {ff08eb7d01b22ee120aabef13b8f182a},
keywords = {artificial_intelligence generative_ai large_language_model translation},
note = {cite arxiv:2307.09702},
timestamp = {2023-08-15T17:55:01.000+0200},
title = {Efficient Guided Generation for Large Language Models},
url = {http://arxiv.org/abs/2307.09702},
year = 2023
}