ChatPaper.aiChatPaper

KV-Embedding:デコーダのみLLMにおける内部KVリルーティングによるトレーニング不要のテキスト埋め込み

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

January 3, 2026
著者: Yixuan Tang, Yi Yang
cs.AI

要旨

大規模言語モデル(LLM)は強力な埋め込み基盤であるが、訓練を必要としない設定での応用には、二つの構造的課題が存在する:因果的注意機構により初期トークンが後続の文脈にアクセスできなくなること、および次のトークン予測という目的が表現を生成方向へ偏らせ、意味的圧縮を妨げることである。これらの制約を解決するため、我々は凍結されたLLMの潜在的な表現力を活性化するフレームワーク「KV-埋め込み」を提案する。本手法は、各層における最終トークンのキー・バリュー(KV)状態が系列の圧縮された視点を符号化するという観察に基づく。これらの状態を接頭辞として再ルーティングすることにより、単一の順伝播で全てのトークンが系列レベルの文脈にアクセス可能となる。モデルに依存しない適用性を確保するため、内在的次元に基づく自動的な層選択戦略を導入する。Qwen、Mistral、Llamaを基盤としたMTEBによる評価では、KV-埋め込みが既存の訓練不要ベースラインを最大10%上回り、かつ4,096トークンまでの系列において堅牢な性能を維持することを示した。これらの結果は、内部状態の操作が入力変更に代わる効率的な代替手段となり得ることを示唆しており、本研究成果が表現学習のためのLLM内部構造のさらなる探求を促進することを期待する。
English
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.
PDF51January 7, 2026