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

基于强化学习的离散提示压缩

Discrete Prompt Compression with Reinforcement Learning

Hoyoun Jung, Kyung-Joong Kim

AI总结:

本研究提出基于强化学习的离散提示压缩方法PCRL,通过高效策略网络直接编辑提示,无需梯度或标注数据,在保持性能的同时平均减少24.6%的token数量,并支持迁移至更大模型。

摘要:

压缩后的提示有助于指令微调语言模型(LMs)克服上下文窗口限制并降低计算成本。现有方法主要基于训练嵌入,面临可解释性、嵌入token数量固定、在不同LMs间可重用性差,以及与黑盒API交互时不适用等挑战。本研究提出基于强化学习的提示压缩(PCRL),这是一种解决上述问题的离散提示压缩方法。所提出的PCRL方法利用一个计算高效且直接编辑提示的策略网络。PCRL采用的训练方法可灵活应用于各种类型的LMs,包括仅解码器和编码器-解码器架构,且无需访问LMs的梯度或标注数据即可训练。所提出的PCRL在各种指令提示中平均减少了24.6%的token数量,同时保持足够的性能。此外,我们证明学习到的策略可以迁移到更大的LMs,并通过全面分析探索了提示内的token重要性。我们的代码可在https://github.com/nenomigami/PromptCompressor获取。

英文摘要:

Compressed prompts aid instruction-tuned language models (LMs) in overcoming context window limitations and reducing computational costs. Existing methods, which primarily based on training embeddings, face various challenges associated with interpretability, the fixed number of embedding tokens, reusability across different LMs, and inapplicability when interacting with black-box APIs. This study proposes prompt compression with reinforcement learning (PCRL), which is a discrete prompt compression method that addresses these issues. The proposed PCRL method utilizes a computationally efficient policy network that edits prompts directly. The training approach employed in the proposed PCRLs can be applied flexibly to various types of LMs, including both decoder-only and encoder-decoder architecture and it can be trained without gradient access to the LMs or labeled data. The proposed PCRL achieves an average reduction of 24.6% in terms of the token count across various instruction prompts while maintaining sufficient performance. In addition, we demonstrate that the learned policy can be transferred to larger LMs, and through a comprehensive analysis, we explore the token importance within the prompts. Our code is accessible at https://github.com/nenomigami/PromptCompressor.

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

↑