Probing and Boosting Large Language Models Capabilities via Attention Heads

Dezhi Zhao, Xin Liu, Xiaocheng Feng, Hui Wang, Bing Qin2025 · DOI

Abstract

Understanding the internal origins of capabilities in large language models (LLMs) is crucial for interpretability and efficient adaptation. However, the emergence of specific capabilities remains poorly understood, as most existing approaches rely on external signals (e.g., performance shifts or gradient similarities) with limited structural grounding. To address these issues, this paper proposes a lightweight and highly interpretable approach that links LLM capabilities to internal components by identifying correspondences at the level of attention heads. Specifically, we first define five fundamental capabilities—Mathematical Reasoning, Reading Comprehension, Commonsense Reasoning, Scientific Reasoning, and Professional Expertise—and employ probing techniques to detect the attention heads most predictive of each, thereby establishing capability-head mappings. For targeted instruction tuning, complex tasks are decomposed into these fundamental capabilities, and training data are selected accordingly. Experiments on LLaMA3.1-8B and Qwen2.5-7B show over 70% discrimination accuracy in identifying capabilities. On MMLU and BBH, our method improves accuracy by 1 to 1.5 points over the gradient-based method LESS and by 5 to 6 points over other intermediate-state baselines.

Introduction

Despite their state-of-the-art performance, Large Language Models (LLMs) are often treated as "black boxes." When attempting to improve a model's specific skill—such as solving physics problems—researchers typically rely on external signals like overall performance shifts or computationally expensive gradient similarities to select training data.

These traditional methods often lack "structural grounding," meaning we do not know where in the model's architecture these capabilities reside. This lack of interpretability makes efficient, targeted instruction tuning difficult. This research aims to bridge the gap between a model's internal structure (its attention heads) and its outward behavior by mapping specific capabilities to localized components.

The ProBooCap Framework

The researchers introduced ProBooCap (Probing and Boosting Capabilities), a three-step process designed to identify and leverage internal "specialist" heads:

  1. Capability-Head Mapping (Probing): Five fundamental capabilities are defined: Mathematical Reasoning (MR), Reading Comprehension (RC), Commonsense Reasoning (CR), Scientific Reasoning (SR), and Professional Expertise (PE). Simple logistic regression classifiers (probes) are trained on the output of individual attention heads. If a head's output accurately predicts a task category, it is labeled a "specialist" for that capability.
  2. Task Decomposition: Complex real-world tasks are decomposed into these five base capabilities. For instance, "College Physics" is treated as a hybrid of Mathematical and Scientific Reasoning.
  3. Data Selection (Boosting): To enhance a model on a target task, the system analyzes representations from the identified specialist heads. It then selects training data from a massive pool that exhibits the highest cosine similarity to the target task within the representation space of those specific heads.

Notably, this approach is gradient-free, offering significant computational efficiency over methods requiring influence functions or gradient vector calculations.

Localization and Consistency

Figure 1: Capability-head mapping across different model families and scales, showing localization of skills in specific layers and heads.

A key finding of the study is that skills are not uniformly distributed but are concentrated in specific attention heads. As shown in Figure 1, different model families exhibit distinct structural patterns. For example, LLaMA3.1-8B tends to concentrate "Reading Comprehension" heads in the middle layers, whereas Qwen2.5-7B utilizes the upper-middle layers for the same task.

Furthermore, the research highlights "Family Consistency": models within the same family (e.g., LLaMA3.2-1B vs. LLaMA3.1-8B) show remarkably similar internal distributions. This suggests that scaling primarily improves the quality of learning rather than fundamentally shifting where the model stores specific knowledge.

Experimental Results

ProBooCap demonstrated superior performance across several metrics:

  • Probing Precision: Simple probes achieved over 70% accuracy in identifying capabilities from the output of a single attention head.
  • Benchmark Performance: On the MMLU and BBH benchmarks, ProBooCap outperformed LESS (a leading gradient-based method) by 1.0 to 1.5 points.
  • Efficiency Gains: Compared to intermediate-state baselines like RDS, the method improved accuracy by 5 to 6 points.
  • Optimal Configuration: The study identified a "Top 16" rule, where using the top 16 attention heads per capability provides the best balance of representational power and skill specificity.

Conclusion and Future Work

By selecting training data based on the model's internal "experts," ProBooCap achieves better results than monolithic approaches. While currently tested on models up to 8B parameters, future work will involve scaling to frontier models (70B+) and expanding the capability set to include coding and safety. The ultimate goal is "surgical" fine-tuning—updating only the specific heads responsible for a skill to prevent catastrophic forgetting in other domains.

Summary updated

Abstract

Understanding the internal origins of capabilities in large language models (LLMs) is crucial for interpretability and efficient adaptation.However, the emergence of specific capabilities remains poorly understood, as most existing approaches rely on external signals (e.g., performance shifts or gradient similarities) with limited structural grounding.To address these issues, this paper proposes a lightweight and highly interpretable approach that links LLM capabilities to internal components by identifying correspondences at the level of attention heads.Specifically, we first define five fundamental capabilities, namely Mathematical Reasoning, Reading Comprehension, Commonsense Reasoning, Scientific Reasoning, and Professional Expertise, and employ probing techniques to detect the attention heads most predictive of each, thereby establishing capability-head mappings.For targeted instruction tuning, complex tasks are decomposed into these fundamental capabilities, and training data are selected accordingly.Experiments on LLaMA3.1-8B and Qwen2.5-7Bshow over 70% discrimination accuracy in identifying capabilities.On MMLU and BBH, our method improves accuracy by 1 to 1.5 points over the gradient-based method LESS and by 5 to 6 points over other intermediate-state baselines 1 .
BibTeX
@misc{zhao2025probing,
  author = {Dezhi Zhao and Xin Liu and Xiaocheng Feng and Hui Wang and Bing Qin},
  title = {{Probing and Boosting Large Language Models Capabilities via Attention Heads}},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.1450},
}
Figure