Skip to main content
QUICK REVIEW

[论文解读] LongLLMLingua: Accelerating and Enhancing LLMs in Long Context Scenarios via Prompt Compression

Huiqiang Jiang, Qianhui Wu|arXiv (Cornell University)|Oct 10, 2023
Topic ModelingComputer Science被引用 12
一句话总结

LongLLMLingua 引入了一个面向问题的提示压缩管线,提升关键信息密度,重新排序文档,调整压缩粒度,并恢复子序列,在长上下文的 LLM 使用中以更低成本和更快延迟实现更高的任务性能。

ABSTRACT

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.

研究动机与目标

  • 激发在长上下文任务(问答、摘要、编码等)中高效、具成本效益地使用大语言模型。
  • 提升模型在压缩提示中对与问题相关信息的感知。
  • 在保持或提升准确性的前提下降低端到端延迟和 API 成本。
  • 开发并评估一个针对长文档和多任务的提示压缩框架。

提出的方法

  • 构建一个以 LLMLingua 为基础、具 LongLLMLingua 增强的提示压缩框架。
  • 引入面向问题的粗粒度压缩,利用基于问题条件困惑度的文档级指标 r_k 来选择文档。
  • 提出对比困惑度以引导细粒度的标记级压缩,从而提升与问题相关性。
  • 基于重要性分数实现文档重新排序,以减轻提示中段信息丢失。
  • 采用动态压缩比,在细粒度压缩阶段将更多预算分配给更相关的文档。
  • 纳入后压缩子序列恢复策略,以在 LLM 输出中恢复原始子字符串。

实验结果

研究问题

  • RQ1如何将提示压缩调整为突出长上下文提示中的问题相关信息?
  • RQ2粗到细压缩、文档重新排序以及自适应预算是否能提升长上下文任务中 LLM 的性能与效率?
  • RQ3子序列恢复步骤是否能提高从压缩提示得到的输出的准确性和可靠性?
  • RQ4LongLLMLingua 对标准长上下文基准测试的延迟与成本影响是多少?

主要发现

  • LongLLMLingua 在长上下文任务上,使用显著更少的输入标记达到更高的性能(例如,在 NaturalQuestions 上提升最高可达 17.1%,标记数量约少 4 倍)。
  • 该方法在 LongBench 和 ZeroScrolls 基准测试上实现成本节省(例如每 1000 个样本分别节省 28.5 美元和 27.4 美元)。
  • 压缩后端到端延迟降低,随着压缩比的增大,速度提升达到 1.4x–3.8x。
  • 消融研究显示移除任意提出的组成部分都会降低性能,证实问题感知机制、动态比率和子序列恢复的必要性。
  • 文档重新排序不仅提升 LongLLMLingua 的性能,也有利于其他基线,证明了其有效性。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。