Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale

Hritik Bansal, Karthik Gopalakrishnan, Saket Dingliwal, Sravan Bodapati, Katrin Kirchhoff, Dan Roth · DOI

TL;DR

This paper investigates which parts of a massive 66-billion parameter language model (OPT-66B) are truly essential for in-context learning. Surprisingly, they found that a significant portion of the model's components (up to 70% of attention heads and 20% of feed-forward networks) can be removed with minimal impact on performance, suggesting that current large models might be "undertrained" for this capability.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown remarkable abilities in performing tasks with just a few examples provided in the prompt, a phenomenon known as in-context learning (ICL). However, the underlying mechanisms of ICL are still not fully understood. Specifically, it's unclear whether all the parameters in these massive models contribute equally to ICL. This paper aims to demystify this by asking: are all components of a large LLM equally important for in-context learning, or is there a more specialized subset of components responsible for this emergent ability? Understanding this could lead to more efficient model architectures and training strategies.

Methods

The researchers employed a two-pronged approach:

  1. Pruning-based Importance Scoring: They used both "oracle" (measuring performance drop when a component is removed) and "gradient-based" methods to assign importance scores to individual attention heads and feed-forward networks (FFNs) within the OPT-66B model. This allowed them to identify which components were most critical for ICL performance across various tasks and few-shot settings.
  2. Induction Head Analysis: Building on prior work, they specifically investigated "induction heads," which are hypothesized to be responsible for primitive operations like prefix matching and copying within the model's attention mechanism. They quantified the capacity of each attention head to perform these operations and analyzed their overlap with the components identified as important for ICL.

Datasets

The study utilized a diverse set of 14 NLP datasets for evaluation, including:

  • Question Answering: ARC Easy, ARC Challenge, OpenBookQA
  • Commonsense Reasoning: HellaSwag, PIQA, Winogrande
  • Standard SuperGLUE benchmark: BoolQ, CB, COPA, MultiRC, ReCoRD, RTE, WiC, WSC
  • Out-of-distribution generalization: MathQA, LAMBADA

Key Insights and Ideas

  • Redundancy in Large Models: The most striking finding is the significant redundancy in large LLMs for in-context learning. A substantial portion of attention heads and FFNs can be removed without a major hit to performance. This challenges the "bigger is always better" intuition for ICL.
  • Specialized Components for ICL: The research suggests that a core subset of attention heads and FFNs are disproportionately responsible for in-context learning capabilities. This implies that ICL might not be a uniformly distributed emergent property but rather relies on specific architectural elements.
  • Generality of Induction Heads: The study provides evidence that "induction heads," which perform basic operations like prefix matching and copying, are indeed important for in-context learning. Crucially, these induction heads show overlap with the task-specific important heads, suggesting they contribute to more complex ICL behaviors.
  • Potential for Undertraining: The findings hint that large models might be "undertrained" for in-context learning. If only a fraction of the model is actively used for ICL, it raises questions about how to better train models to leverage their full capacity for this capability.

Key Results

  • Attention Heads: Up to ~70% of attention heads could be removed with minimal decline in task performance.
  • Feed-Forward Networks (FFNs): Up to ~20% of FFNs could be removed with minimal decline in task performance.
  • Component Overlap: There was substantial overlap in the set of attention heads deemed important across different tasks and few-shot settings, indicating a degree of task-agnosticism in ICL components.
  • Induction Heads: A small set of attention heads demonstrated non-trivial scores for prefix matching and copying, and these "induction heads" overlapped with task-specific important heads.

Limitations and Future Work

  • Pruning Strategy: The study used a greedy pruning approach, which the authors acknowledge might be sub-optimal compared to more sophisticated methods.
  • Focus on OPT-66B: While a large model, the findings are specific to the OPT-66B architecture and may not generalize perfectly to all LLMs.
  • Future Work: The authors suggest exploring auxiliary pre-training objectives specifically designed to enhance the formation and strength of induction heads. They also propose investigating and improving pre-training regimes to increase the number of important model components for a wider range of downstream tasks. Replicating the study with instruction-tuned models is also a promising direction.

Summary updated

BibTeX
@inproceedings{bansal2023rethinking,
  author = {Hritik Bansal and Karthik Gopalakrishnan and Saket Dingliwal and Sravan Bodapati and Katrin Kirchhoff and Dan Roth},
  title = {{Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.660},
}
Figure