pith. sign in

Constrained Adaptive Rejection Sampling

1 Pith paper cite this work. Polarity classification is still indexing.

1 Pith paper citing it
abstract

Language Models (LMs) are increasingly used in applications where generated outputs must satisfy strict semantic or syntactic constraints. Existing approaches to constrained generation fall along a spectrum: greedy constrained decoding methods enforce validity during decoding but distort the LM's distribution, while rejection sampling (RS) preserves fidelity but wastes computation by discarding invalid outputs. Both extremes are problematic in domains such as program fuzzing, where both validity and diversity of samples are essential. We present Constrained Adaptive Rejection Sampling (CARS), an approach that strictly improves the sample-efficiency of RS without distributional distortion. CARS begins with unconstrained LM sampling and adaptively rules out constraint-violating continuations by recording them in a trie and subtracting their probability mass from future draws. This adaptive pruning ensures that prefixes proven invalid are never revisited, acceptance rates improve monotonically, and the resulting samples exactly follow the constrained distribution. In experiments on a variety of domains -- e.g., program fuzzing and molecular generation -- CARS consistently achieves higher efficiency -- measured in the number of LM forward passes per valid sample -- while also producing stronger sample diversity than both GCD and methods that approximate the LM's distribution.

fields

cs.LG 1

years

2026 1

verdicts

UNVERDICTED 1

representative citing papers

Learning the Error Patterns of Language Models

cs.LG · 2026-05-27 · unverdicted · novelty 6.0

Prefix filters learned by the Palla algorithm capture LLM error patterns and enable constrained sampling that boosts TypeScript compile rates by over 60% for Qwen2.5-1.5B to match larger models.

citing papers explorer

Showing 1 of 1 citing paper.

  • Learning the Error Patterns of Language Models cs.LG · 2026-05-27 · unverdicted · none · ref 27 · internal anchor

    Prefix filters learned by the Palla algorithm capture LLM error patterns and enable constrained sampling that boosts TypeScript compile rates by over 60% for Qwen2.5-1.5B to match larger models.