arXiv:2508.08895cs.CLcs.AI2025-08被引 8

让大模型自动识别并并行生成可并行段落,提速超3倍且不降质。

ASPD: Unlocking Adaptive Serial-Parallel Decoding by Exploring Intrinsic Parallelism in LLMs

  • 从自回归输出中挖掘内在并行结构,自动构建可并行分支。
  • 在Vicuna Bench上平均提速1.85倍,最高达3.19倍,质量损失<1%。
  • 支持串行与并行无缝切换,保持缓存复用,适合高延迟敏感场景。

大规模语言模型(LLMs)的推理延迟问题日益严重,主要源于其自回归解码的顺序生成特性。我们重新审视自回归模型的输出,发现部分文本片段具有可并行的结构,称为内在并行性。对这些可并行分支进行同时解码(即并行解码)能显著提升整体推理速度。本文提出自适应串行-并行解码框架(ASPD),解决两大核心挑战:自动化构建可并行数据与高效并行解码机制。具体而言,我们设计了一种非侵入式流水线,自动提取并验证自回归模型输出中的可并行结构。为实现高效的自适应串行-并行解码,我们构建了混合解码引擎,可在串行与并行模式间无缝切换,并保持可重用的KV缓存,最大化计算效率。在通用任务、检索增强生成、数学推理等任务上的广泛评估表明,ASPD在效果与效率上均达到前所未有的水平。尤其在Vicuna Bench上,方法最高实现3.19倍加速(平均1.85倍),响应质量与自回归模型相比差异小于1%,实现了显著提速而不牺牲生成质量。该框架为高效的大模型并行推理树立了新标杆,推动其在人工智能客服机器人、答案检索引擎等低延迟应用场景中的部署。

原文摘要 · Abstract (English)

The increasing scale and complexity of large language models (LLMs) pose significant inference latency challenges, primarily due to their autoregressive decoding paradigm characterized by the sequential nature of next-token prediction. By re-examining the outputs of autoregressive models, we observed that some segments exhibit parallelizable structures, which we term intrinsic parallelism. Decoding each parallelizable branch simultaneously (i.e. parallel decoding) can significantly improve the overall inference speed of LLMs. In this paper, we propose an Adaptive Serial-Parallel Decoding (ASPD), which addresses two core challenges: automated construction of parallelizable data and efficient parallel decoding mechanism. More specifically, we introduce a non-invasive pipeline that automatically extracts and validates parallelizable structures from the responses of autoregressive models. To empower efficient adaptive serial-parallel decoding, we implement a Hybrid Decoding Engine which enables seamless transitions between serial and parallel decoding modes while maintaining a reusable KV cache, maximizing computational efficiency. Extensive evaluations across General Tasks, Retrieval-Augmented Generation, Mathematical Reasoning, demonstrate that ASPD achieves unprecedented performance in both effectiveness and efficiency. Notably, on Vicuna Bench, our method achieves up to 3.19x speedup (1.85x on average) while maintaining response quality within 1% difference compared to autoregressive models, realizing significant acceleration without compromising generation quality. Our framework sets a groundbreaking benchmark for efficient LLM parallel inference, paving the way for its deployment in latency-sensitive applications such as AI-powered customer service bots and answer retrieval engines.

大模型推理并行解码加速技术

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