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

LLMLingua:压缩提示以加速大型语言模型推理

LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models

Microsoft Corporation(微软公司)

Huiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang, Lili Qiu

AI总结:

本文提出由粗到细的提示压缩方法LLMLingua,通过预算控制、token级迭代压缩和指令微调分布对齐,实现最高20倍压缩且几乎不损失性能。

摘要:

大型语言模型(LLM)凭借其惊人能力已被应用于多种场景。随着思维链(CoT)提示和上下文学习(ICL)等技术的发展,输入LLM的提示变得越来越长,甚至超过数万个token。为加速模型推理并降低成本,本文提出LLMLingua,这是一种由粗到细的提示压缩方法,包含用于在高压缩率下保持语义完整性的预算控制器、用于更好地建模压缩内容之间相互依赖关系的token级迭代压缩算法,以及一种基于指令微调的语言模型间分布对齐方法。我们在来自不同场景的四个数据集(即GSM8K、BBH、ShareGPT和Arxiv-March23)上进行了实验和分析;结果表明,所提方法取得了最先进性能,并支持最高20倍压缩,且性能损失很小。代码可在https://aka.ms/LLMLingua获取。

英文摘要:

Large language models (LLMs) have been applied in various applications due to their astonishing capabilities. With advancements in technologies such as chain-of-thought (CoT) prompting and in-context learning (ICL), the prompts fed to LLMs are becoming increasingly lengthy, even exceeding tens of thousands of tokens. To accelerate model inference and reduce cost, this paper presents LLMLingua, a coarse-to-fine prompt compression method that involves a budget controller to maintain semantic integrity under high compression ratios, a token-level iterative compression algorithm to better model the interdependence between compressed contents, and an instruction tuning based method for distribution alignment between language models. We conduct experiments and analysis over four datasets from different scenarios, i.e., GSM8K, BBH, ShareGPT, and Arxiv-March23; showing that the proposed approach yields state-of-the-art performance and allows for up to 20x compression with little performance loss. Our code is available at https://aka.ms/LLMLingua.

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

↑