Source-linked AI summary

Variational Pretraining for Semi-supervised Text Classification

Suchin Gururangan, Tam Dang, Dallas Card, Noah A. Smith

arXiv:1906.02242v1cs.CLcs.LG

TL;DR

Semi-supervised text classification is challenging when labels, in-domain data, or computation are limited. The paper introduces VAMPIRE, a lightweight variational document-model pretraining approach that uses unlabeled data and internal representations for classification. Domain-fine-tuned BERT achieves the best results, while VAMPIRE offers comparable or better performance than alternatives when BERT is not an option.

  • Problem

    The paper addresses semi-supervised text classification when labels, computation, or suitable out-of-domain data are limited, despite the availability of unlabeled data.

    Source: §1 · p. 1, §2.1 · p. 2
  • Method

    VAMPIRE pretrains a variational document model on unlabeled data and uses its internal representations in a downstream classifier.

    Source: §1 · p. 1, §3 · p. 3
  • Results

    Fine-tuned BERT provides the best results, while VAMPIRE matches or exceeds alternatives with minimal computation when BERT is unavailable, especially with few labeled instances.

    Source: §1 · pp. 1–2
  • Takeaways & Limitations

    VAMPIRE is a competitive lightweight pretraining alternative when computational limits or the absence of a relevant pretrained model make BERT difficult to use.

    Source: §9 · p. 9

    The authors leave experimentation with multi-sample approximations, such as importance sampling, to future work.

    Source: §3.1 · p. 3

Abstract

from arXiv · show

We introduce VAMPIRE, a lightweight pretraining framework for effective text classification when data and computing resources are limited. We pretrain a unigram document model as a variational autoencoder on in-domain, unlabeled data and use its internal states as features in a downstream classifier. Empirically, we show the relative strength of VAMPIRE against computationally expensive contextual embeddings and other popular semi-supervised baselines under low resource settings. We also find that fine-tuning to in-domain data is crucial to achieving decent performance from contextual embeddings when working with limited supervision. We accompany this paper with code to pretrain and use VAMPIRE embeddings in downstream tasks.

1 Introduction

The paper targets semi-supervised text classification where labels, data, and computation are limited, proposing VAMPIRE as a lightweight pretraining approach. It reports that domain-fine-tuned BERT performs best, while VAMPIRE can match or exceed alternatives when that option is unavailable.

  • VAMPIRE combines variational document modeling with language-model pretraining insights, using bag-of-words input to reduce sequence-model costs while learning downstream representations.The paper also reports that topic coherence is a better model-selection criterion for downstream classification than validation-set perplexity.Source: §1 · p. 1
  • The evaluation compares VAMPIRE on four text-classification datasets against self-training, in-domain representation-learning methods, and contextual embeddings, including fine-tuned models.The experiments vary the amount of labeled data.Source: §1 · p. 1
  • When domain-fine-tuned BERT is unavailable, VAMPIRE matches or exceeds alternatives with minimal computation, especially with limited labeled data.The authors report that fine-tuned BERT provides the best results when available.Source: §1 · pp. 1–2
  • The paper adapts variational document models to modern pretraining for semi-supervised classification and highlights model-selection criteria as a contribution.Source: §1 · p. 2
  • The authors identify fine-tuning contextual embeddings as essential for document classification and offer practical advice for using unlabeled data.Source: §1 · p. 2
  • The authors release code for pretraining variational models on unlabeled data and using their learned representations in downstream tasks.Source: §1 · p. 2

2 Background

The background frames low-resource NLP around limited access to labels, in-domain data, and computation. It contrasts resource-intensive contextual and sequence-based approaches with faster neural document models as a potential semi-supervised alternative.

2.1 Resource-limited Environments

  • Low-resource settings involve constraints on computation, labels, and out-of-domain data; data and computational availability also vary across languages and domains.Limited labels may require expensive expert annotation, while incorporating contextual embeddings can be prohibitively expensive for researchers with scarce computation.Source: §2.1 · p. 2
  • The paper seeks an approach that uses in-domain unlabeled data, works with few labels, and runs efficiently on a CPU.Source: §2.1 · p. 2

2.2 Semi-supervised Learning

3 Model

The model assumes labeled documents and a larger unlabeled set from the same distribution, then uses a pretrained document model’s learned representations in a supervised classifier. Its VAE reconstructs word-frequency representations, selects pretraining checkpoints using topic coherence, and contributes internal states to downstream classification.

3 Model

  • Documents have labeled and unlabeled examples from the same distribution, and the goal is to learn a probabilistic classifier p(y | x).The model pretrains on unlabeled documents before using learned representations in supervised learning.Source: §3 · pp. 2–3, §3.1 · p. 3

