Domain Adaptation for Sparse-Data Settings: What Do We Gain by Not Using Bert?

Marina Sedinkina, Martin Schmitt, Hinrich SchützearXiv 2022

Abstract

The practical success of much of NLP depends on the availability of training data. However, in real-world scenarios, training data is often scarce, not least because many application domains are restricted and specific. In this work, we compare different methods to handle this problem and provide guidelines for building NLP applications when there is only a small amount of labeled training data available for a specific domain. While transfer learning with pre-trained language models outperforms other methods across tasks, alternatives do not perform much worse while requiring much less computational effort, thus significantly reducing monetary and environmental cost. We examine the performance tradeoffs of several such alternatives, including models that can be trained up to 175K times faster and do not require a single GPU.

Introduction

In the current NLP landscape, the "bigger is better" philosophy has led to the dominance of massive pre-trained language models (PLMs) like BERT. While these models excel on standard benchmarks, their utility in "sparse-data" environments—characterized by scarce labeled data and highly specific domains—remains a critical question. This research evaluates the trade-offs between state-of-the-art accuracy and practical efficiency in such constrained settings.

Problem Definition

Most domain adaptation research assumes a "source-rich" scenario. This study instead focuses on a more challenging "low-resource" scenario defined by:

  1. Absence of labeled source data: No reliance on pre-existing large-scale labeled datasets.
  2. Minimal target data: Only a small number of labeled examples are available for the specific domain.
  3. High Data Sparsity: Datasets are characterized by a high frequency of hapax legomena (words appearing once) and out-of-vocabulary (OOV) terms.

Methodology

The study compares three tiers of models across Sentiment Analysis (SA) and Part-of-Speech (POS) tagging:

  • Heavyweights (PLMs): BERT, RoBERTa, DistilBERT, ALBERT, and Flair.
  • Middleweights (Neural Networks): CNNs and BiLSTMs utilizing generic (GloVe), domain-specific, or domain-adapted embeddings (via KCCA or linear mapping).
  • Lightweights: Bag-of-Words (BoW) with logistic regression for SA and a "Window Approach" for POS tagging.

Datasets and Sparsity

The evaluation uses four benchmarks: Movie Reviews (MR) and Twitter for SA; Twitter and BioNLP for POS tagging. These datasets exhibit significant sparsity, with nearly half of the training vocabulary consisting of hapax legomena, posing a substantial challenge for model generalization.

Lexical richness and sparsity statistics for the benchmark datasets.

Results and Analysis

The Efficacy of Simple Models

For Sentiment Analysis, simple BoW models frequently outperformed more complex neural architectures (CNNs/LSTMs) using domain-adapted embeddings. In sparse settings, the reduced parameter space of "shallow" models prevents the overfitting common in "deep" models when data is insufficient to tune complex parameters.

Finetuning Trade-offs

While finetuning embeddings improved performance for syntactic tasks like POS tagging, it often degraded performance for SA. This suggests that further finetuning on tiny, noisy datasets can be counterproductive if embeddings are already reasonably adapted.

Efficiency and Sustainability

The most significant finding is the massive efficiency gap. While PLMs provide the highest absolute accuracy, the computational cost is orders of magnitude higher.

Performance and efficiency comparison on the Movie Reviews (MR) dataset.

As shown in the results for the MR dataset, BERT achieves 91.2% accuracy compared to BoW's 87.4%. However, the training time ($t_c$) for BoW is a fraction of a second (0.73s) compared to over 42 hours (152,790s) for BERT. In other settings, BoW was found to be up to 175,000 times faster.

Conclusion

While BERT and its variants remain the accuracy leaders, "old-school" methods like BoW and task-specific embeddings are remarkably competitive in sparse-data settings. These alternatives offer a path toward more sustainable and accessible NLP, providing high performance with a fraction of the environmental and financial cost. For many practical applications, the marginal gains of massive transformers may not justify their extreme computational overhead.

Summary updated

BibTeX
@misc{sedinkina2022domain,
  author = {Marina Sedinkina and Martin Schmitt and Hinrich Schütze},
  title = {{Domain Adaptation for Sparse-Data Settings: What Do We Gain by Not Using Bert?}},
  year = {2022},
  eprint = {2203.16926},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.16926},
}
Figure