arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2501.06730cs.CLcs.LG
收藏

无需多层感知机的更优提示压缩

Better Prompt Compression Without Multi-Layer Perceptrons

University of California, Los Angeles(加州大学洛杉矶分校);Natera(纳特拉公司)

Edouardo Honig, Andrew Lizarraga, Zijun Frank Zhang, Ying Nian Wu

AI总结:

该研究提出仅注意力压缩器AOC,通过移除Transformer块的MLP层构建轻量提示压缩编码器,在最高480倍压缩比下性能优于基于LoRA的基线方法,证明提示压缩编码器无需匹配原模型架构。

摘要:

提示压缩是在不改动生成模型的前提下加速语言模型推理的一种极具潜力的方法。现有研究采用以推理语言模型的低秩适配(LoRA)方式训练的编码器,将提示压缩为规模更小的可学习token序列。但我们研究发现,编码器无需保留原始语言模型的架构即可实现有效的压缩效果。我们提出仅注意力压缩器(Attention-Only Compressor, AOC),该方法移除语言模型Transformer块中的多层感知机(MLP)层后,训练得到提示压缩编码器,最终编码器的参数量较原始模型减少约67%。有趣的是,我们发现在最高达480倍的一系列压缩比下,AOC的提示重建效果更优,且性能优于未移除MLP层、基于推理语言模型LoRA构建的基线压缩编码器。这些结果表明,提示压缩编码器的架构无需与原始解码器语言模型的架构完全一致,为后续提示压缩的架构与方法研究铺平了道路。

英文摘要:

Prompt compression is a promising approach to speeding up language model inference without altering the generative model. Prior works compress prompts into smaller sequences of learned tokens using an encoder that is trained as a LowRank Adaptation (LoRA) of the inference language model. However, we show that the encoder does not need to keep the original language model's architecture to achieve useful compression. We introduce the Attention-Only Compressor (AOC), which learns a prompt compression encoder after removing the multilayer perceptron (MLP) layers in the Transformer blocks of a language model, resulting in an encoder with roughly 67% less parameters compared to the original model. Intriguingly we find that, across a range of compression ratios up to 480x, AOC can better regenerate prompts and outperform a baseline compression encoder that is a LoRA of the inference language model without removing MLP layers. These results demonstrate that the architecture of prompt compression encoders does not need to be identical to that of the original decoder language model, paving the way for further research into architectures and approaches for prompt compression.

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

↑