3.1 Unsupervised Pretraining

  • The VAE maps word counts to latent representations and reconstructs word-frequency inputs with a softmax decoder, avoiding sequence-based inference and enabling a lightweight unigram model.Its latent topic distribution is interpreted through a softmax.Source: Figure 1 · p. 3, §3.1 · p. 4

3.2 Model Selection via Topic Coherence

  • NPMI topic coherence or log likelihood can guide early stopping; NPMI is averaged across topics and training stops when it ceases increasing for a preset number of epochs.Topic coherence is considered because optimizing an unlabeled objective to convergence may not yield the best downstream representations.Source: §3.2 · p. 4

3.3 Using a Pretrained VAE for Text Classification

  • The downstream classifier learns a weighted combination of the VAE’s topic representation and encoder states, concatenated with sequence-to-vector representations.The combination uses softmax-normalized trainable weights; joint training and combined approaches did not reliably improve on pretraining.Source: §3.3 · p. 4

3.4 Optimization

  • Training uses Adam, reconstruction batch normalization, and KL annealing; the feedforward architecture can be parallelized and run efficiently on CPUs or GPUs.The KL weight increases gradually from zero to one.Source: §3.4 · p. 5

4 Experimental Setup

Experiments compare text classifiers across four datasets and labeled-data amounts, assuming access to tens of thousands of unlabeled in-domain examples. The setup spans lightweight and high-resource baselines, with a Deep Averaging Network as the baseline sequence encoder.

4 Experimental Setup

  • Experiments vary labeled training data from 200 to 10,000 instances and assume 75,000 to 125,000 unlabeled in-domain examples, reporting mean test performance across five random seeds.Each seed uses a different labeled sample.Source: §4 · p. 5

4.1 Datasets and Preprocessing

  • The four classification datasets are AG News, IMDB, YAHOO! Answers, and tweets labeled across four HATESPEECH categories.Evaluation uses official test sets or stratified 25,000-document test samples, plus 5,000 validation instances.Source: §4.1 · p. 5

4.2 VAMPIRE Architecture

  • For each dataset, random search selects the VAMPIRE pretraining model with the best NPMI for downstream classification.Hyperparameter sampling bounds and final assignments are reported in Appendix A.1.Source: §4.2 · p. 5

4.3 Downstream Classifiers

  • The baseline downstream encoder is a Deep Averaging Network that sums token embeddings and passes them through a multilayer perceptron.Preliminary experiments found one-layer MLPs with moderate dropout more reliable on validation data than CNNs or LSTMs, especially with few labels.Source: §4.3 · p. 5

4.4 Resources and Baselines

  • Low-resource comparisons include supervised and GloVe models and self-training; high-resource comparisons include frozen or fine-tuned ELMo and BERT, plus in-domain-only ELMo.The low-resource setting assumes limited computational resources, while high-resource models use plentiful compute and large out-of-domain data.Source: §4.4 · pp. 5–6

5 Results

VAMPIRE performs best among the considered low-resource methods, especially with little labeled data, while in high-resource settings fine-tuned BERT performs best. Across settings, the results highlight the importance of unlabeled in-domain data.

5 Results

  • VAMPIRE achieves the highest accuracy among the considered low-resource methods, especially when labeled data are scarce.Table 2 reports test accuracies across four datasets and training sets of 200, 500, 2,500, and 10,000 documents.Source: §5 · p. 6, Table 2 · p. 7
  • Fine-tuning pretrained BERT to in-domain data provides the best performance in the high-resource setting.Frozen off-the-shelf BERT and ELMO perform poorly relative to domain adaptation, especially on HATESPEECH and IMDB.Source: §5 · pp. 6–7
  • For HATESPEECH and IMDB, ELMO trained on in-domain data performs far better than frozen off-the-shelf ELMO.The difference between these approaches is smaller for YAHOO! and AG.Source: §5 · p. 7
  • The results indicate that unlabeled in-domain data is important for fine-tuning pretrained language models in high-resource settings and training VAMPIRE in low-resource settings.The paper contrasts these uses with the gains from pretraining on large amounts of web text over purely supervised models.Source: §5 · p. 7

6 Analysis

The analysis favors NPMI for selecting VAMPIRE checkpoints, describes the learned topics and classifier layer preferences, and reports substantially lower computational requirements than ELMO.

6.1 NPMI versus NLL as Stopping Criteria

  • Better pretrained VAMPIRE models tend to yield better downstream performance, while NPMI and NLL values are negatively correlated (ρ = –0.72).Downstream performance correlations are ρ = 0.55 for NPMI and ρ = –0.53 for NLL.Source: §6.1 · pp. 7–8
  • NPMI-selected VAMPIRE models have lower variance in downstream accuracy than NLL-selected models, making NPMI the preferred selection criterion.The comparison uses 200 labeled IMDB documents; all VAMPIRE results in Table 2 use NPMI-selected models.Source: §6.1 · p. 8, Figure 4 · p. 8

