The Evolving Optimal Masking Ratio in BERT
While BERT's original design used a 15% masking probability for tokens, recent research suggests that higher rates, such as 40% or even 80%, can yield better performance for larger models or specific masking strategies.
The top 3
- BERT's Foundational 15% Masking Ratio Explained: The original BERT model employed a 15% masking rate for its Masked Language Modeling task, utilizing an 80-10-10 strategy: 80% replaced by [MASK], 10% by a random word, and 10% left unchanged. This choice aimed to balance learning context with avoiding excessive corruption, while also mitigating 'exposure bias' by exposing the model to real and random tokens during training.
- RoBERTa's Dynamic Masking vs. BERT's Static Approach: Unlike BERT's static masking, where the same tokens are masked across training epochs, RoBERTa introduced dynamic masking. This technique randomly masks different tokens in each training example, exposing the model to a wider variety of masked contexts. This leads to more robust and generalizable language representations, contributing to RoBERTa's improved performance over BERT.
- Optimal Masking Ratios Vary by Model Size and Task: The conventional 15% masking rate is not universally optimal; research indicates that larger BERT-like models can benefit from higher masking rates. For instance, masking 40% of tokens has been shown to outperform 15% for BERT-large models on benchmarks like GLUE and SQuAD, even improving F1 performance metrics by 2 percentage points. Some studies even suggest that extremely high rates, up to 80%, can still maintain significant fine-tuning performance, challenging prior assumptions. The ideal masking ratio depends on the model size and the specific downstream NLP task.
Sources
Open the full topic