arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.15153cs.CLcs.AI
收藏

在潜在嵌入空间中压缩序列:大型语言模型的K-标记合并

Compressing Sequences in the Latent Embedding Space: $K$-Token Merging for Large Language Models

Rutgers University(罗格斯大学);AWS AI Labs(AWS人工智能实验室);Amazon(亚马逊);Mistral AI;University of California Los Angeles(加州大学洛杉矶分校)

Zihao Xu, John Harvill, Ziwei Fan, Yizhou Sun, Hao Ding, Hao Wang

AI总结:

本文提出K-Token Merging方法,在潜在空间中压缩序列,通过轻量编码器合并连续K个标记嵌入,实现75%的输入长度缩减,性能损失小。

摘要:

大型语言模型(LLMs)在处理长提示时面临显著的计算和内存成本,因为完全自注意力机制与输入长度平方成正比。标记压缩旨在通过减少表示输入的标记数量来解决这一挑战。然而,现有提示压缩方法主要在标记空间中操作,忽略了潜在嵌入空间中的效率问题。本文提出K-Token Merging,一种潜在空间压缩框架,通过轻量级编码器将每个连续的K个标记嵌入块合并为一个嵌入。压缩后的序列由经过LoRA调整的LLM处理,而生成仍保持在原始词汇中。在结构推理(Textualized Tree)、情感分类(Amazon Reviews)和代码编辑(CommitPackFT)实验中,K-Token Merging在性能与压缩的帕累托前沿上表现优异,实现高达75%的输入长度缩减,同时性能损失极小。代码可在https://github.com/shsjxzh/K-Token-Merging获取。

英文摘要:

Large Language Models (LLMs) incur significant computational and memory costs when processing long prompts, as full self-attention scales quadratically with input length. Token compression aims to address this challenge by reducing the number of tokens representing inputs. However, existing prompt-compression approaches primarily operate in token space and overlook inefficiencies in the latent embedding space. In this paper, we propose K-Token Merging, a latent-space compression framework that merges each contiguous block of K token embeddings into a single embedding via a lightweight encoder. The compressed sequence is processed by a LoRA-adapted LLM, while generation remains in the original vocabulary. Experiments on structural reasoning (Textualized Tree), sentiment classification (Amazon Reviews), and code editing (CommitPackFT) show that K-Token Merging lies on the Pareto frontier of performance vs. compression, achieving up to 75% input length reduction with minimal performance degradation. Code is available at https://github.com/shsjxzh/K-Token-Merging.

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

↑