Unsupervised Transfer Learning via BERT Neuron Selection

Mehrdad Valipour, En-Shiun Annie Lee, Jaime R. Jamacaro, Carolina BessegaarXiv 2019

Researchers from Stradigi AI have introduced a novel approach to making large-scale language models like BERT more efficient and interpretable for transfer learning. By identifying specific "neurons"—individual dimensions in the embedding space—that are most relevant to a given task, they demonstrate that the full weight of BERT's millions of parameters is often unnecessary for high-performance unsupervised transfer.

The Problem: Model Massiveness

Large language models (LLMs) such as BERT present a "massiveness" problem. Their hundreds of millions of parameters make them computationally expensive to fine-tune and prone to overfitting or "negative transfer" when moving from a label-rich source domain to a label-scarce target domain. The authors hypothesize that linguistic information is not distributed equally; instead, specific neurons do the heavy lifting for particular tasks.

Methodology: SingleTSNS and MultiTSNS

The authors propose two primary algorithms for identifying these task-critical neurons:

  1. SingleTSNS (Single-source Task-Specific Neuron Selection): This method employs a Random Forest classifier as a "neuron-importance learner." By analyzing the outputs of all BERT layers, it ranks neurons based on their contribution to solving a classification task. Stability is achieved by repeating this process via random sampling and accumulating the importance metrics.
  2. MultiTSNS (Multi-source Task-Specific Neuron Selection): This extension aggregates importance metrics from multiple disjoint data sources using a meta-aggregator. This ensures that the selected neurons are generalizable across domains rather than overfitted to a single dataset.
The MultiTSNS architecture aggregates neuron importance from multiple sources to identify generalizable task-specific neurons.

Task-Specific Fingerprints

A key innovation of this research is the concept of a "fingerprint"—the percentage of selected neurons found in each of BERT's 24 layers. These fingerprints provide a visual signature of where specific linguistic "intelligence" resides within the model.

Analysis of these fingerprints revealed that different tasks activate distinct regions of the model:

  • Sentiment Analysis: Primarily activates the last six layers, contradicting some previous assumptions that lower layers are better for general transfer.
  • NLI and Sentence Similarity: These tasks show the highest significance in the middle layers.
Heatmap of task-specific fingerprints showing how different NLP tasks utilize different layers of the BERT architecture.

Key Results and Insights

The study found that fingerprint similarity is a strong predictor of transferability. For instance, the activation patterns for "Books" and "DVD" reviews are nearly identical, explaining why they transfer knowledge so effectively between one another.

Furthermore, the researchers discovered that efficiency can be achieved through sparsity. Selecting only 500 to 700 neurons (out of tens of thousands) often yielded better performance than using the entire last layer of BERT.

  • Sentiment Analysis: SingleTSNS improved accuracy by an average of 1.1% over existing literature and 4.1% over standard BERT baselines.
  • Multi-Source Gains: MultiTSNS provided a 3.0% average improvement over using just last-layer neurons.
  • NLI and Similarity: The method achieved gains of up to 13.0% over BERT baselines when transferring to the SciTail dataset by combining multiple NLI sources.

Conclusion

By treating BERT not as a monolithic block but as a collection of specialized neurons, this approach enables more efficient unsupervised transfer learning. While currently focused on classification, future work may extend these "fingerprinting" techniques to sequence labeling and other transformer architectures like GPT or RoBERTa.

Summary updated

BibTeX
@misc{valipour2019unsupervised,
  author = {Mehrdad Valipour and En-Shiun Annie Lee and Jaime R. Jamacaro and Carolina Bessega},
  title = {{Unsupervised Transfer Learning via BERT Neuron Selection}},
  year = {2019},
  eprint = {1912.05308},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.05308},
}
Figure