atlas

Research map / Large language models / Language, safety and interpretability

Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generation

ICML 2024 · Large language models › Language, safety and interpretability · approach: Parallel and early-exit decoding · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces DOMINO, a constrained decoding algorithm that enforces CFG/regex constraints with subword-aligned, minimally invasive masking using precomputed subterminal trees, opportunistic masking, and count-based speculative decoding.

Problem

Constrained decoding for LLMs often misaligns sub-word tokens with grammar terminals, which distorts the output distribution, hurts task accuracy, and adds inference overhead.

Approach

Precompute vocabulary-aligned subterminal prefix trees for each scanner state, prune them at inference with a parser to get token masks (allowing bridge tokens), and speed up decoding with a count-based speculative predictor conditioned on scanner and parser state.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use DOMINO (k=∞) instead of unconstrained generationMistral 7B · GSM8Kaccuracy: 0.415 -> 0.418Helped
Use DOMINO (k=∞) instead of unconstrained generationLlama-2 13B · GSM8Kaccuracy: 0.262 -> 0.262No clear effect
Use DOMINO (k=∞) instead of unconstrained generationMistral 7B · CoNLL2003accuracy: 0.21 -> 0.21No clear effect
Use DOMINO (k=∞) instead of unconstrained generationLlama-2 13B · CoNLL2003accuracy: 0.09 -> 0.09No clear effect
Use standard template-based Guidance instead of unconstrained generationMistral 7B · GSM8Kaccuracy: 0.415 -> 0.345Hurt
Use standard template-based Guidance instead of unconstrained generationMistral 7B · CoNLL2003accuracy: 0.21 -> 0.098Hurt
Allow flexible whitespace in Guidance programsGuidance on GSM8K · GSM8Kaccuracy: 0.345 -> 0.403Helped
Allow flexible whitespace in Guidance programsGuidance on CoNLL2003 · CoNLL2003accuracy: 0.098 -> 0.19Helped
Use lookahead k=0 instead of k=∞ (ablation)DOMINO on GSM8K · GSM8Kaccuracy: 0.418 -> 0.308; 0.157 -> 0.0Hurt
Use lookahead k=1 instead of k=∞ (ablation)DOMINO on GSM8K · GSM8Kaccuracy: 0.418 -> 0.1; 0.157 -> 0.036Hurt

Surprising findings

Limitations

Experimental setup

Datasets: GSM8K CoNLL-2003

Benchmarks: GSM8K CoNLL-2003

Metrics: task accuracy well-formed rate perplexity throughput relative to unconstrained

Baselines: guidance guidance WS llama.cpp grammars unconstrained generation

Builds on: Synchromesh Outlines llama.cpp grammar-constrained decoding speculative sampling token healing

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy