Papers › RoBERTa: A Robustly Optimized BERT Pretraining Approach

RoBERTa: A Robustly Optimized BERT Pretraining Approach

26 Jul 2019arXiv:1907.11692archive 2025-07-28

Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, Veselin Stoyanov

Language model pretraining has led to significant performance gains but careful comparison between different approaches is challenging. Training is computationally expensive, often done on private datasets of different sizes, and, as we will show, hyperparameter choices have significant impact on the final results. We present a replication study of BERT pretraining (Devlin et al., 2019) that carefully measures the impact of many key hyperparameters and training data size. We find that BERT was significantly undertrained, and can match or exceed the performance of every model published after it. Our best model achieves state-of-the-art results on GLUE, RACE and SQuAD. These results highlight the importance of previously overlooked design choices, and raise questions about the source of recently reported improvements. We release our models and code.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1907.11692")

Code

Syntology Ran 22 of 48 code samples harvested from 16 repositories linked to this paper; 26 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 21 ran with no contract checked.

By repository: community (archive-listed): 48 samples from 16 repositories, 22 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

67 repositories listed; official and paper-mentioned ones first.

pytorch/fairseq officialmentioned in paperpytorch report
CalumPerrio/WNUT-2020 mentioned on GitHubpytorchGPL-3.0 report
IndicoDataSolutions/finetune mentioned on GitHubtfMPL-2.0 report
SindhuMadi/FakeNewsDetection mentioned on GitHub report
Tencent/TurboTransformers mentioned on GitHubpytorchNOASSERTION report
UnknownGenie/altered-BERT-KPE mentioned on GitHubpytorch report
abdumaa/hiqualprop mentioned on GitHubpytorch report
aistairc/kirt_bert_on_abci mentioned on GitHubpytorchApache-2.0 report
awslabs/mlm-scoring mentioned on GitHubmxnet report
bcaitech1/p2-klue-Heeseok-Jeong mentioned on GitHubpytorch report
benywon/ReCO mentioned on GitHubpytorch report
bfopengradient/NLP_ROBERTA mentioned on GitHub report
blawok/named-entity-recognition mentioned on GitHubpytorch report
brightmart/roberta_zh mentioned on GitHubtf report
clovaai/textual-kd-slu mentioned on GitHubpytorchApache-2.0 report
common-english/bert-all mentioned on GitHubpytorch report
devhemza/BERTweet_sentiment_analysis mentioned on GitHubpytorch report
dig-team/hanna-benchmark-asg mentioned on GitHubpytorchMIT report
eternityyw/tram-benchmark mentioned on GitHubMIT report
expertailab/spaceqa mentioned on GitHubpytorch report
facebookresearch/anli mentioned on GitHubpytorchNOASSERTION report
few-shot-NER-benchmark/BaselineCode mentioned on GitHubpytorch report
flexible-fl/flex-nlp mentioned on GitHubAGPL-3.0 report
hkuds/easyrec mentioned on GitHubpytorch report
huggingface/transformers mentioned on GitHubpytorch report
ibm/vira-intent-discovery mentioned on GitHubApache-2.0 report
kaushaltrivedi/fast-bert mentioned on GitHubpytorch report
knuddj1/op_text mentioned on GitHubpytorchMIT report
knuddy/op_text mentioned on GitHubpytorchMIT report
lashoun/hanna-benchmark-asg mentioned on GitHubpytorchMIT report
mthcom/hscore-dataset-pruning mentioned on GitHubpytorchApache-2.0 report
musixmatchresearch/umberto mentioned on GitHubpytorchMIT report
nguyenvulebinh/vietnamese-roberta mentioned on GitHubpytorch report
octanove/shiba mentioned on GitHubpytorchNOASSERTION report
oneflow-inc/libai mentioned on GitHubApache-2.0 report
pisalore/roberta_results mentioned on GitHubpytorchMIT report
salesforce/codet5 mentioned on GitHubpytorch report
sdadas/polish-roberta mentioned on GitHubpytorchLGPL-3.0 report
simon-benigeri/narrative-generation mentioned on GitHubpytorch report
traviscoan/cards mentioned on GitHubApache-2.0 report
utterworks/fast-bert mentioned on GitHubpytorch report
viethoang1512/kpa mentioned on GitHubpytorchApache-2.0 report
wzzzd/LM_NER mentioned on GitHubpytorch report
xiaoqian19940510/text-classification- mentioned on GitHubpytorch report
zaradana/Fast_BERT mentioned on GitHubpytorch report
zfj1998/CodeBert-Code2Text mentioned on GitHubpytorch report
znhy1024/protoco mentioned on GitHubpytorch report
MS-P3/code7 mindspore report
lvyufeng/bert4ms mindsporeApache-2.0 report
pwc-1/Paper-9 mindspore report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

