papers / bert2018
Next task →
Research Papers/Transformer and LLM pretraining/BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Transformer and LLM pretraining · #2 · seminal

BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

Jacob Devlin, Ming-Wei Chang, Kenton Lee, Kristina Toutanova · 2018 · arXiv (NAACL 2019)
reproduction difficulty: mediumNLPPretrainingTransformers

1. Research problem

Language representation models were either unidirectional or shallowly concatenated, limiting how context could inform word meaning.

2. Motivation

The authors wanted deep bidirectional pretraining that could be fine-tuned with minimal architecture changes on many language-understanding tasks.

3. Previous approaches

GPT used left-to-right language modeling; ELMo used shallow bidirectional LSTMs; earlier masked language modeling existed only in limited settings.

4. Core contribution

Introduced masked language modeling pretraining over a bidirectional Transformer encoder plus a next-sentence-prediction objective, followed by task-specific fine-tuning.

5. Mathematical formulation

Randomly mask a fraction of input tokens and predict them from bidirectional context; jointly predict whether sentence B follows sentence A; fine-tune all parameters on downstream tasks.

6. Methodology

Pretrain on BooksCorpus and English Wikipedia with a large encoder, then add a small task-specific output layer and fine-tune end to end.

7. Architecture

Transformer encoder stacks (110M-parameter base and 340M-parameter large) with [CLS] and [SEP] special tokens.

8. Experimental setup

GLUE, SQuAD question answering, and SWAG sentence inference.

9. Datasets

BooksCorpus, English Wikipedia, GLUE, SQuAD 1.1/2.0, SWAG.

10. Results

New state of the art on eleven NLP tasks, showing that pretraining plus fine-tuning could replace much task-specific architecture engineering.

11. Limitations

Mask tokens during pretraining never appear during fine-tuning; NSP was later shown unnecessary; encoder-only models are unsuitable for free-form generation.

12. Critical analysis

A decisive demonstration of transfer learning in NLP whose pretraining objectives were later simplified and improved by RoBERTa, T5, and others.

13. Implementation tasks

  • 1.Implement masked language modeling on a small corpus and fine-tune for sentence classification.
  • 2.Compare bidirectional masked prediction with left-to-right prediction on a fill-in-the-blank task.
  • 3.Ablate the next-sentence-prediction objective and measure downstream accuracy.

14. Follow-up work

  • 1.RoBERTa: A Robustly Optimized BERT Pretraining Approach (Liu et al., 2019)
  • 2.T5: Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer (Raffel et al., 2019)

15. Open research questions

  • 1.Does bidirectional pretraining learn fundamentally different features from autoregressive pretraining?
  • 2.How much of BERT's success is due to objective versus data scale?
16. Reproduce it. Record the hypothesis, configuration, dataset, metrics and discrepancies in the Experiment Tracker. A reproduction is not complete until you have run the experiments, performed at least one ablation and documented the differences from the reported numbers.