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은 강력한 임베딩 백본이지만, 학습 없이 적용하는 환경에서는 두 가지 구조적 한계에 직면합니다: 인과적 어텐션(causal attention)은 초기 토큰이 후속 문맥에 접근하는 것을 제한하며, 다음 토큰 예측 목표는 생성(generation)에 치우쳐 표현이 의미론적 압축에서 벗어나게 만듭니다. 이러한 한계를 해결하기 위해 우리는 고정된(frozen) LLM의 잠재적 표현 능력을 활성화하는 KV-임베딩 프레임워크를 제안합니다. 우리의 방법은 각 계층에서 최종 토큰의 키-값(KV) 상태가 시퀀스의 압축된 관점을 인코딩한다는 관찰에 기반합니다. 이러한 상태를 프리픽스로 재배치하여 단일 순전파만으로 모든 토큰이 시퀀스 수준 문맥에 접근할 수 있도록 합니다. 모델에 구애받지 않는 적용성을 보장하기 위해 본질적 차원(intrinsic dimensionality)에 기반한 자동화된 계층 선택 전략을 도입했습니다. 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.