Papers
Topics
Authors
Recent
Search
2000 character limit reached

Head Relevance Vectors (HRVs)

Updated 15 March 2026
  • HRVs are per-head vectors or scalars that measure the contribution of individual attention heads in transformer models, providing clear quantification of task-specific relevance.
  • They use techniques such as token attribution, contrastive retrieval, and latent disentanglement to identify and manipulate the most discriminative heads without altering model structure.
  • HRVs enhance model efficiency and control by enabling selective resource allocation and improved interpretability across applications like multimodal LLMs, diffusion models, retrieval, and audio processing.

Head Relevance Vectors (HRVs) quantify the task-specific or concept-level contribution of individual heads within attention-based neural architectures, enabling the principled identification, selection, and manipulation of the most discriminative or semantically aligned heads without intrusive model modifications. HRVs have been formalized, utilized, and experimentally validated across domains including multimodal LLMs, text-to-image generative models, attention-based retrieval/reranking, audio representation learning, and causal LLM steering.

1. Mathematical Formulations and Notational Scope

HRVs are typically constructed as per-head vectors or scalars reflecting each head's relevance to a downstream objective or human-interpretable visual concept. Across transformers with LL layers and HH heads per layer, the model-wise HRV is a concatenation of per-layer vectors HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H for ℓ=1,…,L\ell = 1,\ldots,L, resulting in HRV∈RL⋅H\mathrm{HRV} \in \mathbb R^{L \cdot H} or, for cross-attention, HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H per concept CnC_n.

For attention-based visual relevance in multimodal LLMs (Wang et al., 5 Jun 2025), scalar scores vℓ,hv_{\ell,h} for head (ℓ,h)(\ell,h) are defined as: vℓ,h=Sℓ,h/∑ℓ′,h′Sℓ′,h′v_{\ell,h} = S_{\ell,h} \bigg/ \sum_{\ell',h'} S_{\ell',h'} where HH0 and HH1 iff the maximal-attention key for output token HH2 falls within the set HH3 of image tokens associated with HH4.

In concept-aligned diffusion models (Park et al., 2024), an HRV for concept HH5 is defined as: HH6 where each element counts (and is later L1-normalized across heads) the number of generations in which head HH7 most responds to HH8.

For contrastive retrieval, a relevance score per head is given by an InfoNCE-like contrast between positive and negative document attention (Tran et al., 2 Oct 2025): HH9 where HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H0 is the mean attention from query to document HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H1 under head HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H2.

In causal LLM steering (Zhan et al., 10 Jun 2025), per-head HRVs are constructed as the concatenation of the (discrete or latent) units within a VQ-AE representation identified as behavior-discriminative via supervised contrast.

2. Algorithms for HRV Computation

Training-Free Response Analysis (SparseMM)

  • Extract all HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H3 attention matrices for a set of HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H4 annotated image-text pairs.
  • For each output token HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H5, determine the set HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H6 (image tokens corresponding to HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H7).
  • For each head, increment HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H8 by HRVℓ∈RH\mathrm{HRV}_\ell \in \mathbb R^H9 if â„“=1,…,L\ell = 1,\ldots,L0.
  • Normalize all â„“=1,…,L\ell = 1,\ldots,L1 over heads to get â„“=1,…,L\ell = 1,\ldots,L2.
  • HRVs are then per-layer vectors â„“=1,…,L\ell = 1,\ldots,L3.

Mechanistic Interpretability in Diffusion Models

  • Given â„“=1,…,L\ell = 1,\ldots,L4 concepts and â„“=1,…,L\ell = 1,\ldots,L5 heads, for each prompt, timestep, and head, find the concept â„“=1,…,L\ell = 1,\ldots,L6 with top average spatial activation.
  • Increment â„“=1,…,L\ell = 1,\ldots,L7.
  • After all data, normalize each â„“=1,…,L\ell = 1,\ldots,L8 so that â„“=1,…,L\ell = 1,\ldots,L9.

Contrastive Retrieval Head Scoring

  • Aggregate per-head query-to-document attention for both gold and negative documents.
  • Apply a softmax-based contrastive metric HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}0.
  • Select top heads by average HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}1 over samples.

Latent Disentanglement for Behavioral Relevance

  • Train, per head, a VQ-AE on last-token activations, partition code as per semantic units.
  • Add a supervised contrastive loss forcing separation of encodings from aligned vs violating behaviors.
  • Designate as HRV the units with high class-separability; final score is given by a binary classification (AUC) of generated codes.

Audio Relevance Heads

  • Decompose time-frequency filterbank output into HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}2 sub-bands, each processed by a two-layer FC network to generate a soft mask HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}3 over sub-band bins.
  • The relevance mask HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}4 serves as the HRV for head HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}5.

3. Applications and Empirical Insights

HRVs have driven advances in model efficiency, interpretability, retrieval, and controlled generation:

