用压缩表示替代文本令牌,让大模型推理更快更省资源。
ARC-Encoder: learning compressed text representations for large language models
- 设计一个可适配的编码器,将文本压缩为原长度1/4到1/8的连续向量。
- 在多个任务中达到顶尖性能,同时显著降低推理计算开销。
- 单个编码器可通用多个不同大模型,适合跨模型部署使用。
检索增强生成和思维链推理等技术导致上下文变长,推理成本上升。现有上下文压缩方法常需微调目标模型甚至修改架构,可能损害其通用能力。本文提出一种新思路:通过编码器将上下文压缩为连续表示,替代解码器大模型中的词元嵌入。我们系统研究了编码器的训练策略与结构选择,据此设计出自适应文本表示压缩器(ARC-Encoder),输出的连续表示数量仅为原始文本标记数的 $x$ 倍(通常 $xinom{4,8}$)。在指令型与基础型解码器上,涵盖上下文学习与窗口扩展等多种场景的评估显示,ARC-Encoder在多个基准测试中达到最先进水平,并提升推理效率。此外,我们证明该编码器可同时适配多个解码器,实现单一编码器跨模型通用。相关训练代码、微调数据集及预训练模型已公开于 GitHub 与 Hugging Face。
原文摘要 · Abstract (English)
Recent techniques such as retrieval-augmented generation or chain-of-thought reasoning have led to longer contexts and increased inference costs. Context compression techniques can reduce these costs, but the most effective approaches require fine-tuning the target model or even modifying its architecture. This can degrade its general abilities when not used for this specific purpose. Here we explore an alternative approach: an encoder that compresses the context into continuous representations which replace token embeddings in decoder LLMs. First, we perform a systematic study of training strategies and architecture choices for the encoder. Our findings led to the design of an Adaptable text Representations Compressor, named ARC-Encoder, which outputs $x$-times fewer continuous representations (typically $x\!\in\!\{4,8\}$) than text tokens. We evaluate ARC-Encoder across a variety of LLM usage scenarios, ranging from in-context learning to context window extension, on both instruct and base decoders. Results show that ARC-Encoder achieves state-of-the-art performance on several benchmarks while improving computational efficiency at inference. Finally, we demonstrate that our models can be adapted to multiple decoders simultaneously, allowing a single encoder to generalize across different decoder LLMs. This makes ARC-Encoder a flexible and efficient solution for portable encoders that work seamlessly with multiple LLMs. We release a training code at https://github.com/kyutai-labs/ARC-Encoder , fine-tuning dataset and pretrained models are available at https://huggingface.co/collections/kyutai/arc-encoders-68ee18787301407d60a57047 .
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。