Skip to content

Masked Language Models

BERT-style encoders use context on both sides of a token. Explore masked-token training, contextual representations, and tagging.

  1. Two ways to read — Book 01 read left-to-right to write the next word. There is another way — read both directions at once, to understand.
  2. Fill in the blank — With both directions visible, next-word guessing is trivial. So we hide a word in the middle and guess that instead.
  3. Meaning, in context — Book 01 gave each word one fixed arrow. But “mouse” the animal and “mouse” the gadget should not share a point.
  4. Two sentences at once — Single words are not enough. Does sentence B follow sentence A? Is it a paraphrase? For that, the model reads pairs.
  5. Put it to work — Add a task-specific output layer to a pretrained encoder, then fine-tune it on labeled examples for classification, sentence comparison, or token tagging.

Sources and further reading are in the bibliography.

Definition

Read the full glossary entry →