the.ai

Unsupervised / Objectives

verified

Masked Language Modeling

Hide some of the words in a sentence and train the model to fill them back in. Because it can see both sides of a gap, it learns representations that account for what comes after — which a model predicting strictly left to right cannot. That bidirectionality is the whole trade: better representations, and no way to generate text one token at a time.

Viz primitive · attention-heatmaptokens = 10 · heads = 1
query ↓key →

10 queries against 10 keys; a brighter cell means more of that query's attention went to that key. Each query sees itself and everything before it, and nothing after — the upper triangle is masked.

Which positions each token is allowed to attend to. Drag the lookahead up from zero to open a causal view into the bidirectional one masked language modelling trains on.

0

Reviewed by opendroid · 2026-08-13

  • arXiv:1810.04805 — BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding