[Paper Review] A Better Way to Do Masked Language Model Scoring
This paper proposes PLL-word-l2r, a revised masked language model scoring method that masks both the target token and all subsequent within-word subtokens during inference, addressing score inflation for out-of-vocabulary (OOV) words. The method outperforms the original PLL and whole-word masking by better satisfying theoretical desiderata and correlating more strongly with autoregressive model scores, particularly in controlled benchmarks like BLiMP.
Estimating the log-likelihood of a given sentence under an autoregressive language model is straightforward: one can simply apply the chain rule and sum the log-likelihood values for each successive token. However, for masked language models (MLMs), there is no direct way to estimate the log-likelihood of a sentence. To address this issue, Salazar et al. (2020) propose to estimate sentence pseudo-log-likelihood (PLL) scores, computed by successively masking each sentence token, retrieving its score using the rest of the sentence as context, and summing the resulting values. Here, we demonstrate that the original PLL method yields inflated scores for out-of-vocabulary words and propose an adapted metric, in which we mask not only the target token, but also all within-word tokens to the right of the target. We show that our adapted metric (PLL-word-l2r) outperforms both the original PLL metric and a PLL metric in which all within-word tokens are masked. In particular, it better satisfies theoretical desiderata and better correlates with scores from autoregressive models. Finally, we show that the choice of metric affects even tightly controlled, minimal pair evaluation benchmarks (such as BLiMP), underscoring the importance of selecting an appropriate scoring metric for evaluating MLM properties.
Motivation & Objective
- To address the overestimation of log-likelihood scores for out-of-vocabulary (OOV) words in the original pseudo-log-likelihood (PLL) metric for masked language models.
- To improve the theoretical validity of PLL metrics by ensuring they satisfy key desiderata such as inverse relationship with sentence length and positive correlation with word frequency.
- To enhance cross-model comparability by increasing correlation between bidirectional (e.g., BERT) and unidirectional (e.g., GPT-2) model scores.
- To evaluate the impact of metric choice on minimal pair benchmarking, particularly in controlled linguistic evaluations like BLiMP.
Proposed method
- Proposes PLL-word-l2r, a modified PLL scoring method that masks the target token and all within-word subtokens to its right during inference, ensuring no future subword context is available.
- Adapts the minicons library to compute sentence-level PLL scores under this new masking scheme, preserving left-to-right autoregressive generation order.
- Uses left-to-right masking to simulate a more natural, contextually constrained prediction process, avoiding the influence of future subword tokens on OOV word predictions.
- Compares PLL-word-l2r against PLL-original and PLL-whole-word (masking all within-word tokens) across multiple evaluation criteria and datasets.
- Employs Pearson correlation to assess alignment with theoretical expectations, such as inverse relationship between sentence length and surprisal, and positive correlation between word frequency and PLL score.
- Applies the metrics to the BLiMP benchmark to evaluate their impact on minimal pair linguistic evaluations.

Experimental results
Research questions
- RQ1Does the original PLL metric systematically overestimate the log-likelihood of out-of-vocabulary (OOV) words due to access to future within-word subtokens?
- RQ2Can a modified PLL metric that masks future within-word subtokens better satisfy theoretical desiderata such as the inverse relationship between sentence length and sentence surprisal?
- RQ3Does PLL-word-l2r achieve a stronger correlation with unidirectional model scores (e.g., GPT-2) than the original PLL or whole-word masking methods?
- RQ4How does the choice of PLL metric affect performance on controlled linguistic benchmarks like BLiMP?
Key findings
- PLL-word-l2r achieves the highest correlation with word frequency (r = 0.62) among all metrics, significantly outperforming PLL-original (r = 0.38) and PLL-whole-word (r = 0.58).
- PLL-word-l2r shows the strongest inverse relationship between sentence length and negative sentence PLL (r = -0.71), satisfying the theoretical desideratum of increasing surprisal with longer sentences.
- PLL-word-l2r achieves the highest correlation (r = 0.78) with GPT-2 log-likelihood scores, outperforming PLL-original (r = 0.52) and PLL-whole-word (r = 0.74).
- On the BLiMP benchmark, PLL-word-l2r yields the highest overall score across all tested models, including BERT-base (84.7), BERT-large (85.0), RoBERTa-base (86.7), and RoBERTa-large (87.5).
- The original PLL metric inflates scores for OOV words like 'souvenir', which are split into subtokens (e.g., so ##uven ##ir), due to context from remaining subtokens, leading to misleadingly high probabilities.
- The proposed metric is robust across models and datasets, with consistent improvements observed even in larger models and lower-OOV datasets, though effects are attenuated in low-OOV settings.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.