arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.03305cs.CLcs.AIcs.LG
收藏

结构生成在大语言模型中的隐性成本:草案条件约束解码

The Hidden Cost of Structured Generation in LLMs: Draft-Conditioned Constrained Decoding

Avinash Reddy, Thayne T. Walker, James S. Ide, Amrit Singh Bedi

AI总结:

本文提出DCCD方法,通过分步解码提升结构生成的准确性与效率,实验显示在结构推理基准中,DCCD在严格结构准确性上提升了24个百分点,且在参数效率上优于传统约束解码。

摘要:

大型语言模型(LLMs)越来越多地用于生成可执行输出、JSON对象和API调用,其中单个语法错误会使输出不可用。约束解码通过掩码和重归一化强制逐个令牌的有效性,但当模型对有效延续分配低概率质量时,会推导出局部有效但语义错误的轨迹。我们提出草案条件约束解码(DCCD),一种简单的两步、无训练的推理过程,将语义规划与结构强制解耦:首先生成无约束的草案,然后应用约束解码,条件于此草案以保证有效性。我们通过KL投影观点分析DCCD,显示草案条件增加可行质量并减少硬约束引起的累积“投影税”,可选最佳的K草案选择。在结构推理基准中,DCCD在严格结构准确性上比标准约束解码提高多达24个百分点(例如,1B模型在GSM8K上从15.2%提升至39.0%),并使较小模型对匹配或超越更大约束基线,产生显著的参数效率提升。

英文摘要:

Large language models (LLMs) are increasingly used to generate executable outputs, JSON objects, and API calls, where a single syntax error can make the output unusable. Constrained decoding enforces validity token-by-token via masking and renormalization, but it can distort generation when the model assigns low probability mass to valid continuations, pushing decoding toward locally valid yet semantically incorrect trajectories. We propose \emph{Draft-Conditioned Constrained Decoding (DCCD)}, a simple two-step, training-free inference procedure that decouples semantic planning from structural enforcement: an unconstrained draft is generated first, and constrained decoding is then applied, conditioned on this draft, to guarantee validity. We analyze DCCD through a KL-projection view, showing that draft conditioning increases feasible mass and reduces the cumulative "projection tax" induced by hard constraints, with an optional best-of-$K$ draft selection. Across structured reasoning benchmarks, DCCD improves strict structured accuracy by up to +24 percentage points over standard constrained decoding (e.g., 15.2\% to 39.0\% on GSM8K with a 1B model), and enables smaller model pairs to match or exceed much larger constrained baselines, yielding substantial gains in parameter efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