通过大规模实验,发现提示压缩在特定条件下可显著加速大模型推理。
Prompt Compression in the Wild: Measuring Latency, Rate Adherence, and Quality for Faster LLM Inference
- 系统评估提示压缩的延迟与质量平衡,分离预处理与解码耗时
- 最佳情况下端到端速度提升18%,且问答、代码生成等任务质量不变
- 提供开源工具预测加速临界点,指导实际部署选择
随着大语言模型在信息检索(特别是RAG系统)中的广泛应用,长上下文导致的提示过长已成为推理延迟的主要瓶颈。提示压缩通过减少输入长度,在保持下游任务性能的前提下实现低延迟加速。然而其有效性取决于预处理时间是否被解码加速所抵消。本文首次开展大规模系统性研究,覆盖数千次运行和3万条查询,涉及多个开源LLM及三种GPU型号。评估分离了压缩开销与解码延迟,同时跟踪输出质量与内存占用。结果表明:当提示长度、压缩比与硬件能力匹配时,LLMLingua可实现最高18%的端到端加速,且摘要、代码生成与问答任务的质量无统计差异。若超出最优配置,压缩步骤反而成为瓶颈。此外,有效压缩可降低内存需求,使数据中心负载迁移至消费级显卡,仅增加0.3秒延迟。本文开源的性能分析器可预测各模型-硬件组合的延迟盈亏平衡点,为实际应用提供可操作建议。
原文摘要 · Abstract (English)
With the wide adoption of language models for IR -- and specifically RAG systems -- the latency of the underlying LLM becomes a crucial bottleneck, since the long contexts of retrieved passages lead large prompts and therefore, compute increase. Prompt compression, which reduces the size of input prompts while aiming to preserve performance on downstream tasks, has established itself as a cost-effective and low-latency method for accelerating inference in large language models. However, its usefulness depends on whether the additional preprocessing time during generation is offset by faster decoding. We present the first systematic, large-scale study of this trade-off, with thousands of runs and 30,000 queries across several open-source LLMs and three GPU classes. Our evaluation separates compression overhead from decoding latency while tracking output quality and memory usage. LLMLingua achieves up to 18% end-to-end speed-ups, when prompt length, compression ratio, and hardware capacity are well matched, with response quality remaining statistically unchanged across summarization, code generation, and question answering tasks. Outside this operating window, however, the compression step dominates and cancels out the gains. We also show that effective compression can reduce memory usage enough to offload workloads from data center GPUs to commodity cards, with only a 0.3s increase in latency. Our open-source profiler predicts the latency break-even point for each model-hardware setup, providing practical guidance on when prompt compression delivers real-world benefits.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。