When Parts are Greater Than Sums: Individual LLM Components Can Outperform Full Models

Ting-Yun Chang, Jesse Thomason, Robin Jia · DOI

Abstract

Large Language Models (LLMs) are often brittle in-context learners, where minor changes in prompt formatting can lead to significant performance swings. This research investigates the internal mechanics of this phenomenon by decomposing model outputs into the contributions of individual attention heads and MLP layers. We discover "hidden experts"—internal components that consistently outperform the full model—alongside "bad" and "biased" components that degrade performance. By learning to reweight these components (COMPRW) with as few as 12 examples, we achieve a 6% accuracy improvement over standard in-context learning. Crucially, we find that while the full model's output is unstable, the performance of individual components is highly correlated across different prompts, offering a more robust path for model optimization.

Introduction: The Brittleness of In-Context Learning

In-context learning (ICL) allows LLMs to perform tasks using only a few examples in a prompt. However, this capability is notoriously finicky; formatting changes or example ordering can cause massive accuracy fluctuations. Most existing solutions treat the LLM as a "black box," focusing on prompt engineering or output calibration. This work instead looks "under the hood" to determine if the whole model is failing or if specific internal parts are leading it astray.

Methodology: Decomposing the Residual Stream

The researchers employ a mathematically exact decomposition of the LLM's final output (logits) into a sum of direct contributions from every attention head and MLP layer across the network. Using a technique similar to the "logit lens," they project the output of each individual component directly into the vocabulary space to see what that specific part "wanted" to predict.

To leverage these insights, they propose Component Reweighting (COMPRW). This method learns scalar weights for each component using a tiny training set (12–24 examples) to amplify "good" components and silence "bad" or "biased" ones, all while keeping the original LLM parameters frozen.

The Taxonomy of Internal Components

Analysis reveals three distinct types of internal components within the model:

  1. Good-performing: Internal "hidden experts" that handle the task better than the full model.
  2. Bad-performing: Components that consistently predict the wrong answer, performing significantly worse than random chance.
  3. Label-biased: "Lazy" components that always predict the same label regardless of the input.
Figure 1: Component accuracy vs. positive prediction rate for Llama-2-7B on SST2 and Yelp. It highlights the distribution of good, bad, and biased components and their transferability across datasets.

As shown in Figure 1, these components are not just task-specific; "experts" identified on one dataset (e.g., SST-2 movie reviews) often maintain high performance when transferred to out-of-distribution (OOD) tasks (e.g., Yelp reviews).

Internal Stability vs. External Brittleness

A key finding of this study is that while the full model's accuracy fluctuates wildly based on prompt formatting, the accuracies of individual components remain highly stable.

Figure 3: Comparison of component accuracy across two different prompt templates. Despite a massive gap in full model accuracy (0.39 vs 0.89), the internal components show a high correlation (0.81).

Figure 3 illustrates this phenomenon: even when a minor formatting change (like an extra newline) "tanks" the full model's performance, the internal "experts" remain experts. This suggests that the brittleness of ICL is a failure of the model's internal "committee" to aggregate knowledge correctly, rather than a lack of knowledge within the model itself.

Key Results and Efficiency

The COMPRW method consistently outperforms standard ICL across various models (Llama-2, Llama-3, Mistral) and tasks. On Llama-2-7B, it improved average accuracy by 6.0%. These "expert" components are also found to emerge very early in the pre-training process, long before the full model shows stable ICL performance.

Beyond accuracy, the method is highly efficient. Because it only involves learning a linear layer on top of cached activations, training takes less than a minute on a single CPU. Inference speed remains nearly identical to standard few-shot ICL, making it a practical alternative to complex prompt engineering.

Conclusion and Future Work

This research demonstrates that LLMs contain internal components that are more robust and accurate than the models themselves. While currently limited to classification tasks with single-token labels, future work could extend this component-level analysis to free-form text generation. Understanding why "bad" heads exist—perhaps serving as suppression mechanisms—remains an intriguing open question for mechanistic interpretability.

Summary updated

BibTeX
@inproceedings{chang2024when,
  author = {Ting-Yun Chang and Jesse Thomason and Robin Jia},
  title = {{When Parts are Greater Than Sums: Individual LLM Components Can Outperform Full Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.574},
}
Figure