arXiv:2412.10418cs.CLcs.AI2024-12NAACL被引 9

用小模型预判大模型生成,提速近12倍且不丢约束性能。

Constrained Decoding with Speculative Lookaheads

  • 小模型预生成候选,大模型+奖励函数验证,减少计算开销。
  • 在三类大模型上实现2.2至12.15倍加速,约束满足率几乎不变。
  • 适合需要快速生成又必须符合规则的场景,如内容审核、代码生成。

约束解码带前瞻启发(CDLH)是一种高效对齐大语言模型输出与人类偏好的方法,但因每个词元需大量前瞻推演,实际应用中效率极低。而贪婪解码虽快,却难以满足约束。本文提出约束解码带推测前瞻(CDSL),通过借鉴推测解码思想——用小型草稿模型生成候选,由大型目标模型与特定任务奖励函数联合验证。该方法显著降低计算负担,在三个大模型家族的两类约束解码任务中实现2.2倍至12.15倍速度提升,同时保持接近原始性能,大幅改善了实用性。

原文摘要 · Abstract (English)

Constrained decoding with lookahead heuristics (CDLH) is a highly effective method for aligning LLM generations to human preferences. However, the extensive lookahead roll-out operations for each generated token makes CDLH prohibitively expensive, resulting in low adoption in practice. In contrast, common decoding strategies such as greedy decoding are extremely efficient, but achieve very low constraint satisfaction. We propose constrained decoding with speculative lookaheads (CDSL), a technique that significantly improves upon the inference efficiency of CDLH without experiencing the drastic performance reduction seen with greedy decoding. CDSL is motivated by the recently proposed idea of speculative decoding that uses a much smaller draft LLM for generation and a larger target LLM for verification. In CDSL, the draft model is used to generate lookaheads which is verified by a combination of target LLM and task-specific reward functions. This process accelerates decoding by reducing the computational burden while maintaining strong performance. We evaluate CDSL in two constraint decoding tasks with three LLM families and achieve 2.2x to 12.15x speedup over CDLH without significant performance reduction.

约束解码推理加速推测生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。