Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance
What it is
This paper proposes a lookahead-guided decoding framework for large language models to ensure outputs strictly comply with context-free grammars. It uses offline-computed pushdown automata summaries to guide online beam search, preventing feasible prefixes from failing to reach acceptance due to finite token budgets.
The problem it solves
Existing grammar-constrained decoders often fail to produce complete valid outputs because locally feasible prefixes may not be extendable to acceptance within a finite token budget.
What you could use it for
- Generating syntactically valid JSON structures
- Producing valid SQL queries
- Generating Linear Temporal Logic (LTL) formulas
Read the source ↗Back to the library →
Summary written by an AI model from the source; check the source before you rely on it.