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

KV-Embedding: 通过解码器-only LLMs中的内部KV重路由实现无训练文本嵌入

KV-Embedding: Training-free Text Embedding via Internal KV Re-routing in Decoder-only LLMs

The Hong Kong University of Science and Technology(香港科技大学)

Yixuan Tang, Yi Yang

AI总结:

KV-Embedding通过内部KV重路由实现解码器-only LLMs的无训练文本嵌入,提升性能达10%并保持长序列鲁棒性。

摘要:

尽管LLMs是强大的嵌入骨干,但它们在无训练设置中的应用面临两个结构挑战:因果注意力限制早期token无法访问后续上下文,而next-token预测目标使表示偏向生成而非语义压缩。为了解决这些限制,我们提出了KV-Embedding,一个激活冻结LLMs潜在表示能力的框架。我们的方法利用观察到的最终token在每层的key-value(KV)状态编码了序列的压缩视图。通过将这些状态作为前置前缀重路由,我们使所有token能够在单次前向传递中访问序列级上下文。为确保模型无关的适用性,我们引入了基于内在维度性的自动化层选择策略。在MTEB上对Qwen、Mistral和Llama骨干的评估显示,KV-Embedding在无训练基线中表现优异,最高提升达10%,同时在4096token序列上保持稳健性能。这些结果表明,内部状态操控为输入修改提供了一种高效替代方案,我们希望这项工作能鼓励进一步探索LLM内部结构用于表示学习。

英文摘要:

While LLMs are powerful embedding backbones, their application in training-free settings faces two structural challenges: causal attention restricts early tokens from accessing subsequent context, and the next-token prediction objective biases representations toward generation rather than semantic compression. To address these limitations, we propose KV-Embedding, a framework that activates the latent representation power of frozen LLMs. Our method leverages the observation that the key-value (KV) states of the final token at each layer encode a compressed view of the sequence. By re-routing these states as a prepended prefix, we enable all tokens to access sequence-level context within a single forward pass. To ensure model-agnostic applicability, we introduce an automated layer selection strategy based on intrinsic dimensionality. Evaluations on MTEB across Qwen, Mistral, and Llama backbones show that KV-Embedding outperforms existing training-free baselines by up to 10%, while maintaining robust performance on sequences up to 4,096 tokens. These results demonstrate that internal state manipulation offers an efficient alternative to input modification, and we hope this work encourages further exploration of LLM internals for representation learning.

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

↑