48 samples harvested; 22 ran; 0 honoured the contract we drafted; 26 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
21ran
26unverified

Licence: 23 of the 48 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 16 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

BertAttention GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · ad7f6e57dedf08aa · report
BertEmbeddings GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran fingerprinted no licence file found · pointer only · c3af34b4f438eaea · report
BertIntermediate GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · 6e60ffe93c5ec5fa · report
BertOutput GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran no licence file found · pointer only · 5e5629cb8e93e004 · report
BertPooler GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 4e755eff48bf0752 · report
BertSelfAttention GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran fingerprinted no licence file found · pointer only · df8363b5430892a0 · report
BertSelfOutput GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) ran · metamorphic tier: deterministic fingerprinted no licence file found · pointer only · fcf3cd282eb03efe · report
CRF wzzzd/LM_NER/model/roberta_crf.py community (archive-listed) ran no licence file found · pointer only · e65cfdc18cd8c48f · report
ClassificationHead abdumaa/hiqualprop/full/custom_sequence_classification.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · 7b8d60647337c2b1 · report
CustomRobertaForSequenceClassification abdumaa/hiqualprop/full/custom_sequence_classification.py community (archive-listed) ran no licence file found · pointer only · 0196b04010ddfa00 · report
Encoder xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran no licence file found · pointer only · 68faf3c1193d95e7 · report
Model xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran no licence file found · pointer only · 9d6930c9ef7f273b · report
Multi_Head_Attention xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran no licence file found · pointer only · 717e1f9d4eae4141 · report
Pooler hkuds/easyrec/model.py community (archive-listed) ran · metamorphic tier: deterministic no licence file found · pointer only · dba0b61c9d62f82f · report
Position_wise_Feed_Forward xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran fingerprinted no licence file found · pointer only · c15e979783157fb0 · report
Positional_Encoding xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran fingerprinted no licence file found · pointer only · ce8217cf9489c436 · report
RobertaClassificationHead salesforce/codet5/CodeT5/models.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted BSD-3-Clause (permissive) · 17243795c9ab1ec3 · report
RobertaNER few-shot-NER-benchmark/BaselineCode/src/meta_model.py community (archive-listed) ran no licence file found · pointer only · 152609ff366dfb9e · report
Scaled_Dot_Product_Attention xiaoqian19940510/text-classification-surveys/ChineseTextClassification/models/Transformer.py community (archive-listed) ran · metamorphic tier: invariant fingerprinted no licence file found · pointer only · efea4e3ee53c36c9 · report
cos_sim viethoang1512/kpa/qs_kpa/losses/multiple_negatives_ranking_loss.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · 8ca90d5388372be5 · report
dot_score viethoang1512/kpa/qs_kpa/losses/multiple_negatives_ranking_loss.py community (archive-listed) ran fingerprinted Apache-2.0 (permissive) · afa18317f44e63ad · report
get_tasks pisalore/roberta_results/glue_tasks/download_glue_data.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 3caf26b311c98658 · report
BertEncoder GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) unverified no licence file found · pointer only · 00ea7705507db813 · report
BertLayer GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) unverified no licence file found · pointer only · f2ab856479b90e8a · report
BertModel GeorgeLuImmortal/Hierarchical-BERT-Model-with-Limited-Labelled-Data/run_hbm.py community (archive-listed) unverified no licence file found · pointer only · f43b4161b7bdba24 · report
Easyrec hkuds/easyrec/model.py community (archive-listed) unverified no licence file found · pointer only · b2bd29f8a81790e2 · report
QuestionAnswering expertailab/spaceqa/question_answering/src/question_answering/question_answering.py community (archive-listed) unverified Apache-2.0 (permissive) · da835c893505251b · report
RoBertaCRF wzzzd/LM_NER/model/roberta_crf.py community (archive-listed) unverified no licence file found · pointer only · 7d40208cd5d0da23 · report
RobertaForMultiLabelSequenceClassification kaushaltrivedi/fast-bert/fast_bert/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · b3e0c37e1e2b9503 · report
RobertaForMultiLabelSequenceClassification zaradana/Fast_BERT/0_fast_bert/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 6788010bd752077c · report
contrastive_loss viethoang1512/kpa/qs_kpa/baselines/tf_models.py community (archive-listed) unverified Apache-2.0 (permissive) · a5f2db749ea77f58 · report
convert_label_to_similarity viethoang1512/kpa/qs_kpa/losses/circle_loss.py community (archive-listed) unverified Apache-2.0 (permissive) · 6708df0bbbc13e34 · report
convert_state_dict lvyufeng/bert4ms/cybertron/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 8afaa985063f723e · report
convert_to_single_none_row_df ibm/vira-intent-discovery/trim.py community (archive-listed) unverified Apache-2.0 (permissive) · e06455e72782e6d0 · report
drop_duplicates traviscoan/cards/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 163e38293198fa6a · report
estimate_ensemble traviscoan/cards/fit/ensemble.py community (archive-listed) unverified Apache-2.0 (permissive) · 9f11fd760e57188c · report
filter_all_data ibm/vira-intent-discovery/prepare.py community (archive-listed) unverified Apache-2.0 (permissive) · d4db5e37c5831f1a · report
filter_oracle_train ibm/vira-intent-discovery/prepare.py community (archive-listed) unverified Apache-2.0 (permissive) · 57b444571a95cb8a · report
fit_logistic_classifier traviscoan/cards/fit/logistic.py community (archive-listed) unverified Apache-2.0 (permissive) · 53e20baefb5f4cd1 · report
flatten traviscoan/cards/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 954d7736e2d968f3 · report
invert_mask lvyufeng/bert4ms/cybertron/models/bart.py community (archive-listed) unverified Apache-2.0 (permissive) · e8ae42ea576c0232 · report
load_from_cache lvyufeng/bert4ms/cybertron/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · e462fa293bb314aa · report
predict_claim traviscoan/cards/fit/ensemble.py community (archive-listed) unverified Apache-2.0 (permissive) · 712ccc81e62f75b9 · report
read_csv traviscoan/cards/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · df853d8826e7a476 · report
remove_between_square_brackets traviscoan/cards/preprocess.py community (archive-listed) unverified Apache-2.0 (permissive) · cd2c2c1263e0882d · report
remove_non_ascii traviscoan/cards/preprocess.py community (archive-listed) unverified Apache-2.0 (permissive) · a9831bf0d050a65c · report
shift_tokens_right lvyufeng/bert4ms/cybertron/models/bart.py community (archive-listed) unverified Apache-2.0 (permissive) · 8f0494a0f9a303b8 · report
train blawok/named-entity-recognition/src/source_roberta/train_roberta.py community (archive-listed) unverified MIT (permissive) · 92e80bcaa1f41216 · report

