Quail speeds up LLM classification 1.8x with trie-constrained decoding
Shreya Shankar and Charles Frye (Full Data Lab) published a post describing how their AI-SQL execution engine Quail executes AI.CLASSIFY—taking a set of documents and a label list and returning the best-matching label per document (e.g., routing support messages to billing, refund request, shipping delay). Quail is about 1.8x faster than a vLLM baseline.
Confirmed
- Problem: the mainstream approach (BigQuery-style) has the LLM generate labels as free text and then parses them, but token-by-token decoding is memory-bandwidth bound, leaving the GPU mostly idle.
- Key premise: the full label list is known before the query, which is what enables the speedup; classification is one of the most common AI-SQL operations.
- Approach: Quail stores all labels in a trie and constrains decoding to trie paths; it stops as soon as only one candidate label remains instead of generating the full label, and packs those few decoding steps into the prefill of other documents.
- Result: roughly 1.8x faster than the vLLM baseline.
Why it matters
- The work challenges the conventional free-generation-then-parse pipeline, showing that constrained decoding can substantially ease the decoding-phase memory-bandwidth bottleneck when the label set is known in advance, opening a new optimization path for LLM data-processing workloads.
2026-10-13 ~ 2026-10-14 · 5 related posts
Primary sources
- To classify, try a trie: Quail runs LLM classification ~1.8x faster than free-text generation — sh_reya ·
- How Quail classifies with a trie: constrained decoding that beats a vLLM baseline by ~1.8x — sh_reya ·
- To Classify, Try a Trie Tree: Quail's constrained decoding is ~1.8x faster than vLLM — sh_reya ·
- [source] To classify, try a trie: Quail runs LLM classification ~1.8x faster than free-text generation — sh_reya · 2026-10-13
- Why classification is optimizable: labels are known before the query runs — sh_reya · 2026-10-13
- [source] How Quail classifies with a trie: constrained decoding that beats a vLLM baseline by ~1.8x — sh_reya · 2026-10-13
- Trie-based constrained decoding makes LLM document classification 1.8x faster than free-text generation — sh_reya · 2026-10-14
1 near-duplicate retellings: sh_reya