Skip to main content
QUICK REVIEW

[Paper Review] LLM-based Embeddings: Attention Values Encode Sentence Semantics Better Than Hidden States

Yeqin Zhang, Yunfei Wang|arXiv (Cornell University)|Feb 2, 2026
Topic ModelingComputer Science0 citations
TL;DR

The paper shows that aggregating value vectors from LLM attention (Value Aggregation, VA) yields stronger sentence embeddings than hidden-state pooling, with an enhanced variant AlignedWVA achieving state-of-the-art results among training-free LLM embeddings and lower encoding cost than MetaEOL.

ABSTRACT

Sentence representations are foundational to many Natural Language Processing (NLP) applications. While recent methods leverage Large Language Models (LLMs) to derive sentence representations, most rely on final-layer hidden states, which are optimized for next-token prediction and thus often fail to capture global, sentence-level semantics. This paper introduces a novel perspective, demonstrating that attention value vectors capture sentence semantics more effectively than hidden states. We propose Value Aggregation (VA), a simple method that pools token values across multiple layers and token indices. In a training-free setting, VA outperforms other LLM-based embeddings, even matches or surpasses the ensemble-based MetaEOL. Furthermore, we demonstrate that when paired with suitable prompts, the layer attention outputs can be interpreted as aligned weighted value vectors. Specifically, the attention scores of the last token function as the weights, while the output projection matrix ($W_O$) aligns these weighted value vectors with the common space of the LLM residual stream. This refined method, termed Aligned Weighted VA (AlignedWVA), achieves state-of-the-art performance among training-free LLM-based embeddings, outperforming the high-cost MetaEOL by a substantial margin. Finally, we highlight the potential of obtaining strong LLM embedding models through fine-tuning Value Aggregation.

Motivation & Objective

  • Motivate sentence-level representations for NLP tasks and critique hidden-state based embeddings from autoregressive LLMs.
  • Propose Value Aggregation (VA) to pool value vectors across layers and tokens without training.
  • Introduce Aligned Weighted VA (AlignedWVA) by aligning VA with the residual stream using W_O and targeted prompts.
  • Demonstrate the efficacy of VA/AlignedWVA across LLaMA-2 and Qwen-3 backbones on MTEB tasks.
  • Discuss potential for fine-tuning VA to further improve embeddings.

Proposed method

  • Define per-layer value vectors v^{l,h}_{n} from multi-head attention and concatenate across heads to form v^{l}_{n}.
  • Mean-pool token-level values to obtain layer-wide vectors ^{l} and average across a selected set S of layers to form VA(x).
  • Investigate layer selection strategies to choose strong aggregation layers (e.g., deeper-middle layers for LLaMA-2; last-layer-near layers for Qwen-3).
  • Introduce AlignedWVA by applying the output projection W_O to map VA into the residual-stream space, enabling alignment with model internals.
  • Explore Weighted VA variants (WVA) using attention-based weights (LT, PromptEOL, FutureEOL) and compare to plain VA.
  • Optionally present Finetune-VA that fine-tunes VA with contrastive learning to improve embeddings.

Experimental results

Research questions

  • RQ1Do attention value vectors encode sentence semantics more effectively than final-layer hidden states for sentence embeddings?
  • RQ2Can a simple, training-free aggregation (Value Aggregation) produce competitive or superior embeddings compared to training-heavy or ensemble-based methods?
  • RQ3Does aligning VA with the residual stream (AlignedWVA) yield state-of-the-art performance among training-free LLM embeddings?
  • RQ4What is the impact of layer selection on VA performance across different backbones (LLaMA-2 and Qwen-3)?
  • RQ5Can finetuning VA offer practical gains with far fewer trainable parameters than hidden-state baselines?

Key findings

  • Value Aggregation (VA) outperforms other training-free LLM-based embeddings across MTEB tasks on LLaMA-2 (7B) and Qwen-3 (8B).
  • AlignedWVA achieves state-of-the-art performance among training-free LLM embeddings and surpasses MetaEOL by a substantial margin.
  • VA with selected deep-middle layers (e.g., LLaMA-2: layers 20–27; Qwen-3: layers 26,27,29,30,31) improves robustness vs. full-layer pooling.
  • AlignedWVA (PromptEOL) and (FutureEOL) substantially outperform MetaEOL, with AlignedWVA (FutureEOL) on Qwen-3 exceeding MetaEOL by more than 4 points on average.
  • WVA variants using prompts (PromptEOL, FutureEOL) significantly improve over LT and LT-based pooling, highlighting the importance of meaningful prompts.
  • Finetune-VA (attention-only) achieves comparable gains to fine-tuning mean-pooled hidden states while training far fewer parameters.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.