Accelerating Constrained Decoding with Token Space Compression

Michael Sullivan, Alexander Koller
5/28/2026
cs.AI

No confident code implementation found for this paper.

Abstract

To guarantee that an LLM's outputs conform to a specified structure, context-free grammar (CFG) decoding engines force the selection of next tokens to produce strings that conform to a given CFG. Current CFG-constrained decoding engines are highly optimized, but still suffer from the inherent costs arising from their massive per-step search space---i.e. the entire token vocabulary.

Show full abstract

This results in intractably high overhead for more complex CFGs, which is 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 75x during batched inference, cutting overhead down to ~1.2-2x on the hardest grammars: with CFGzip, constrained decoding is now possible at scale for complex CFGs

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{sullivan2026accelerating,
  title  = {Accelerating Constrained Decoding with Token Space Compression},
  author = {Michael Sullivan and Alexander Koller},
  year   = {2026},
  eprint = {2605.29986},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.29986v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.29986.svg)](https://codeofpaper.com/paper/2605.29986)

Discussion