Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Efficient Guided Generation for Large Language Models

About

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

Brandon T. Willard, R\'emi Louf• 2023

Related benchmarks

TaskDatasetResultRank
JSON generationJSON-mode-eval e=1.1
Syntax Accuracy36
32
Structured JSON GenerationJSON Generation dataset
Structural Accuracy99.8
9
Constrained DecodingLogicBench
Constraint Satisfaction97.1
7
Showing 3 of 3 rows

Other info

Follow for update