让小模型按任务风格压缩大模型提示词,省时省钱还有效。
Style-Compress: An LLM-Based Prompt Compression Framework Considering Task-Specific Styles
- 用小模型通过风格迭代和上下文学习生成任务专属压缩示例。
- 仅需10样本100查询,压缩比0.25或0.5时性能媲美原始提示。
- 支持多任务适配,无需额外训练,适合高效部署场景。
提示词压缩能在保持信息量的同时缩短上下文长度,不仅降低大模型推理时间与计算成本,也减少闭源模型使用开销。初步研究发现,指导语言模型压缩提示词时,不同压缩风格(如抽取式或摘要式)会影响下游任务表现。基于此,我们提出 Style-Compress:一个轻量级框架,使小型语言模型在无需额外训练的情况下,为大型模型在新任务上生成任务特定的提示压缩结果。该方法通过风格变化与上下文学习,迭代生成并筛选有效的压缩提示作为任务示范,使小模型能作为高效压缩器。Style-Compress 在四项任务中优于两个基线模型:原始提示重建、文本摘要、多跳问答与思维链推理。仅需10个样本与100次查询进行适应,压缩比达0.25或0.5时,其压缩结果性能可与原始提示持平甚至超越。
原文摘要 · Abstract (English)
Prompt compression condenses contexts while maintaining their informativeness for different usage scenarios. It not only shortens the inference time and reduces computational costs during the usage of large language models, but also lowers expenses when using closed-source models. In a preliminary study, we discover that when instructing language models to compress prompts, different compression styles (e.g., extractive or abstractive) impact performance of compressed prompts on downstream tasks. Building on this insight, we propose Style-Compress, a lightweight framework that adapts a smaller language model to compress prompts for a larger model on a new task without additional training. Our approach iteratively generates and selects effective compressed prompts as task-specific demonstrations through style variation and in-context learning, enabling smaller models to act as efficient compressors with task-specific examples. Style-Compress outperforms two baseline compression models in four tasks: original prompt reconstruction, text summarization, multi-hop QA, and CoT reasoning. In addition, with only 10 samples and 100 queries for adaptation, prompts compressed by Style-Compress achieve performance on par with or better than original prompts at a compression ratio of 0.25 or 0.5.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。