arXiv:2504.20039cs.CLcs.LG2025-04NeurIPS被引 10

让大模型推理更快:自动识别关键词,跳过无关计算

AutoJudge: Judge Decoding Without Manual Annotation

  • 用半贪婪搜索找出影响答案质量的关键生成词
  • 在GSM8k上快2倍,准确率仅降1%;编程任务中每轮跳过超25词
  • 无需人工标注,可直接接入现有推理框架

我们提出AutoJudge,一种通过任务特定的有损推测解码加速大语言模型(LLM)推理的方法。不同于逐字匹配原始模型输出分布,该方法识别哪些生成词影响下游响应质量,放松分布匹配要求,使“不重要”的词可快速生成。其核心是半贪婪搜索算法,用于判断目标模型与草稿模型之间的差异哪些需修正、哪些可跳过。随后,基于现有LLM嵌入训练一个轻量级分类器,在推理时预测哪些不一致词可安全接受而不损害最终答案质量。我们在数学推理和编程基准上测试了多种草稿/目标模型对,取得显著加速效果,且精度损失极小。例如,在使用Llama 3.1 70B作为目标模型的GSM8k任务中,相比传统推测解码提速约2倍,准确率下降不超过1%。在LiveCodeBench基准上,AutoJudge能自动识别编程相关的关键词,每轮推测接受≥25个词,Pass@1下降2%。该方法无需人工标注,易于集成至现代LLM推理框架。

原文摘要 · Abstract (English)

We introduce AutoJudge, a method that accelerates large language model (LLM) inference with task-specific lossy speculative decoding. Instead of matching the original model output distribution token-by-token, we identify which of the generated tokens affect the downstream quality of the response, relaxing the distribution match guarantee so that the "unimportant" tokens can be generated faster. Our approach relies on a semi-greedy search algorithm to test which of the mismatches between target and draft models should be corrected to preserve quality and which ones may be skipped. We then train a lightweight classifier based on existing LLM embeddings to predict, at inference time, which mismatching tokens can be safely accepted without compromising the final answer quality. We evaluate the effectiveness of AutoJudge with multiple draft/target model pairs on mathematical reasoning and programming benchmarks, achieving significant speedups at the cost of a minor accuracy reduction. Notably, on GSM8k with the Llama 3.1 70B target model, our approach achieves up to $\approx2\times$ speedup over speculative decoding at the cost of $\le 1\%$ drop in accuracy. When applied to the LiveCodeBench benchmark, AutoJudge automatically detects programming-specific important tokens, accepting $\ge 25$ tokens per speculation cycle at $2\%$ drop in Pass@1. Our approach requires no human annotation and is easy to integrate with modern LLM inference frameworks.

推理加速推测解码无监督评估大模型优化

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