Pith. sign in

REVIEW 3 cited by

Fast Controlled Generation from Language Models with Adaptive Weighted Rejection Sampling

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2504.05410 v2 pith:O67PA22G submitted 2025-04-07 cs.CL cs.AIcs.LG

classification cs.CLcs.AIcs.LG
keywords constraintsamplingtokensalgorithmapproachmodelsruntimeadaptive
verification ladder T0 review T1 audit T2 compute T3 formal

Signed reviews

No signed human review yet.

0 comments
abstract

The dominant approach to generating from language models subject to some constraint is locally constrained decoding (LCD), incrementally sampling tokens at each time step such that the constraint is never violated. Typically, this is achieved through token masking: looping over the vocabulary and excluding non-conforming tokens. There are two important problems with this approach. (i) Evaluating the constraint on every token can be prohibitively expensive -- LM vocabularies often exceed $100,000$ tokens. (ii) LCD can distort the global distribution over strings, sampling tokens based only on local information, even if they lead down dead-end paths. This work introduces a new algorithm that addresses both these problems. First, to avoid evaluating a constraint on the full vocabulary at each step of generation, we propose an adaptive rejection sampling algorithm that typically requires orders of magnitude fewer constraint evaluations. Second, we show how this algorithm can be extended to produce low-variance, unbiased estimates of importance weights at a very small additional cost -- estimates that can be soundly used within previously proposed sequential Monte Carlo algorithms to correct for the myopic behavior of local constraint enforcement. Through extensive empirical evaluation in text-to-SQL, molecular synthesis, goal inference, pattern matching, and JSON domains, we show that our approach is superior to state-of-the-art baselines, supporting a broader class of constraints and improving both runtime and performance. Additional theoretical and empirical analyses show that our method's runtime efficiency is driven by its dynamic use of computation, scaling with the divergence between the unconstrained and constrained LM, and as a consequence, runtime improvements are greater for better models.

Discussion (0). Continue with ORCID to comment.

Forward citations

Cited by 3 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score. Full citation record

  1. Stateful CARS: Exact Cross-History Reuse for Policy-Constrained LLM Agents

    cs.LG 2026-08 accept novelty 7.0 of 10

    Stateful CARS exactly samples LLM-agent trajectories conditioned on a hard stateful validator by applying sound state-continuation schemas across histories, with correctness proved and verified but no matched speed ad...

  2. The Format Tax

    cs.CL 2026-04 conditional novelty 6.0 of 10

    Structured-output instructions alone impose a large accuracy tax on open-weight LLMs; decoupling freeform reasoning from formatting recovers most of it, while recent closed models largely avoid the tax.

  3. Constrained Adaptive Rejection Sampling

    cs.AI 2025-10 conditional novelty 6.0 of 10

    CARS is an exact constrained-sampling algorithm that prunes all constraint-violating token continuations encountered along sampled paths, monotonically raising acceptance rate while preserving the target conditional d...

Pith tools