NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learning to select data for transfer learning with Bayesian Optimization

Sebastian Ruder, Barbara Plank

Introduction

Natural Language Processing (NLP) models are notoriously fragile. A model trained on news articles often fails when applied to social media posts due to "domain shift." While domain adaptation techniques attempt to bridge the gap between source and target domains, most research focuses on simple one-to-one scenarios. In practice, researchers often have access to massive pools of multi-source data, leading to a critical challenge: data selection.

Historically, data selection relied on ad hoc similarity measures, such as word overlap, which are often too rigid to account for task-specific nuances. This paper introduces the first model-agnostic approach to automatically learn how to select the best training data for transfer learning by using Bayesian Optimization to weigh various similarity and diversity metrics.

Methodology

The authors propose a framework to learn a data selection measure ($S$) as a linear combination of features: $$S = \phi(X) \cdot w^T$$ Where $\phi(X)$ represents a vector of data metrics and $w$ represents the weights to be learned. The "secret sauce" of this approach is the integration of two distinct metric types:

  1. Similarity Metrics: These measure how close a source example is to the target domain using Jensen-Shannon divergence or Cosine similarity across word counts, topics, or embeddings.
  2. Diversity Metrics: These measure the internal richness of the training data (e.g., type-token ratio, entropy). Diversity prevents the model from selecting redundant examples that offer little new information.

Bayesian Optimization (BO)

Because training a model is a "black box"—meaning one cannot easily calculate a gradient from final accuracy back to data selection weights—the authors employ Bayesian Optimization. BO is an iterative strategy used to find the global optimum of expensive-to-evaluate functions. It uses a Gaussian Process to model performance and identifies the next set of weights ($w$) to test based on where it expects the most improvement.

Experimental Setup

The approach was evaluated across three distinct NLP tasks: Sentiment Analysis (Amazon reviews), Part-of-Speech (POS) Tagging, and Dependency Parsing (SANCL 2012 dataset). The datasets represent a wide variety of domains and data scales.

Summary of datasets used for sentiment analysis and POS/Parsing tasks.

Key Insights and Results

The Importance of Diversity

A central finding of the research is that similarity alone is insufficient for robust transfer. A training set must be diverse to provide a strong learning signal. The authors found that combining similarity and diversity features consistently yielded the best results, outperforming traditional hand-crafted methods.

Comparison of development accuracy across different data selection metrics over Bayesian Optimization iterations.

Performance and Efficiency

  • Superior Accuracy: The learned measures outperformed all baselines, including random selection and fixed similarity metrics. In sentiment analysis, the combination of similarity and diversity features improved accuracy by 2–6 percentage points over standard baselines.
  • Model-Agnosticism: The selection measure is independent of the final model. Weights can be learned using a computationally "cheap" proxy model (like a simple Perceptron) and then applied to select data for heavy state-of-the-art models (like a Bi-LSTM).
  • Quality Over Quantity: The paper demonstrates the "More Data Fallacy": training on all available source data (e.g., 6,000 examples) often performs worse than training on a carefully selected subset (e.g., 1,600 examples).

Conclusion

This work demonstrates that data selection is a learnable task that significantly impacts transfer learning performance. While the method currently requires a small validation set (approx. 100 labeled target examples) to guide the optimization, it offers a robust, automated alternative to manual feature engineering. Future work may explore allowing the algorithm to dynamically determine the optimal number of examples to select, further refining the balance between data quality and quantity.

Summary updated

BibTeX
@inproceedings{ruder2017learning,
  author = {Sebastian Ruder and Barbara Plank},
  title = {{Learning to select data for transfer learning with Bayesian Optimization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2017},
  doi = {10.18653/v1/d17-1038},
}
Figure