无需模板或问题,自动压缩提示词并保持关键信息。
Task-agnostic Prompt Compression with Context-aware Sentence Embedding and Reward-guided Task Descriptor
- 用上下文感知的句子嵌入生成任务描述,指导压缩。
- 大模型在LongBench和ZeroSCROLLS上超越现有最佳方法。
- 支持多任务、无模板,适合轻量化部署场景。
大型语言模型(LLMs)的兴起推动了提示压缩技术的发展,旨在缩短输入提示长度同时保留关键信息。然而,现有主流方法常需显式问题或手工模板,限制了通用性。本文提出无任务提示压缩(TPC),一种可在不同任务与领域间泛化的压缩框架,无需输入问题或模板。TPC通过在精心构建的上下文-查询对数据集上训练的任务描述符,结合强化学习优化,生成上下文相关的任务描述;该描述用于计算提示中每句话的相关性,进而生成压缩后的提示。我们设计了三种模型规模(Base、Large、Huge),其中最大模型在LongBench和ZeroSCROLLS基准上优于现有最先进方法,最小模型性能相当但体积显著更小。
原文摘要 · Abstract (English)
The rise of Large Language Models (LLMs) has led to significant interest in prompt compression, a technique aimed at reducing the length of input prompts while preserving critical information. However, the prominent approaches in prompt compression often require explicit questions or handcrafted templates for compression, limiting their generalizability. We propose Task-agnostic Prompt Compression (TPC), a novel framework that generalizes compression across tasks and domains without requiring input questions or templates. TPC generates a context-relevant task description using a task descriptor trained on a curated dataset of context and query pairs, and fine-tuned via reinforcement learning with a reward function designed to capture the most relevant information. The task descriptor is then utilized to compute the relevance of each sentence in the prompt to generate the compressed prompt. We introduce 3 model sizes (Base, Large, and Huge), where the largest model outperforms the existing state-of-the-art methods on LongBench and ZeroSCROLLS benchmarks, and our smallest model performs comparable to the existing solutions while being considerably smaller.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。