Masked language modelling (MLM)
BERT's first training task: some words of a sentence are chosen — most are hidden behind [MASK], a few are swapped for a random word or left as they are — and the model learns by guessing the original word at each chosen position. Only its guesses there count towards what it learns.
Example: In "the [MASK] sat on the mat", the model should give "cat" a high probability at the hidden position.
ⓘ Technical definition
A self-supervised objective: about 15 % of input positions are chosen (80 % replaced by [MASK], 10 % by a random token, 10 % kept), and the cross-entropy of the prediction head's softmax over the vocabulary is averaged over the chosen positions only.
→ First introduced in: Prediction, Loss & Backward