Saved in:
Bibliographic Details
Main Authors: Sullivan, Michael, Koller, Alexander
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2605.29986
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914614299590656
author Sullivan, Michael
Koller, Alexander
author_facet Sullivan, Michael
Koller, Alexander
contents To guarantee that an LLM's outputs conform to a specified structure, context-free grammar (CFG) decoding engines force the selection of next tokens that produce strings that conform to a given CFG. While current CFG-constrained decoding engines are highly optimized, the inherent costs arising from the massive per-step search space -- i.e. the entire token vocabulary -- result in intractably high overhead for more complex CFGs: precisely the situation where CFG engines are most useful. In this paper, we introduce CFGzip, an offline technique for compressing the token search space, which massively reduces CFG engine overhead. In experiments, we report latency reduction of up to two orders of magnitude when CFGzip is used with a SoTA grammar engine, yielding an up to 7.5x speedup in total constrained generation time: with CFGzip, constrained decoding is now feasible at scale for complex CFGs.
format Preprint
id arxiv_https___arxiv_org_abs_2605_29986
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Accelerating Constrained Decoding with Token Space Compression
Sullivan, Michael
Koller, Alexander
Artificial Intelligence
To guarantee that an LLM's outputs conform to a specified structure, context-free grammar (CFG) decoding engines force the selection of next tokens that produce strings that conform to a given CFG. While current CFG-constrained decoding engines are highly optimized, the inherent costs arising from the massive per-step search space -- i.e. the entire token vocabulary -- result in intractably high overhead for more complex CFGs: precisely the situation where CFG engines are most useful. In this paper, we introduce CFGzip, an offline technique for compressing the token search space, which massively reduces CFG engine overhead. In experiments, we report latency reduction of up to two orders of magnitude when CFGzip is used with a SoTA grammar engine, yielding an up to 7.5x speedup in total constrained generation time: with CFGzip, constrained decoding is now feasible at scale for complex CFGs.
title Accelerating Constrained Decoding with Token Space Compression
topic Artificial Intelligence
url https://arxiv.org/abs/2605.29986