Tasks

Common Sense ReasoningDocument Image ClassificationLanguage ModelingLanguage ModellingLexical SimplificationLinguistic AcceptabilityMulti-task Language UnderstandingNatural Language InferenceOnly Connect Walls Dataset Task 1 (Grouping)Question AnsweringReading ComprehensionRiddle SenseSemantic Textual SimilaritySentence CompletionSentiment AnalysisStock Market PredictionText ClassificationType prediction

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Common Sense Reasoning CommonsenseQA RoBERTa-Large 355M Accuracy 72.1 #19 of 38 Archive leaderboard report
Common Sense Reasoning SWAG RoBERTa Test 89.9 #2 of 5 Archive leaderboard report
Document Image Classification RVL-CDIP Roberta base Accuracy 90.06 #31 of 31 Archive leaderboard report
Document Image Classification RVL-CDIP Roberta base Parameters 125M #31 of 31 Archive leaderboard report
Linguistic Acceptability CoLA RoBERTa (ensemble) Accuracy 67.8% #20 of 43 Archive leaderboard report
Natural Language Inference ANLI test RoBERTa (Large) A1 72.4 #5 of 25 Archive leaderboard report
Natural Language Inference ANLI test RoBERTa (Large) A2 49.8 #5 of 25 Archive leaderboard report
Natural Language Inference ANLI test RoBERTa (Large) A3 44.4 #5 of 25 Archive leaderboard report
Natural Language Inference MultiNLI RoBERTa Matched 90.8 #9 of 67 Archive leaderboard report
Natural Language Inference MultiNLI RoBERTa (ensemble) Mismatched 90.2 #60 of 67 Archive leaderboard report
Natural Language Inference QNLI RoBERTa (ensemble) Accuracy 98.9% #5 of 43 Archive leaderboard report
Natural Language Inference RTE RoBERTa Accuracy 88.2% #18 of 90 Archive leaderboard report
Natural Language Inference RTE RoBERTa (ensemble) Accuracy 88.2% #19 of 90 Archive leaderboard report
Natural Language Inference WNLI RoBERTa (ensemble) Accuracy 89 #9 of 23 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) # Correct Groups 29 ± 3 #22 of 22 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) # Solved Walls 0 ± 0 #22 of 22 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) Adjusted Mutual Information (AMI) 9.4 ± .4 #22 of 22 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) Adjusted Rand Index (ARI) 8.4 ± .3 #22 of 22 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) Fowlkes Mallows Score (FMS) 26.7 ± .2 #22 of 22 Archive leaderboard report
Only Connect Walls Dataset Task 1 (Grouping) OCW RoBERTa (LARGE) Wasserstein Distance (WD) 88.4 ± .4 #22 of 22 Archive leaderboard report
Question Answering PIQA RoBERTa-Large 355M Accuracy 79.4 #37 of 67 Archive leaderboard report
Question Answering Quora Question Pairs RoBERTa (ensemble) Accuracy 90.2% #6 of 19 Archive leaderboard report
Question Answering SIQA RoBERTa-Large 355M (fine-tuned) Accuracy 76.7 #12 of 24 Archive leaderboard report
Question Answering SQuAD2.0 RoBERTa (single model) EM 86.820 #90 of 286 Archive leaderboard report
Question Answering SQuAD2.0 RoBERTa (single model) F1 89.795 #90 of 286 Archive leaderboard report
Question Answering SQuAD2.0 dev RoBERTa (no data aug) EM 86.5 #3 of 13 Archive leaderboard report
Question Answering SQuAD2.0 dev RoBERTa (no data aug) F1 89.4 #3 of 13 Archive leaderboard report
Reading Comprehension RACE RoBERTa Accuracy 83.2 #7 of 24 Archive leaderboard report
Reading Comprehension RACE RoBERTa Accuracy (High) 81.3 #7 of 24 Archive leaderboard report
Reading Comprehension RACE RoBERTa Accuracy (Middle) 86.5 #7 of 24 Archive leaderboard report
Semantic Textual Similarity MRPC RoBERTa (ensemble) Accuracy 92.3% #3 of 45 Archive leaderboard report
Semantic Textual Similarity STS Benchmark RoBERTa Pearson Correlation 0.922 #7 of 66 Archive leaderboard report
Sentence Completion HellaSwag RoBERTa-Large Ensemble Accuracy 85.5 #24 of 89 Archive leaderboard report
Sentence Completion HellaSwag RoBERTa-Large 355M Accuracy 81.7 #40 of 89 Archive leaderboard report
Sentiment Analysis SST-2 Binary classification RoBERTa (ensemble) Accuracy 96.7 #13 of 87 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News+Factors) Accuray 62.49 #11 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News+Factors) F1-score 62.54 #11 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News+Factors) Precision 62.59 #11 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News+Factors) Recall 62.51 #11 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News) Accuray 61.34 #12 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News) F1-score 61.48 #12 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News) Precision 61.97 #12 of 17 Archive leaderboard report
Stock Market Prediction Astock RoBERTa WWM Ext (News) Recall 61.32 #12 of 17 Archive leaderboard report
Text Classification arXiv-10 RoBERTa Accuracy 0.779 #2 of 4 Archive leaderboard report
Type prediction ManyTypes4TypeScript RoBERTa Average Accuracy 59.84 #7 of 9 Archive leaderboard report
Type prediction ManyTypes4TypeScript RoBERTa Average F1 57.54 #7 of 9 Archive leaderboard report
Type prediction ManyTypes4TypeScript RoBERTa Average Precision 57.45 #7 of 9 Archive leaderboard report
Type prediction ManyTypes4TypeScript RoBERTa Average Recall 57.62 #7 of 9 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionRoBERTaSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections