用强化学习优化提示压缩,提升任务表现且不增加延迟。
TACO-RL: Task Aware Prompt Compression Optimization with Reinforcement Learning
- 基于强化学习设计任务感知的提示压缩方法。
- 在三类任务上性能提升8%至189%。
- 适合对推理效率与任务精度有高要求的应用场景。
大型语言模型(如 GPT-4)在各类应用中日益普及,导致实现最佳性能所需的提示(prompt)规模持续增长,带来计算效率挑战。提示压缩旨在减少输入令牌数量以降低推理成本,同时保持任务性能。然而,现有压缩技术要么依赖次优指标(如信息熵),要么将问题建模为与任务无关的令牌分类,无法捕捉任务特定信息。为此,我们提出一种新颖高效的基于强化学习(RL)的任务感知提示压缩方法。为满足低延迟需求,我们采用现有的 Transformer 编码器作为令牌分类模型,并通过轻量级 REINFORCE 算法使用任务特定奖励信号引导学习过程。我们在文本摘要、问答和代码摘要三个多样且具有挑战性的任务上评估了该方法。结果表明,在相同压缩率和延迟要求下,相较于当前最优压缩技术,本方法在三类任务上的任务性能提升了 8% 至 189%。
原文摘要 · Abstract (English)
The increasing prevalence of large language models (LLMs) such as GPT-4 in various applications has led to a surge in the size of prompts required for optimal performance, leading to challenges in computational efficiency. Prompt compression aims to reduce the inference cost by minimizing input tokens without compromising on the task performance. However, existing prompt compression techniques either rely on sub-optimal metrics such as information entropy or model it as a task-agnostic token classification problem that fails to capture task-specific information. To address these issues, we propose a novel and efficient reinforcement learning (RL) based task-aware prompt compression method. To ensure low latency requirements, we leverage existing Transformer encoder-based token classification model while guiding the learning process with task-specific reward signals using lightweight REINFORCE algorithm. We evaluate the performance of our method on three diverse and challenging tasks including text summarization, question answering and code summarization. We demonstrate that our RL-guided compression method improves the task performance by 8% - 189% across these three scenarios over state-of-the-art compression techniques while satisfying the same compression rate and latency requirements.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。