arXiv:2503.07956cs.CLcs.AI2025-03被引 5

用大模型压缩提示词,提速省资源还更准

EFPC: Towards Efficient and Flexible Prompt Compression

  • 用GPT-4生成压缩提示,结合原提示训练
  • 4倍压缩下F1提升4.8%,数据少1%就超前人
  • 适配多种任务模型,实用性强

大语言模型(如GPT-4)虽推动了自然语言处理的发展,但过长的文本输入带来高昂的计算与成本负担。为此,本文提出高效灵活的提示压缩方法EFPC,统一任务相关与无关压缩,实现准确率与效率的平衡。EFPC利用GPT-4生成压缩提示,并将其与原始提示联合用于训练;在训练和推理中,根据预测概率选择性地添加用户指令与压缩提示。该方法数据效率高,仅需少量数据即可显著提升性能。在LongBench单文档问答基准上,相比当前最优方法LLMLingua-2,EFPC在4倍压缩率下以1%额外数据实现4.8%相对F1提升,以10%额外数据实现11.4%提升。其统一框架具备广泛适用性,可有效提升多模型、多任务、多领域的表现,为NLP提供了切实可行的进展。

原文摘要 · Abstract (English)

The emergence of large language models (LLMs) like GPT-4 has revolutionized natural language processing (NLP), enabling diverse, complex tasks. However, extensive token counts lead to high computational and financial burdens. To address this, we propose Efficient and Flexible Prompt Compression (EFPC), a novel method unifying task-aware and task-agnostic compression for a favorable accuracy-efficiency trade-off. EFPC uses GPT-4 to generate compressed prompts and integrates them with original prompts for training. During training and inference, we selectively prepend user instructions and compress prompts based on predicted probabilities. EFPC is highly data-efficient, achieving significant performance with minimal data. Compared to the state-of-the-art method LLMLingua-2, EFPC achieves a 4.8% relative improvement in F1-score with 1% additional data at a 4x compression rate, and an 11.4% gain with 10% additional data on the LongBench single-doc QA benchmark. EFPC's unified framework supports broad applicability and enhances performance across various models, tasks, and domains, offering a practical advancement in NLP.

提示压缩大模型优化高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。