用单个向量压缩提示词,保持模型性能仅降2%。
Prompt Compression via Activation Aggregation

- 通过加权求和中间层激活,生成可替换原始提示的压缩向量。
- 压缩后模型准确率下降不足2%,显著降低计算开销。
- 适合需频繁处理相同指令的场景,如推理加速与部署优化。
大型语言模型在生成响应前需通过数十层传播提示词的激活值。本文探究是否可将任务相关的指令信息压缩为单一激活向量,并注入目标LLM的早期层以替代原始标记序列?结果表明,通过在中间层提取激活并进行学习加权求和,再注入早期层,该压缩向量能有效保留任务相关信息,相较完整提示处理仅造成低于2%的准确率下降。除了实际应用价值——对固定指令提示减少每查询计算量,无需重新处理原始标记序列外,分析还揭示了大模型激活空间的结构特性:(i) 中间层表示可有意义地传递至早期层,表明信息编码具有跨层兼容性;(ii) 单一激活向量可编码可度量且可恢复的语义信息;(iii) 加权求和是一种稳健的表示压缩方法。
原文摘要 · Abstract (English)
Large language models process prompts by propagating activations through dozens of layers before generating a response. We ask whether the task-relevant information contained in an instruction prompt can be compressed into a single activation vector and re-injected into the model, replacing the original token sequence? We show this is achievable using a learned weighted sum of activations extracted at an intermediate layer and injected at an early layer of the target LLM. The compressed vector preserves task-relevant information, incurring an accuracy drop of under $2\%$ relative to full prompt processing. Beyond its practical implications, including reducing per-query computation for fixed instruction prompts without reprocessing the original token sequence, our analysis reveals structure in the activation space of LLMs: (i) mid-layer representations transfer meaningfully to early layers, suggesting a degree of cross-layer compatibility in how information is encoded; (ii) a single activation vector encodes a quantifiable and recoverable amount of semantic information; (iii) a weighted sum of activations is a robust representation compressor.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。