Paper: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
GLUE score for BERT, a 7.7% point gain over the old best.
Hover, tap or focus a bar to read its exact value.
| Model | Average |
|---|---|
| OpenAI GPT | 75.1 |
| BERT BASE | 79.6 |
| BERT LARGE | 82.1 |
Each task gets its own fine-tuned model, though all start from the same pre-trained weights.
| Model | Layers (L) | Hidden size (H) and heads (A) | Parameters |
|---|---|---|---|
| BERT BASE | 12 | H=768, A=12 | 110M |
| BERT LARGE | 24 | H=1024, A=16 | 340M |
The two model sizes
The feed-forward size is always 4H: 3072 for H=768 and 4096 for H=1024.
The final vector Ti predicts the original token, with cross entropy loss.
Hover, tap or focus a bar to read its exact value.
| Model | Average |
|---|---|
| OpenAI GPT | 75.1 |
| BERT BASE | 79.6 |
| BERT LARGE | 82.1 |
| System | MNLI-(m/mm), 392k | QQP, 363k | QNLI, 108k |
|---|---|---|---|
| Pre-OpenAI SOTA | 80.6/80.1 | 66.1 | 82.3 |
| BiLSTM+ELMo+Attn | 76.4/76.1 | 64.8 | 79.8 |
| OpenAI GPT | 82.1/81.4 | 70.3 | 87.4 |
| BERT BASE | 84.6/83.4 | 71.2 | 90.5 |
| BERT LARGE | 86.7/85.9 | 72.1 | 92.7 |
Table 1 (part 1): MNLI, QQP, QNLI
The number under each task is the count of training examples. QQP uses F1. The others use accuracy.
| System | SST-2, 67k | CoLA, 8.5k | STS-B, 5.7k |
|---|---|---|---|
| Pre-OpenAI SOTA | 93.2 | 35.0 | 81.0 |
| BiLSTM+ELMo+Attn | 90.4 | 36.0 | 73.3 |
| OpenAI GPT | 91.3 | 45.4 | 80.0 |
| BERT BASE | 93.5 | 52.1 | 85.8 |
| BERT LARGE | 94.9 | 60.5 | 86.5 |
Table 1 (part 2): SST-2, CoLA, STS-B
STS-B uses Spearman correlation.
| System | MRPC, 3.5k | RTE, 2.5k | Average |
|---|---|---|---|
| Pre-OpenAI SOTA | 86.0 | 61.7 | 74.0 |
| BiLSTM+ELMo+Attn | 84.9 | 56.8 | 71.0 |
| OpenAI GPT | 82.3 | 56.0 | 75.1 |
| BERT BASE | 88.9 | 66.4 | 79.6 |
| BERT LARGE | 89.3 | 70.1 | 82.1 |
Table 1 (part 3): MRPC, RTE, average
MRPC uses F1. The average leaves out the problematic WNLI set. BERT and GPT are single-model, single-task.
| System | Test EM | Test F1 | Dev EM / Dev F1 |
|---|---|---|---|
| Human | 82.3 | 91.2 | - |
| #1 Ensemble, nlnet | 86.0 | 91.7 | - |
| #2 Ensemble, QANet | 84.5 | 90.5 | - |
| BiDAF+ELMo (Single) | - | 85.8 | - / 85.6 |
| R.M. Reader (Ensemble) | 82.3 | 88.5 | 81.2 / 87.9 |
| BERT BASE (Single) | - | - | 80.8 / 88.5 |
| BERT LARGE (Single) | - | - | 84.1 / 90.9 |
| BERT LARGE (Ensemble) | - | - | 85.8 / 91.8 |
| BERT LARGE (Sgl.+TriviaQA) | 85.1 | 91.8 | 84.2 / 91.1 |
| BERT LARGE (Ens.+TriviaQA) | 87.4 | 93.2 | 86.2 / 92.2 |
Table 2: SQuAD 1.1 (Test)
Top leaderboard systems as of Dec 10th, 2018. EM is exact match.
| System | Dev EM / F1 | Test EM / F1 |
|---|---|---|
| Human | 86.3 / 89.0 | 86.9 / 89.5 |
| #1 Single, MIR-MRC (F-Net) | - | 74.8 / 78.0 |
| #2 Single, nlnet | - | 74.2 / 77.1 |
| unet (Ensemble) | - | 71.4 / 74.9 |
| SLQA+ (Single) | - | 71.4 / 74.4 |
| BERT LARGE (Single) | 78.7 / 81.9 | 80.0 / 83.1 |
Table 3: SQuAD 2.0
| System | Dev | Test |
|---|---|---|
| ESIM+GloVe | 51.9 | 52.7 |
| ESIM+ELMo | 59.1 | 59.2 |
| OpenAI GPT | - | 78.0 |
| BERT BASE | 81.6 | - |
| BERT LARGE | 86.6 | 86.3 |
| Human (expert) | - | 85.0 |
| Human (5 annotations) | - | 88.0 |
Table 4: SWAG accuracy
Human numbers use 100 samples, as reported in the SWAG paper.
Hover, tap or focus a bar to read its exact value.
| Pre-training setup | SQuAD F1 |
|---|---|
| BERT BASE | 88.5 |
| No NSP | 87.9 |
| LTR & No NSP | 77.8 |
| + BiLSTM | 84.9 |
| Setup | MNLI-m | QNLI | MRPC |
|---|---|---|---|
| BERT BASE | 84.4 | 88.4 | 86.7 |
| No NSP | 83.9 | 84.9 | 86.5 |
| LTR & No NSP | 82.1 | 84.3 | 77.5 |
| + BiLSTM | 82.1 | 84.1 | 75.7 |
Table 5: ablation over the pre-training tasks (dev)
Accuracy for each. SST-2 and SQuAD are in the next table.
| Setup | SST-2 | SQuAD F1 |
|---|---|---|
| BERT BASE | 92.7 | 88.5 |
| No NSP | 92.6 | 87.9 |
| LTR & No NSP | 92.1 | 77.8 |
| + BiLSTM | 91.6 | 84.9 |
Table 5 (continued)
Hover, tap or focus a bar to read its exact value.
| Size (layers, hidden, heads) | MNLI-m (%) |
|---|---|
| L=3, H=768, A=12 | 77.9 |
| L=6, H=768, A=3 | 80.6 |
| L=6, H=768, A=12 | 81.9 |
| L=12, H=768, A=12 | 84.4 |
| L=12, H=1024, A=16 | 85.7 |
| L=24, H=1024, A=16 | 86.6 |
| Layers, hidden, heads | LM ppl | MNLI-m | MRPC |
|---|---|---|---|
| 3, 768, 12 | 5.84 | 77.9 | 79.8 |
| 6, 768, 3 | 5.24 | 80.6 | 82.2 |
| 6, 768, 12 | 4.68 | 81.9 | 84.8 |
| 12, 768, 12 | 3.99 | 84.4 | 86.7 |
| 12, 1024, 16 | 3.54 | 85.7 | 86.9 |
| 24, 1024, 16 | 3.23 | 86.6 | 87.8 |
Table 6: ablation over BERT model size (dev)
SST-2 accuracy for the same rows: 88.4, 90.7, 91.3, 92.9, 93.3, 93.7. LM ppl is masked-LM perplexity on held-out training data.
| System | Dev F1 | Test F1 |
|---|---|---|
| ELMo | 95.7 | 92.2 |
| CVT | - | 92.6 |
| CSE | - | 93.1 |
| Fine-tuning: BERT LARGE | 96.6 | 92.8 |
| Fine-tuning: BERT BASE | 96.4 | 92.4 |
| Features: Embeddings | 91.0 | - |
| Features: Second-to-Last Hidden | 95.6 | - |
| Features: Last Hidden | 94.9 | - |
| Features: Weighted Sum Last Four Hidden | 95.9 | - |
| Features: Concat Last Four Hidden | 96.1 | - |
| Features: Weighted Sum All 12 Layers | 95.5 | - |
Table 7: CoNLL-2003 named entity recognition
Feature rows use BERT BASE. Scores are averaged over 5 random restarts.
| MASK / SAME / RND | MNLI | NER fine-tune | NER features |
|---|---|---|---|
| 80% / 10% / 10% | 84.2 | 95.4 | 94.9 |
| 100% / 0% / 0% | 84.3 | 94.9 | 94.0 |
| 80% / 0% / 20% | 84.1 | 95.2 | 94.6 |
| 80% / 20% / 0% | 84.4 | 95.2 | 94.7 |
| 0% / 20% / 80% | 83.7 | 94.8 | 94.6 |
| 0% / 0% / 100% | 83.6 | 94.9 | 94.6 |
Table 8: masking rates
Dev set results.
Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.
Every Monday: the new AI papers worth your time. Short lines, the key number, and what to do with it.
One email a week. Unsubscribe with one click. No spam.