Whole Word Masking › Visualizing the Difference
Language AI HandbookAll chapters Whole Word Masking › Visualizing the DifferenceOne section · Sections in this chapter6 / 13 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let's create a visualization comparing how both masking strategies affect a set of sentences with multi-token words. We use a higher masking probability (30%) to make the patterns more visible in the diagram.

The visualization highlights how random subword masking creates fragmented masking patterns that leak information. In "transformation", random masking might leave "transform" visible while masking "##ation", handing the model a near-trivial suffix prediction task. In "internationalization", which tokenizes into many fragments, random masking might mask only a middle fragment while leaving both prefix and suffix visible, making prediction even easier. WWM eliminates this entirely by treating words as atomic units: all fragments of a selected word are masked simultaneously, or none are.