Skip to main content
QUICK REVIEW

[Paper Review] Pretrained Transformers Improve Out-of-Distribution Robustness

Dan Hendrycks, Xiaoyuan Liu|arXiv (Cornell University)|Apr 13, 2020
Topic ModelingComputer Science55 references25 citations
TL;DR

This paper evaluates the out-of-distribution (OOD) robustness of NLP models across seven datasets using a new benchmark with realistic distribution shifts. Pretrained Transformers like RoBERTa show significantly smaller performance drops on OOD data and outperform older models in both OOD generalization and detection, with AUROC scores up to 88.7% compared to chance levels for non-pretrained models.

ABSTRACT

Although pretrained Transformers such as BERT achieve high accuracy on in-distribution examples, do they generalize to new distributions? We systematically measure out-of-distribution (OOD) generalization for seven NLP datasets by constructing a new robustness benchmark with realistic distribution shifts. We measure the generalization of previous models including bag-of-words models, ConvNets, and LSTMs, and we show that pretrained Transformers' performance declines are substantially smaller. Pretrained transformers are also more effective at detecting anomalous or OOD examples, while many previous models are frequently worse than chance. We examine which factors affect robustness, finding that larger models are not necessarily more robust, distillation can be harmful, and more diverse pretraining data can enhance robustness. Finally, we show where future work can improve OOD robustness.

Motivation & Objective

  • To systematically evaluate the out-of-distribution (OOD) robustness of NLP models across diverse tasks and data shifts.
  • To measure how well models generalize to OOD examples and detect anomalous inputs, moving beyond standard in-distribution evaluation.
  • To identify factors influencing OOD robustness, such as model size, distillation, and pretraining data diversity.
  • To benchmark the performance of bag-of-words, LSTMs, ConvNets, and pretrained Transformers on realistic OOD shifts.
  • To provide insights into where future work can improve OOD robustness in NLP.

Proposed method

  • Constructed a new OOD robustness benchmark by splitting datasets using metadata or pairing similar datasets from different data-generating processes.
  • Used distribution shifts across writing style, topic, and vocabulary in sentiment analysis, textual entailment, question answering, and semantic similarity tasks.
  • Evaluated OOD generalization using accuracy drops on held-out test sets from different data splits or paired datasets.
  • Measured OOD detection performance using maximum softmax probability as an anomaly score, reporting AUROC and FAR95 metrics.
  • Trained and tested 13 models across three input representations (BoW, word2vec, GloVe) and four encoder types (LSTM, ConvNet, BERT, RoBERTa).
  • Compared models across diverse pretraining data, model size, and distillation to isolate robustness factors.

Experimental results

Research questions

  • RQ1How do pretrained Transformers compare to non-pretrained models in generalizing to out-of-distribution examples?
  • RQ2To what extent can NLP models detect anomalous or OOD inputs using confidence scores?
  • RQ3Does increasing model size or distillation improve OOD robustness?
  • RQ4How does pretraining on diverse data affect OOD generalization and detection?
  • RQ5What are the key factors that influence OOD robustness in NLP models?

Key findings

  • Pretrained Transformers like RoBERTa showed minimal performance drop on OOD examples—accuracy increased slightly on semantic similarity tasks—while LSTM models dropped by over 35%.
  • On the SST-2/IMDb sentiment benchmark, RoBERTa achieved 91.0% accuracy on OOD test sets, compared to 85.0% for BERT Base and 82.4% for the BoW model.
  • For OOD detection, RoBERTa achieved an AUROC of 88.7%, significantly above the 50% random chance level, while non-pretrained models often performed near or below chance.
  • Distillation was found to be harmful to OOD robustness, with DistilBERT showing lower detection performance than BERT Base.
  • Larger models were not necessarily more robust; instead, pretraining on more diverse data improved OOD generalization.
  • Even though RoBERTa outperformed others, the study found substantial room for future improvement, especially in detection performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.