Abstract
Multi-vector embedding models play an increasingly important role in retrieval-augmented generation, yet their internal behaviour lacks comprehensive analysis. We conduct a systematic, head-level study of the 32-head Semantic Feature Representation (SFR) encoder with the FineWeb corpus containing 10 billion tokens. For a set of 4,000 web documents, we pair head-specific embeddings with GPT-4o topic annotations and analyse the results using t-SNE visualisations, heat maps, and a 32-way logistic probe. The analysis shows that (i) clear semantic separation between heads emerges only at an intermediate layer, (ii) some heads align with specific topics while others capture broader corpus features, and (iii) naive pooling of head outputs can blur these distinctions, leading to frequent topic mismatches. The study offers practical guidance on where to extract embeddings, which heads may be pruned, and how to aggregate them to support more transparent and controllable retrieval pipelines.
Introduction
In the landscape of Retrieval-Augmented Generation (RAG), multi-vector and multi-head embedding models have emerged as a sophisticated alternative to traditional single-vector approaches. By representing a document through multiple vectors, these models theoretically capture diverse "aspects" of text—such as technical specifications, sentiment, or thematic summaries—simultaneously. However, the internal mechanics of these models often remain a "black box." It is unclear whether individual attention heads learn complementary features or simply provide redundant representations. Furthermore, the optimal architectural point for extracting these embeddings is not well-defined. This study provides a granular analysis of the Semantic Feature Representation (SFR) encoder to demystify head-level specialization.
Methodology
We analyzed a 32-head SFR encoder based on the Mistral architecture, utilizing the FineWeb sample-10BT corpus. Our methodology centered on three distinct extraction points within the Transformer block to identify where semantic specialization occurs.
- Multi-Stage Extraction: Embeddings were harvested at Stage 1 (immediately following the attention layer), Stage 2 (after the
o_projprojection layer), and Stage 3 (the final model output). - Probing and Visualization: We employed a 32-way logistic probe to test the linear separability of head-specific outputs. Additionally, t-SNE was used to visualize the high-dimensional embedding space.
- Topic Correlation: Using GPT-4o, we annotated 4,000 documents with 25 semantic topics. We then correlated these topics with head activations to identify "specialist" versus "generalist" heads.
Key Insights and Results
Our analysis revealed that architectural location is the primary determinant of semantic clarity. At Stage 1, head representations are highly overlapping and lack distinct boundaries. However, as the data passes through the projection layers (Stages 2 and 3), the heads migrate into well-defined, non-overlapping "islands" in the embedding space.
Linear Separability
The logistic probe results were definitive: while Stage 1 achieved 96.4% accuracy in head identification, Stages 2 and 3 reached near-perfect scores (100% and 99.9%, respectively). This confirms that the projection layers are instrumental in defining the unique functional territory of each head.
Functional Specialization
Topic alignment analysis showed that heads are not redundant. We identified "Specialist" heads (e.g., Head 10) that activate almost exclusively for specific topics like "politics and conflict," and "Generalist" heads (e.g., Head 12) that capture broad linguistic features common across the corpus. Notably, some heads appeared sparse or inactive, suggesting potential for model pruning without significant loss of representational power.
The Risk of Naive Pooling
A critical finding for RAG practitioners is that simple averaging or pooling of multi-head outputs can "blur" these sharp semantic distinctions. When heads are pooled naively, the resulting vector may lose the specific thematic nuances captured by individual heads, leading to decreased retrieval precision and potential topic mismatches.
Conclusion and Future Work
This study demonstrates that multi-head attention models do indeed develop specialized semantic roles, but this specialization is a product of the entire Transformer block rather than the attention mechanism alone. Understanding these "head-topic" mappings opens the door to "steerable" retrieval. Future work will focus on developing mechanisms to selectively activate or weight specific heads based on query intent, creating retrieval pipelines that are both more accurate and more interpretable for end-users.
Summary updated