6.2 Learned Latent Topics

  • VAMPIRE’s document representations can be interpreted in terms of topics, which help summarize what pretraining learned.The paper provides example topics from IMDB and YAHOO!.Source: §6.2 · p. 8, Table 3 · p. 8

6.3 Learned Scalar Layer Weights

  • The classifier consistently upweights the VAE’s first encoder layer and θ, and initializing their scalar weights highly improves validation performance, especially in low-resource settings.The intermediate encoder layers are downweighted, although using a multi-layer encoder yields larger downstream gains.Source: §6.3 · p. 8

6.4 Computational Requirements

  • VAMPIRE can be trained orders of magnitude faster than ELMO, including without expensive hardware.On a GPU, VAMPIRE uses about 750MB of memory compared with ELMO’s 8.5GB for the reported IMDB pretraining setup.Source: §6.4 · p. 9, Table 4 · p. 9

7 Related Work

Related work spans semi-supervised learning, active learning, and data augmentation; the paper notes that these approaches could be combined with its methods.

7 Related Work

  • Prior limited-label work found deep-model pretraining and fine-tuning important for semi-supervised speech recognition, and reported large gains from adversarial pretraining.Dataless classification uses category names as the only supervision.Source: §7 · p. 9
  • Active learning seeks to maximize performance when labels are costly, while data augmentation work includes back translation and tf-idf word replacement.Source: §7 · p. 9
  • The paper states that these prior approaches could be productively combined with its proposed methods.Source: §7 · p. 9

8 Recommendations

The recommendations depend on resource availability: use fine-tuned pretrained models when resources are ample, and consider VAMPIRE when labels or computation are limited but unlabeled data is plentiful.

8 Recommendations

  • With unlimited resources, pretrained models such as BERT currently give the best results, and fine-tuning to in-domain data is critically important.Source: §8 · p. 9
  • When computation and annotations are limited but unlabeled data is plentiful, VAMPIRE offers large gains over other low-resource approaches.Source: §8 · p. 9
  • Training ELMO only on in-domain data can match or somewhat outperform VAMPIRE, but may be prohibitively expensive without GPUs.Source: §8 · p. 9
  • With tens of thousands of labeled instances, the advantages of additional unlabeled data become negligible, though other NLP tasks may have different tradeoffs.Source: §8 · p. 9

9 Conclusions

The paper concludes that contextual models benefit from in-domain fine-tuning, while VAMPIRE offers a lightweight alternative when BERT or the resources to fine-tune it are unavailable. It also describes the hyperparameter search used to choose model configurations.

9 Conclusions

  • With limited labels, VAMPIRE beats self-training and out-of-domain word vectors and approaches in-domain ELMO at a fraction of the computational cost.The authors position it as an alternative when BERT cannot readily be used because of computational limits or the absence of an appropriate pretrained model in the relevant language.Source: §9 · p. 9

A Hyperparameter Search

  • The appendix describes a hyperparameter search used to choose model configurations.The search section includes plots of validation-performance ranges across settings.Source: A Hyperparameter Search · p. 12

A.1 VAMPIRE Search

  • For VAMPIRE, the search varied hyperparameters across several dimensions, with the assignments reported in Table 5.Source: §A.1 · p. 12

A.2 Classifier Search

The classifier search found that logistic regression and Deep Averaging Network classifiers were more reliable with few labels, while LSTMs had high variance. The authors chose DAN for experiments with pretrained models.

A.2 Classifier Search

  • Under low-resource conditions, logistic regression and DAN were more reliable, while LSTM validation accuracy had extremely high variance.With enough compute, CNNs could be marginally higher, but their accuracy distribution was mostly below those of logistic regression and DAN.Source: §A.2 · p. 12
  • The authors selected DAN for pretrained-model experiments because it combines rich vector representations with reliability and few hyperparameters to tune.The search and manual tuning compared CNN, LSTM, Bag-of-Embeddings, and logistic regression classifiers.Source: §A.2 · p. 12

B Results in the High Resource Setting

In the high-resource results, in-domain ELMO matched or exceeded frozen off-the-shelf models, while fine-tuned BERT generally performed best. The appendix also notes that NPMI can worsen as NLL improves and presents additional YAHOO! topics.

C Further Details on NPMI vs. NLL as Stopping Criteria

B Results in the High Resource Setting

D Additional Learned Topics

Loading 1906.02242v1…