arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.06839cs.CLcs.LG
收藏

LongLLMLingua:通过提示压缩加速并优化长上下文场景下的大语言模型

LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression

Microsoft Corporation(微软公司)

Huiqiang Jiang, Qianhui Wu, Xufang Luo, Dongsheng Li, Chin-Yew Lin, Yuqing Yang, Lili Qiu

AI总结:

针对长上下文场景下大语言模型计算成本高、性能下降、存在位置偏差的问题,提出提示压缩方法LongLLMLingua,可同时提升性能、降低成本与延迟。

摘要:

在长上下文场景中,大语言模型(LLM)面临三大核心挑战:计算成本更高、性能下降以及位置偏差。研究表明,LLM的性能取决于输入提示中关键信息的密度和位置。受这些发现启发,我们提出了用于提示压缩的LongLLMLingua,旨在提升LLM对关键信息的感知能力,从而同时解决上述三大挑战。我们在多种长上下文场景中开展了广泛评估,结果显示LongLLMLingua不仅能提升性能,还能显著降低成本与延迟。例如,在NaturalQuestions基准测试中,LongLLMLingua将GPT-3.5-Turbo的提示token数减少约4倍的同时,性能提升最高达21.4%,实现了可观的成本节约。它在LooGLE基准测试中实现了94.0%的成本降低。此外,在以2倍-6倍的压缩比压缩约10k token的提示时,LongLLMLingua可将端到端延迟加速1.4倍-2.6倍。我们的代码可在https://aka.ms/LongLLMLingua获取。

英文摘要:

In long context scenarios, large language models (LLMs) face three main challenges: higher computational cost, performance reduction, and position bias. Research indicates that LLM performance hinges on the density and position of key information in the input prompt. Inspired by these findings, we propose LongLLMLingua for prompt compression towards improving LLMs' perception of the key information to simultaneously address the three challenges. Our extensive evaluation across various long context scenarios demonstrates that LongLLMLingua not only enhances performance but also significantly reduces costs and latency. For instance, in the NaturalQuestions benchmark, LongLLMLingua boosts performance by up to 21.4% with around 4x fewer tokens in GPT-3.5-Turbo, leading to substantial cost savings. It achieves a 94.0% cost reduction in the LooGLE benchmark. Moreover, when compressing prompts of about 10k tokens at ratios of 2x-6x, LongLLMLingua can accelerate end-to-end latency by 1.4x-2.6x. Our code is available at https://aka.ms/LongLLMLingua.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