Elamur Research
☰
home / papers / 2020 / Pretrained Transformers Improve Out-of-Distribution Robustness

Pretrained Transformers Improve Out-of-Distribution Robustness

Written for the Research library (claude-opus-5-5) from the paper text, in our own words: the license "arXiv — non-exclusive licence to distribute" does not allow redistributing the text itself. Original — arxiv.org/pdf/2004.06100

Summary

NLP models are usually evaluated on test data from the same distribution as their training data, so it is unclear how they cope when writing style, topic or vocabulary changes. Hendrycks et al. build a robustness benchmark by re-splitting seven existing datasets along their metadata (cuisine, product category, genre, news source) or by pairing related corpora. The benchmark covers sentiment, entailment, reading comprehension and semantic similarity. They compare thirteen models: bag-of-words, word2vec and GloVe encoders (averaging, LSTM, ConvNet), DocQA, and pretrained Transformers (BERT, RoBERTa, ALBERT, DistilBERT). Robustness is measured in two ways: accuracy under distribution shift, and the ability to flag anomalous inputs using the classifier's top softmax probability. Pretrained Transformers lose much less performance on shifted data and consistently beat chance at anomaly detection, which older models often fail to do. Making models larger does not shrink the gap, distillation tends to hurt, and broader pretraining data helps. The work matters because in-distribution scores, including those used to validate compressed models, can hide weaknesses that appear in deployment.

Key points

  • Benchmark splits. The benchmark draws on these datasets and splits:
    • SST-2 ↔ IMDb.
    • Yelp, split by cuisine: American, Chinese, Italian and Japanese.
    • Amazon, split into clothing categories plus Music and Movies, with 50,000 reviews per category.
    • STS-B, split by source: MSRpar, Headlines, MSRvid and Images.
    • ReCoRD, split into CNN and Daily Mail.
    • MNLI, split by genre: Telephone, Face-to-Face and Letters.
  • STS-B shift. On STS-B, an LSTM's score fell by more than 35% under shift, while RoBERTa's score slightly rose.
  • MNLI stability. When BERT Base is fine-tuned only on MNLI's Telephone genre, its accuracy holds steady across genres: 81.4% IID, 82.3% on Letters and 80.8% on Face-to-Face.
  • OOD detection. Detection was scored with FAR95 for SST-2 classifiers, using 20 Newsgroups, Multi30K, RTE, SNLI and WMT16 as outlier sources. Non-pretrained models were near or below chance, with false alarm rates close to 100% on 20 Newsgroups.
  • Model scale and pretraining data. Bigger BERT and ALBERT variants did not narrow the IID/OOD gap, and DistilBERT was less robust. RoBERTa, pretrained on more data, outperformed BERT Large. Data volume alone does not explain the advantage, though: GloVe saw about 840B tokens, whereas BERT saw about 3B.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

Fields: Other

Cited by

144 papers of our library cite it (of the 140673 whose bibliographies we read); 10 of them have a page here, 134 not yet.

Cite

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2004.06100 · arXiv 2004.06100

@misc{hendrycks2020pretrained,
  title = {{Pretrained Transformers Improve Out-of-Distribution Robustness}},
  author = {Hendrycks, Dan and Liu, Xiaoyuan and Wallace, Eric and Dziedzic, Adam and Krishnan, Rishabh and Song, Dawn},
  year = {2020},
  doi = {10.48550/arxiv.2004.06100},
  eprint = {2004.06100},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2004.06100}
}

References

