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

ICPC:具有更快推理速度的上下文内提示压缩

ICPC: In-context Prompt Compression with Faster Inference

Southern University of Science and Technology(南方科技大学)

Ziyang Yu, Yuyu Liu

AI总结:

本文提出ICPC方法,利用编码器计算词概率和信息量来自适应压缩提示,减少信息损失并提升压缩速度,在多种NLP任务上验证了其有效性和高效性。

摘要:

尽管大语言模型(LLMs)近期取得了成功,但由于LLM输入长度固定,向LLM输入长提示仍然具有挑战性。作为一种补救措施,提示压缩通过移除提示中的冗余token成为一种有前景的解决方案。然而,现有工作中使用LLM需要额外的计算资源并导致内存开销。为了解决这一问题,我们提出了ICPC(In-context Prompt Compression,上下文内提示压缩),这是一种新颖且可扩展的提示压缩方法,能够自适应地缩短提示长度。ICPC的核心思想是利用编码器计算提示中每个词出现的概率,并通过信息函数计算每个词所携带的信息量,从而有效减少提示压缩过程中的信息损失并提高压缩速度。在实验上,我们证明了ICPC能够有效压缩不同类别的长文本,从而在不同类型的自然语言处理(NLP)任务上取得更好的性能和速度。

英文摘要:

Despite the recent success of Large Language Models (LLMs), it remains challenging to feed LLMs with long prompts due to the fixed size of LLM inputs. As a remedy, prompt compression becomes a promising solution by removing redundant tokens in the prompt. However, using LLM in the existing works requires additional computation resources and leads to memory overheads. To address it, we propose ICPC (In-context Prompt Compression), a novel and scalable prompt compression method that adaptively reduces the prompt length. The key idea of ICPC is to calculate the probability of each word appearing in the prompt using encoders and calculate information carried by each word through the information function, which effectively reduces the information loss during prompt compression and increases the speed of compression. Empirically, we demonstrate that ICPC can effectively compress long texts of different categories and thus achieve better performance and speed on different types of NLP tasks.

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

↑