Masking strategy (BERT-Base size, dev sets. SQuAD is F1, others are accuracy. Median of 5 runs)
| Masking | SQuAD 2.0 | MNLI-m | SST-2 |
|---|
| Static (reimplementation of BERT) | 78.3 | 84.3 | 92.5 |
| Dynamic | 78.7 | 84.0 | 92.9 |
Although the differences are small, dynamic masking is equal or slightly better and does not require duplicating the data, so all subsequent experiments used dynamic masking.
Input format and next sentence prediction (BERT-Base size, BooksCorpus and Wikipedia, 1M steps)
| Input format | NSP | SQuAD 1.1 / 2.0 | MNLI-m | SST-2 | RACE |
|---|
| Segment pairs (same as BERT) | Yes | 90.4 / 78.7 | 84.0 | 92.9 | 64.2 |
| Sentence pairs | Yes | 88.7 / 76.2 | 82.9 | 92.1 | 63.0 |
| Packed sentences (across documents) | No | 90.4 / 79.1 | 84.7 | 92.5 | 64.8 |
| Packed sentences (within a document) | No | 90.6 / 79.7 | 84.7 | 92.7 | 65.6 |
The within-document format is slightly better, but because it makes the batch size vary, RoBERTa uses the cross-document format.
Batch size (BERT-Base size, with the number of passes over the data and the computation held fixed)
| Batch | Steps | Learning rate | Perplexity | MNLI-m | SST-2 |
|---|
| 256 | 1M | 1×10−4 | 3.99 | 84.7 | 92.7 |
| 2,000 | 125K | 7×10−4 | 3.68 | 85.2 | 92.9 |
| 8,000 | 31K | 1×10−3 | 3.77 | 84.6 | 92.8 |
Data size and training length (Large size, dev sets. Each row adds to the changes of the rows above)
| Model | Data | Batch | Steps | SQuAD 1.1 / 2.0 | MNLI-m | SST-2 |
|---|
| RoBERTa | 16GB | 8,000 | 100K | 93.6 / 87.3 | 89.0 | 95.3 |
| + more data | 160GB | 8,000 | 100K | 94.0 / 87.7 | 89.3 | 95.6 |
| + train longer | 160GB | 8,000 | 300K | 94.4 / 88.7 | 90.0 | 96.1 |
| + train even longer | 160GB | 8,000 | 500K | 94.6 / 89.4 | 90.2 | 96.4 |
| BERT-Large | 13GB (*) | 256 | 1M | 90.9 / 81.8 | 86.6 | 93.7 |
| XLNet-Large | 126GB | 2,000 | 500K | 94.5 / 88.8 | 89.8 | 95.6 |
(*) The same BooksCorpus and Wikipedia as BERT, but 13GB as counted in the XLNet paper.
Even with the same 16GB of data, RoBERTa clearly outperformed BERT-Large. Each time the data was increased and training was lengthened, results improved on all tasks.
GLUE (a single model fine-tuned for each task, dev sets. MNLI is matched/mismatched; the others use each task's metric such as accuracy)
| Model | MNLI | QNLI | QQP | RTE | SST-2 | MRPC | CoLA | STS-B |
|---|
| BERT-Large | 86.6 / - | 92.3 | 91.3 | 70.4 | 93.2 | 88.0 | 60.6 | 90.0 |
| XLNet-Large | 89.8 / - | 93.9 | 91.8 | 83.8 | 95.6 | 89.2 | 63.6 | 91.8 |
| RoBERTa | 90.2 / 90.2 | 94.7 | 92.2 | 86.6 | 96.4 | 90.9 | 68.0 | 92.4 |
On the dev sets, RoBERTa achieved the best results at the time on all 9 GLUE tasks. On the test sets (leaderboard, ensembles) it averaged 88.5, slightly above XLNet's 88.4.
SQuAD and RACE (a single model without additional data)
| Model | SQuAD 1.1 (dev, EM / F1) | SQuAD 2.0 (dev, EM / F1) | RACE (test, accuracy) |
|---|
| BERT-Large | 84.1 / 90.9 | 79.0 / 81.8 | 72.0 |
| XLNet-Large | 89.0 / 94.5 | 86.1 / 88.8 | 81.7 |
| RoBERTa | 88.9 / 94.6 | 86.5 / 89.4 | 83.2 |