NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

PMI-Masking: Principled masking of correlated spans

Yoav Levine, Barak Lenz, Opher Lieber, Omri Abend, Kevin Leyton-Brown, Moshe Tennenholtz, Yoav Shoham

Masked Language Models (MLMs) like BERT have revolutionized natural language processing, but their foundational pretraining strategy—masking tokens uniformly at random—harbors a significant efficiency flaw. By replacing this random approach with a principled strategy based on Pointwise Mutual Information (PMI), researchers have developed PMI-Masking. This method forces models to learn from broad context rather than "cheating" using local sub-word cues, resulting in superior downstream performance in half the training time.

The Problem with Random Masking

Most MLMs operate by hiding 15% of tokens in a sequence and training the model to predict them. However, standard models mask these tokens uniformly at random.

This creates a major loophole: if a word is broken into sub-word tokens (e.g., "e-igen-val-ue"), masking just one part (like "igen") makes the prediction task trivial. The model can simply look at the adjacent "e-" and "-val-ue" to guess the missing piece. It never actually needs to understand the sentence's broader meaning.

The authors argue that this "Random-Token Masking" allows models to minimize their training loss by latching onto shallow, local signals. This "shortcut hypothesis" suggests that models are inherently lazy; if given a local sub-word cue, they will take it. This leads to pretraining inefficiency and suboptimal performance on complex downstream tasks that require deep linguistic understanding.

The PMI-Masking Approach

To address this, the authors propose PMI-Masking, a strategy that identifies and jointly masks spans of tokens that are statistically "collocated"—meaning they appear together much more often than chance would predict.

  1. Extended PMI for n-grams: While standard PMI measures the correlation between two words (bigrams), the researchers extended this mathematical concept to n-grams of lengths 2 through 5.
  2. The "Weakest Link" Metric: A naive extension of PMI to three or more words often fails (e.g., "Kuala Lumpur is" might score high simply because "Kuala Lumpur" is so common). To fix this, the score of an n-gram is defined as the minimum PMI over all its possible segmentations. This ensures an n-gram only achieves a high score if all of its components are tightly correlated.
  3. Masking Vocabulary: Before training, the team pre-calculates a "masking vocabulary" consisting of the top 800,000 collocated n-grams from the training corpus.
  4. Joint Masking: During training, if a sequence contains one of these highly correlated n-grams, it is treated as a single unit. The algorithm selects these units (or individual tokens) until the 15% masking budget is reached.

Key Insights & Performance

Interestingly, PMI-Masking results in higher perplexity during training than random masking, meaning the model finds it harder to predict the masked tokens. However, this "harder" task forces the model to learn more robust, global representations, which translates directly to better performance on downstream tasks.

Furthermore, while previous "Whole-Word" or "Entity" masking strategies relied on external linguistic tools like part-of-speech taggers, PMI-Masking is entirely data-driven. It discovers meaningful spans—like "by the way" or "air force"—purely through statistical analysis of the text.

SQuAD 2.0 F1 score comparison across pretraining steps

As a result of removing local shortcuts, PMI-Masking reaches the performance levels of previous state-of-the-art masking strategies (like SpanBERT) in roughly half the training time. On the SQuAD 2.0 question-answering benchmark, PMI-Masking consistently outperforms Random-Token, Whole-Word, and Random-Span masking across various training durations.

Benchmark Results

The models were pretrained on standard datasets (Wikipedia + BookCorpus and OpenWebText) and evaluated on rigorous NLP benchmarks, including SQuAD 2.0, GLUE, and RACE (a challenging reading comprehension dataset from English exams in China).

Comparison of PMI-Masking against prior BASE MLMs on the RACE benchmark

The efficiency gains are most apparent on the difficult RACE dataset. A BERT-Base model trained with PMI-Masking actually outperformed RoBERTa-Base, despite RoBERTa being trained on 3x more data and for 6x more iterations. In a standard BERT setup (1M steps), PMI-Masking achieved an F1 score on SQuAD 2.0 of 81.4, compared to just 79.6 for vanilla BERT.

Limitations and Future Work

While highly effective, PMI-Masking does have a few limitations:

  • Static Masking Vocabulary: The current approach relies on a pre-computed list of n-grams. This list is static and tied directly to the specific corpus used for pretraining.
  • Vocabulary Size Tuning: The masking vocabulary size of 800K was chosen based on a small-scale proxy evaluation. A more exhaustive ablation study on this parameter could yield even better results.
  • Computational Overhead: There is a one-time computational cost to calculate the PMI scores for the entire corpus before training begins. However, this cost is generally negligible compared to the massive compute required for the actual transformer pretraining.

Summary updated

BibTeX
@inproceedings{levine2021pmi,
  author = {Yoav Levine and Barak Lenz and Opher Lieber and Omri Abend and Kevin Leyton-Brown and Moshe Tennenholtz and Yoav Shoham},
  title = {{PMI-Masking: Principled masking of correlated spans}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=djHMQeBqjlg},
}
Figure