arXiv:2609.05707cs.CL2026-09

让多个问题共享上下文,用单个提示并行生成答案,提速7倍。

Intra-Prompt Parallel Decoding for Common-Context Question Answering

论文配图:Intra-Prompt Parallel Decoding for Common-Context Question Answering
图 1 · 摘自论文原文
  • 将多个问题整合到一个提示中,用虚拟位置和注意力掩码并行解码。
  • 实验显示有效吞吐量提升最高达7倍,且答案质量无下降。
  • 无需微调或改模型结构,适合需要高效推理的场景。

在公共上下文问答任务中,多个问题共享同一上下文。传统大模型逐个独立生成答案,虽有批处理和缓存优化,但因各问题分属不同提示,导致现代GPU受注意力计算内存瓶颈制约,难以充分并行。本文提出一种新推理方法——提示内并行解码(IPPD),将多个共上下文问题合并至单个提示中,在一次推理步骤内并行解码所有问题的答案。IPPD通过虚拟位置ID与注意力掩码调控,实现与标准提示相同的输出,无需微调或修改模型架构。由于所有并行操作均在单一提示内完成,IPPD可无缝兼容批处理推理,即使每个提示对应不同上下文亦可适用。实验表明,相较于标准解码,IPPD实现最高7倍的有效吞吐量提升;在多数场景下优于使用PagedAttention的前缀缓存方法。

原文摘要 · Abstract (English)

In common-context question answering (CCQA) tasks, multiple input questions share a common context to base their answers from. However, Large Language Models typically generate each answer using an independent prompt. While existing batching and caching techniques help improve parallelism and reduce repeated computations, the separation of questions across prompts limits the achievable speedup, as modern GPUs are underutilized due to a memory bottleneck during attention. We present Intra-Prompt Parallel Decoding (IPPD), a novel inference method that answers multiple common-context questions in parallel within a single prompt. IPPD directly addresses the bottleneck by efficiently sharing both memory and computation during the attention process, as the next token for every question is decoded in a single inference step. IPPD uses virtual position IDs and attention mask manipulation to generate the same output as standard prompting without requiring fine-tuning or any changes to the LLM architecture. Since all parallelism occurs within a prompt, IPPD is fully compatible with batched inference, even when each prompt features a different context. Our experiments show that IPPD delivers up to 7X the effective throughput as standard decoding without quality degradation, and outperforms prefix caching with PagedAttention in most settings.

推理加速并行解码大模型

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