<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Constrained Decoding | Kanghee Park</title><link>https://ebmoon.github.io/tags/constrained-decoding/</link><atom:link href="https://ebmoon.github.io/tags/constrained-decoding/index.xml" rel="self" type="application/rss+xml"/><description>Constrained Decoding</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Mon, 01 Dec 2025 00:00:00 +0000</lastBuildDate><image><url>https://ebmoon.github.io/media/icon_hu_4bc81f2edf496b34.png</url><title>Constrained Decoding</title><link>https://ebmoon.github.io/tags/constrained-decoding/</link></image><item><title>Constrained Sampling for Language Models Should Be Easy: An MCMC Perspective</title><link>https://ebmoon.github.io/publication/constrained-sampling-mcmc/</link><pubDate>Mon, 01 Dec 2025 00:00:00 +0000</pubDate><guid>https://ebmoon.github.io/publication/constrained-sampling-mcmc/</guid><description>&lt;p&gt;This paper studies constrained sampling for language models from an MCMC perspective. The goal is to generate outputs that satisfy hard constraints while preserving the language model&amp;rsquo;s conditional distribution, instead of only forcing validity through local token masks.&lt;/p&gt;
&lt;p&gt;The work frames constrained generation as a sampling problem over valid outputs. It constructs proposal distributions that stay inside the constrained space and uses a Metropolis-Hastings acceptance rule based on the language model likelihood. This gives a principled way to explore valid outputs while converging toward the desired conditional distribution.&lt;/p&gt;
&lt;p&gt;The paper evaluates the approach on synthetic benchmarks and program fuzzing tasks, where both validity and diversity matter. It appeared at NeurIPS 2025.&lt;/p&gt;</description></item><item><title>Flexible and Efficient Grammar-Constrained Decoding</title><link>https://ebmoon.github.io/publication/flexible-efficient-grammar-constrained-decoding/</link><pubDate>Tue, 01 Jul 2025 00:00:00 +0000</pubDate><guid>https://ebmoon.github.io/publication/flexible-efficient-grammar-constrained-decoding/</guid><description>&lt;p&gt;This paper focuses on the practical cost of grammar-constrained decoding. Grammar-constrained decoding can guarantee that generated outputs follow a context-free grammar, but efficient implementations must reconcile two different token systems: the grammar&amp;rsquo;s terminals and the language model&amp;rsquo;s subword tokenizer.&lt;/p&gt;
&lt;p&gt;The work introduces a more flexible and efficient algorithm for computing the token masks needed during decoding. The main improvement is in offline preprocessing, making it faster to prepare common grammars while preserving efficient online mask computation during generation.&lt;/p&gt;
&lt;p&gt;This is useful for structured generation tasks such as code, data formats, and other domains where syntax errors are unacceptable. The work appeared at ICML 2025.&lt;/p&gt;</description></item><item><title>Grammar-Aligned Decoding</title><link>https://ebmoon.github.io/publication/conference-paper/</link><pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate><guid>https://ebmoon.github.io/publication/conference-paper/</guid><description>&lt;p&gt;Some existing works constrain possible next tokens to ensure grammaticality of generated output. But validity alone is not enough: a decoding algorithm should also preserve the language model&amp;rsquo;s distribution after conditioning on the constraint.&lt;/p&gt;
&lt;p&gt;For example, suppose I want the output to always be one of the following numbers:
{00000, 10000, 10001, 10010, 10011, 10100, 10101, 10111, 11001, 11010, 11011, 11100, 11101, 11111}
If the original LLM gives each possible length-5 binary string equal probability, the desired constrained distribution should be uniform over the valid strings above. A locally constrained decoder, however, may choose 0 or 1 with equal probability at the first step and then force completion after choosing 0, causing 00000 to appear far too often.&lt;/p&gt;
&lt;p&gt;Grammar-aligned decoding formalizes this mismatch. Given a constraint G, we want to sample according to the original LLM probability conditioned on satisfying G, not according to a distribution induced by greedy token masking.&lt;/p&gt;
&lt;p&gt;The paper proposes ASAp, a decoding algorithm that uses prior samples to approximate the future grammaticality of prefixes. ASAp guarantees grammatical outputs while aligning samples with the model&amp;rsquo;s conditional distribution, and the evaluation studies structured NLP and code-generation tasks.&lt;/p&gt;</description></item></channel></rss>