Papers › On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines

On the Stability of Fine-tuning BERT: Misconceptions, Explanations, and Strong Baselines

8 Jun 2020ICLR 2021 1arXiv:2006.04884archive 2025-07-28

Marius Mosbach, Maksym Andriushchenko, Dietrich Klakow

Fine-tuning pre-trained transformer-based language models such as BERT has become a common practice dominating leaderboards across various NLP benchmarks. Despite the strong empirical performance of fine-tuned models, fine-tuning is an unstable process: training the same model with multiple random seeds can result in a large variance of the task performance. Previous literature (Devlin et al., 2019; Lee et al., 2020; Dodge et al., 2020) identified two potential reasons for the observed instability: catastrophic forgetting and small size of the fine-tuning datasets. In this paper, we show that both hypotheses fail to explain the fine-tuning instability. We analyze BERT, RoBERTa, and ALBERT, fine-tuned on commonly used datasets from the GLUE benchmark, and show that the observed instability is caused by optimization difficulties that lead to vanishing gradients. Additionally, we show that the remaining variance of the downstream task performance can be attributed to differences in generalization where fine-tuned models with the same training loss exhibit noticeably different test performance. Based on our analysis, we present a simple but strong baseline that makes fine-tuning BERT-based models significantly more stable than the previously proposed approaches. Code to reproduce our results is available online: https://github.com/uds-lsv/bert-stable-fine-tuning.

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="2006.04884")

Code

Syntology Ran 7 of 20 code samples harvested from 2 repositories linked to this paper; 13 have no recorded run. Of those that ran: 3 ran · honoured contract; 4 ran · our draft was wrong.

By repository: official repository: 10 samples from 1 repository, 7 ran; community (archive-listed): 10 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

uds-lsv/bert-stable-fine-tuning officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
ruanchaves/eplm mentioned on GitHubMIT 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

20 samples harvested; 7 ran; 3 honoured the contract we drafted; 13 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.

3ran · honoured contract
4ran · our draft was wrong
13unverified

Licence: 0 of the 20 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 2 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.

swish uds-lsv/bert-stable-fine-tuning/src/transformers/activations.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 0f786c407fb1ee4c · report
whitespace_tokenize uds-lsv/bert-stable-fine-tuning/src/transformers/tokenization_bert.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · cf9ffa02a42184af · report
gelu uds-lsv/bert-stable-fine-tuning/src/transformers/modeling_tf_bert.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · 9bc31d06256e1691 · report
gelu_new uds-lsv/bert-stable-fine-tuning/src/transformers/activations.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · 77601724cad03f95 · report
load_vocab uds-lsv/bert-stable-fine-tuning/src/transformers/tokenization_bert.py official repository ran · our draft was wrong Apache-2.0 (permissive) · e7fbc7a74a3457c7 · report
mish uds-lsv/bert-stable-fine-tuning/src/transformers/modeling_bert.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 060527bb34794b59 · report
swish uds-lsv/bert-stable-fine-tuning/src/transformers/modeling_tf_bert.py official repository ran · honoured contract fingerprinted Apache-2.0 (permissive) · 86d13b9f67274f19 · report
convert_pytorch_checkpoint_to_tf uds-lsv/bert-stable-fine-tuning/src/transformers/convert_bert_pytorch_checkpoint_to_original_tf.py official repository unverified Apache-2.0 (permissive) · d772ba25f4de22b0 · report
gelu_new uds-lsv/bert-stable-fine-tuning/src/transformers/modeling_tf_bert.py official repository unverified Apache-2.0 (permissive) · 83257a2b015273fa · report
load_tf_weights_in_bert uds-lsv/bert-stable-fine-tuning/src/transformers/modeling_bert.py official repository unverified Apache-2.0 (permissive) · 0766f48ad6e01b56 · report
add_benchmark_result ruanchaves/eplm/leaderboard/manage_data.py community (archive-listed) unverified MIT (permissive) · 33aeaf51efd2501f · report
add_dataset ruanchaves/eplm/leaderboard/manage_data.py community (archive-listed) unverified MIT (permissive) · a6f1e11c54df3de5 · report
check_dependency ruanchaves/eplm/leaderboard/run_app.py community (archive-listed) unverified MIT (permissive) · d87861334682866a · report
convert_to_completion_format ruanchaves/eplm/src/napolab/napolab.py community (archive-listed) unverified MIT (permissive) · ef9ba0bf81d816aa · report
export_napolab_benchmark ruanchaves/eplm/src/napolab/napolab.py community (archive-listed) unverified MIT (permissive) · 02907c137bc813d1 · report
extract_data_from_json ruanchaves/eplm/leaderboard/extract_portuguese_leaderboard.py community (archive-listed) unverified MIT (permissive) · 653c7bc811a7f863 · report
find_json_files ruanchaves/eplm/leaderboard/extract_portuguese_leaderboard.py community (archive-listed) unverified MIT (permissive) · 6e1f4e02403886e3 · report
is_valid_json_file ruanchaves/eplm/leaderboard/extract_portuguese_leaderboard.py community (archive-listed) unverified MIT (permissive) · e0c0f0759208e777 · report
load_napolab_benchmark ruanchaves/eplm/src/napolab/napolab.py community (archive-listed) unverified MIT (permissive) · 8db96d079a008116 · report
validate_yaml_structure ruanchaves/eplm/leaderboard/manage_data.py community (archive-listed) unverified MIT (permissive) · 03c4a8263ac6e7a1 · report

Tasks

Misconceptions

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALBERTAdamAttentionAttention DropoutBERTDense ConnectionsDropoutLAMBLayer 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