60 references, 9 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. John Blitzer, Mark Dredze, and Fernando Pereira. 2007. Biographies, bollywood, boom-boxes and blenders: Domain adaptation for sentiment classification. In ACL. find
  2. Samuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. 2015. A large annotated corpus for learning natural language inference. In EMNLP. find
  3. Zheng Cai, Lifu Tu, and Kevin Gimpel. 2017. Pay attention to the ending: Strong neural baselines for the roc story cloze task. In ACL. find
  4. Dallas Card, Michael Zhang, and Noah A. Smith. 2018. Deep weighted averaging classifiers. In FAT. find
  5. Daniel Cer, Mona Diab, Eneko Agirre, Inigo Lopez-Gazpio, and Lucia Specia. 2017. SemEval-2017 Task 1: Semantic textual similarity-multilingual and cross-lingual focused evaluation. In SemEval. find
  6. Christopher Clark and Matt Gardner. 2018. Simple and effective multi-paragraph reading comprehension. In ACL. find our card
  7. Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The PASCAL recognising textual entailment challenge. In Machine Learning Challenges Workshop. find
  8. Hal Daumé III. 2007. Frustratingly easy domain adaptation. In ACL. find
  9. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT. find
  10. Desmond Elliott, Stella Frank, Khalil Sima’an, and Lucia Specia. 2016. Multi30k: Multilingual english-german image descriptions. In ACL. find our card
  11. Andrew Emmott, Shubhomoy Das, Thomas G. Dietterich, Alan Fern, and Weng-Keen Wong. 2015. A meta-analysis of the anomaly detection problem. find
  12. Shi Feng, Eric Wallace, and Jordan Boyd-Graber. 2019. Misleading failures of partial-input baselines. In ACL. find
  13. Shi Feng, Eric Wallace, II Grissom, Mohit Iyyer, Pedro Rodriguez, and Jordan Boyd-Graber. 2018. Pathologies of neural models make interpretations difficult. In EMNLP. find
  14. Adam Fisch, Alon Talmor, Robin Jia, Minjoon Seo, Eunsol Choi, and Danqi Chen. 2019. Proceedings of the 2nd workshop on machine reading for question answering. In MRQA Workshop. find
  15. Daniel Fried, Nikita Kitaev, and Dan Klein. 2019. Cross-domain generalization of neural constituency parsers. In ACL. find our card
  16. Prakhar Ganesh, Yao Chen, Xin Lou, Mohammad Ali Khan, Yin Yang, Deming Chen, Marianne Winslett, Hassan Sajjad, and Preslav Nakov. 2020. Compressing large-scale transformer-based models: A case study on BERT. ArXiv, abs/2002.11985. find
  17. Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F. Liu, Matthew Peters, Michael Schmitz, and Luke S. Zettlemoyer. 2018. AllenNLP: a deep semantic natural language processing platform. In Workshop for NLP Open Source Software. find our card
  18. Justin Gilmer, Ryan P. Adams, Ian J. Goodfellow, David Andersen, and George E. Dahl. 2018. Motivating the rules of the game for adversarial example research. ArXiv, abs/1807.06732. — [arXiv:1807.06732](https://arxiv.org/abs/1807.06732) find
  19. Suchin Gururangan, Swabha Swayamdipta, Omer Levy, Roy Schwartz, Samuel R. Bowman, and Noah A. Smith. 2018. Annotation artifacts in natural language inference data. In NAACL-HLT. find
  20. Zellig S Harris. 1954. Distributional structure. Word. find
  21. Ruining He and Julian J. McAuley. 2016. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In WWW. find
  22. Dan Hendrycks and Thomas Dietterich. 2019. Benchmarking neural network robustness to common corruptions and perturbations. In ICLR. find
  23. Dan Hendrycks and Kevin Gimpel. 2016. Gaussian error linear units (GELUs). arXiv preprint arXiv:1606.08415. find
  24. Dan Hendrycks and Kevin Gimpel. 2017. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR. find
  25. Dan Hendrycks, Kimin Lee, and Mantas Mazeika. 2019a. Using pre-training can improve model robustness and uncertainty. ICML. find
  26. Dan Hendrycks, Mantas Mazeika, and Thomas G. Dietterich. 2019b. Deep anomaly detection with outlier exposure. ICLR. find
  27. Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. 2019c. Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS. find
  28. Dan Hendrycks, Norman Mu, Ekin D. Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. 2020. AugMix: A simple data processing method to improve robustness and uncertainty. ICLR. find
  29. Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. 2019d. Natural adversarial examples. ArXiv, abs/1907.07174. — [arXiv:1907.07174](https://arxiv.org/abs/1907.07174) find
  30. Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. In Neural Computation. find
  31. Robin Jia and Percy Liang. 2017. Adversarial examples for evaluating reading comprehension systems. In EMNLP. find our card
  32. Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, and Radu Soricut. 2020. ALBERT: a lite BERT for self-supervised learning of language representations. In ICLR. find
  33. Ken Lang. 1995. NewsWeeder: Learning to filter Netnews. In ICML. find
  34. Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. 2018. Training confidence-calibrated classifiers for detecting out-of-distribution samples. In ICLR. find
  35. Zhuohan Li, Eric Wallace, Sheng Shen, Kevin Lin, Kurt Keutzer, Dan Klein, and Joseph E Gonzalez. 2020. Train large, then compress: Rethinking model size for efficient training and inference of transformers. ArXiv, abs/2002.11794. — [arXiv:2002.11794](https://arxiv.org/abs/2002.11794) find
  36. Nelson F Liu, Roy Schwartz, and Noah A Smith. 2019a. Inoculation by fine-tuning: A method for analyzing challenge datasets. In NAACL. find
  37. Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019b. RoBERTa: A robustly optimized BERT pretraining approach. ArXiv, abs/1907.11692. find
  38. Andrew L Maas, Raymond E Daly, Peter T Pham, Dan Huang, Andrew Y Ng, and Christopher Potts. 2011. Learning word vectors for sentiment analysis. In ACL. find our card
  39. Julian J. McAuley, Christopher Targett, Qinfeng Shi, and Anton van den Hengel. 2015. Image-based recommendations on styles and substitutes. In SIGIR. find
  40. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed representations of words and phrases and their compositionality. In NIPS. find
  41. Sewon Min, Eric Wallace, Sameer Singh, Matt Gardner, Hannaneh Hajishirzi, and Luke Zettlemoyer. 2019. Compositional questions do not necessitate multi-hop reasoning. In ACL. find
  42. Aakanksha Naik, Abhilasha Ravichander, Norman Sadeh, Carolyn Rose, and Graham Neubig. 2018. Stress test evaluation for natural language inference. In COLING. find
  43. A. Emin Orhan. 2019. Robustness properties of facebook’s ResNeXt WSL models. ArXiv, abs/1907.07640. — [arXiv:1907.07640](https://arxiv.org/abs/1907.07640) find
  44. Jeffrey Pennington, Richard Socher, and Christopher D. Manning. 2014. GloVe: Global vectors for word representation. In EMNLP. find
  45. Joaquin Quionero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D. Lawrence. 2009. Dataset shift in machine learning. find
  46. Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. 2018. Semantically equivalent adversarial rules for debugging NLP models. In ACL. find
  47. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019. DistilBERT, a distilled version of bert: smaller, faster, cheaper and lighter. In NeurIPS EMC 2 Workshop. find
  48. Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. 2020. Q-BERT: Hessian based ultra low precision quantization of BERT. find
  49. Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP. find
  50. Antonio Torralba and Alexei A. Efros. 2011. Unbiased look at dataset bias. CVPR. find
  51. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NIPS. find
  52. Eric Wallace, Shi Feng, Nikhil Kandpal, Matthew Gardner, and Sameer Singh. 2019. Universal adversarial triggers for attacking and analyzing NLP. In EMNLP. find
  53. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019. GLUE: A multitask benchmark and analysis platform for natural language understanding. In ICLR. find
  54. John Wieting, Mohit Bansal, Kevin Gimpel, and Karen Livescu. 2016. Towards universal paraphrastic sentence embeddings. In ICLR. find our card
  55. Adina Williams, Nikita Nangia, and Samuel R Bowman. 2018. A broad-coverage challenge corpus for sentence understanding through inference. In NAACL-HLT. find
  56. Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pier-ric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, and Jamie Brew. 2019. HuggingFace’s Transformers: State-of-the-art natural language processing. ArXiv, abs/1910.03771. find our card
  57. Cihang Xie and Alan L. Yuille. 2020. Intriguing properties of adversarial training at scale. In ICLR. find
  58. Qizhe Xie, Eduard H. Hovy, Minh-Thang Luong, and Quoc V. Le. 2020. Self-training with noisy student improves imagenet classification. In CVPR. find
  59. Dani Yogatama, Cyprien de Masson d’Autume, Jerome Connor, Tomás Kociský, Mike Chrzanowski, Lingpeng Kong, Angeliki Lazaridou, Wang Ling, Lei Yu, Chris Dyer, and Phil Blunsom. 2019. Learning and evaluating general linguistic intelligence. ArXiv, abs/1901.11373. find
  60. Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. 2018. ReCoRD: bridging the gap between human and machine commonsense reading comprehension. arXiv, abs/1810.12885. find our card