Prompt-SAW: Leveraging Relation-Aware Graphs for Textual Prompt Compression

📄 arXiv: 2404.00489v2 📥 PDF

作者: Muhammad Asif Ali, Zhengping Li, Shu Yang, Keyuan Cheng, Yang Cao, Tianhao Huang, Guimin Hu, Weimin Lyu, Lijie Hu, Lu Yu, Di Wang

分类: cs.CL, cs.AI, cs.LG

发布日期: 2024-03-30 (更新: 2024-10-17)

备注: 16 pages


💡 一句话要点

提出Prompt-SAW以解决长文本提示压缩问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 提示压缩 关系感知图 自然语言处理 大型语言模型 可读性提升

📋 核心要点

  1. 现有的提示压缩方法在可读性和可解释性上存在不足,影响了提示的实用性。
  2. 本文提出Prompt-SAW,通过关系感知图构建和提取关键信息,实现高效的提示压缩。
  3. 实验表明,Prompt-SAW在可读性和性能上显著优于现有最佳基线模型,压缩效果显著。

📝 摘要(中文)

大型语言模型(LLMs)在多种自然语言处理任务中展现出卓越的能力。然而,过长的提示会导致显著的成本,现有的压缩方法在可读性和可解释性方面表现不佳,影响了提示的实用性。为此,本文提出了Prompt-SAW:通过关系感知图进行提示压缩的有效策略。Prompt-SAW利用提示的文本信息构建图,并提取关键信息元素以生成压缩提示。此外,本文还提出了GSM8K-aug,这是现有GSM8K基准的扩展版本,用于任务无关提示的全面评估。实验结果表明,Prompt-SAW压缩的提示在可读性上更优,并在任务无关和任务相关设置中分别比最佳基线模型提升了10.1和77.1,同时压缩原始提示文本34.9和56.7。

🔬 方法详解

问题定义:本文旨在解决大型语言模型中长文本提示的压缩问题。现有方法在压缩过程中往往导致可读性和可解释性下降,影响了提示的有效性。

核心思路:Prompt-SAW的核心思路是利用关系感知图来构建提示的文本信息图,从中提取关键信息元素,以生成更为简洁且可读的压缩提示。这样的设计旨在提高压缩后的提示的可用性和实用性。

技术框架:Prompt-SAW的整体架构包括三个主要模块:首先,利用提示文本构建关系感知图;其次,从图中提取关键信息元素;最后,生成压缩后的提示文本。

关键创新:本文的主要创新在于引入关系感知图的概念,通过图结构化的方式来处理提示信息,显著提升了压缩效果和可读性。这一方法与传统的线性压缩方法有本质区别。

关键设计:在技术细节方面,Prompt-SAW的设计包括图的构建算法、信息提取策略以及压缩比率的调节。具体的损失函数和网络结构设计尚未详细披露,需进一步研究。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,Prompt-SAW压缩的提示在可读性上显著优于现有最佳基线模型,任务无关和任务相关设置中分别提升了10.1和77.1。同时,原始提示文本的压缩比率达到了34.9%和56.7%。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理中的文本生成、对话系统以及信息检索等场景。通过提升提示的压缩效率和可读性,Prompt-SAW能够在实际应用中提高大型语言模型的响应速度和准确性,具有重要的实际价值和未来影响。

📄 摘要(原文)

Large Language Models (LLMs) have shown exceptional abilities for multiple different natural language processing tasks. While prompting is a crucial tool for LLM inference, we observe that there is a significant cost associated with exceedingly lengthy prompts. Existing attempts to compress lengthy prompts lead to substandard results in terms of readability/interpretability of the compressed prompt, with a detrimental impact on prompt utility. To address this, we propose PromptSAW: Prompt compresSion via Relation AWare graphs, an effective strategy for prompt compression over task-agnostic and task-aware prompts. Prompt-SAW uses the prompt's textual information to build a graph and later extracts key information elements in the graph to come up with the compressed prompt. We also propose GSM8K-aug, i.e., an extended version of the existing GSM8K benchmark for task-agnostic prompts in order to provide a comprehensive evaluation platform. Experimental evaluation using benchmark datasets shows that prompts compressed by Prompt-SAW are not only better in terms of readability, but they also outperform the best-performing baseline models by up to 10.1 and 77.1, respectively, for task-agnostic and task-aware settings while compressing the original prompt text by 34.9 and 56.7.