Application Head Selection Criterion Empirical Highlights
SparseMM MLLMs Visual alignment via token attribution <5% heads suffice for visual tasks, 1.38× speedup, 52% memory reduction (Wang et al., 5 Jun 2025)
Cross-attn Diffusion Human concept-alignment in CA heads HRVs enable concept-strengthening, reducing polysemy errors from 63%→15.9% (Park et al., 2024)
Retrieval Reranking InfoNCE-style contrast of gold vs negatives <1% heads optimal, +1–4 nDCG points, 20% latency/40% memory savings after layer pruning (Tran et al., 2 Oct 2025)
Audio Classification Mask generation over local TF sub-bands 10–23% accuracy gains at <0.1% param increase (Dutta et al., 2021)
Causal LLM Steering VQ-AE/contrastive latent separation 20% accuracy boost for truthfulness interventions (Zhan et al., 10 Jun 2025)

Preserving only the top-HRV∈RL⋅H\mathrm{HRV} \in \mathbb R^{L \cdot H}6 heads by HRV scores often matches or outperforms full-head baselines, with heads concentrated in mid-layers and task-relevant heads forming a small, robust subset.

4. Inference Manipulation and Resource Allocation

SparseMM operationalizes HRVs for memory and compute savings by asymmetric KV-cache allocation (Wang et al., 5 Jun 2025):

  • Each head HRV∈RLâ‹…H\mathrm{HRV} \in \mathbb R^{L \cdot H}7 receives a combined KV budget:

HRV∈RL⋅H\mathrm{HRV} \in \mathbb R^{L \cdot H}8

with local window HRV∈RL⋅H\mathrm{HRV} \in \mathbb R^{L \cdot H}9, uniform baseline HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H0, and remaining cache allocated in proportion to HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H1.

  • During decoding, heads retain only their most-attended keys up to their respective HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H2.
  • Ablating low-relevance heads (95%+) yields negligible accuracy drop; on DocVQA, 5.3% of full cache suffices for Qwen2-VL-7B.

In generative vision models (Park et al., 2024), HRVs enable direct rescaling of per-head cross-attention weights for concept strengthening and adjusting:

  • For desired concept HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H3, rescale CA maps as HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H4.
  • For both desired and undesired concepts, interpolate head-wise as HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H5.

For causal behavioral steering, HRVs identify which heads to intervene on and provide per-head importance weights for steering vectors (Zhan et al., 10 Jun 2025).

5. Interpretability, Clustering, and Specialization

HRVs empirically align with human-specified or downstream concepts:

  • Ordered weakening: systematically ablating heads in order of decreasing HRV for a concept causes earlier and steeper loss of that concept in generative output (Park et al., 2024).
  • In clustering analyses, HRVs for semantically similar concepts cluster distinctly in the HRV space, reinforcing interpretability claims.
  • In audio, visualizing HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H6 demonstrates functional specialization—e.g., one head accentuating high-frequency transients, another heightening low-frequency backgrounds (Dutta et al., 2021).
  • In retrieval, aggregation over a single high-relevance head can outperform full-head schemes (Tran et al., 2 Oct 2025).

6. Limitations and Prospective Developments

Limitations include:

  • Degraded ranking/weak interpretability for diffuse or ambiguous concepts (e.g., numeracy, facial expressions) (Park et al., 2024).
  • Simple HRV normalizations may be inadequate for very large head counts (HRVn∈RH\mathrm{HRV}_n \in \mathbb R^H7); alternative scaling or clamping may be needed (Park et al., 2024).
  • For causal interventions, incomplete disentanglement or over-pruning can limit transferability (Zhan et al., 10 Jun 2025).

Prospective directions span:

  • Fully automated pipelines for target token/concept selection.
  • Improved HRV normalization for large-head models.
  • Extension to other architectures (e.g., non-diffusion multimodal models).
  • Deeper investigation of HRVs in self-attention vs. cross-attention, and the effects of architecture or fine-tuning.

7. Summary Table: HRV Methodologies in Recent Literature

Domain/Model HRV Definition Selection/Analysis Method Notable Results Reference
MLLMs (SparseMM) Visual token attribution Training-free response analysis <5% heads needed for accuracy, 1.38× speed, 52% KV reduction (Wang et al., 5 Jun 2025)
Text-to-Image Diffusion Concept activation counts CA map activation + clustering 4–12% metric gains, drastic polysemy error drop (Park et al., 2024)
Retrieval/Reranking InfoNCE contrast Contrastive gold-vs-neg analysis 1% heads optimal; layer pruning yields efficiency (Tran et al., 2 Oct 2025)
Audio Representation Sub-band context masking Per-head 2-layer nets, end-to-end +10–23% accuracy improvements over baseline (Dutta et al., 2021)
Causal LLM Steering VQ-AE latent partitioning Behavior discriminative contrast 20–81.5% boost in target steering, zero-shot transfer (Zhan et al., 10 Jun 2025)

Across all observed settings, HRVs offer a principled, interpretable, and efficient mechanism for fine-grained network analysis, head selection, memory/computation savings, and targeted model control.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Head Relevance Vectors (HRVs).