Chapter 4 · 2018
Why not look at the words on both sides?
In “the ___ of the river,” you use river as much as the. A next-word guesser never gets to do that during practice, because “river” is still in the future.
The leftover problem was a one-way window.
GPT’s practice was: look left, guess right. For jobs like “what does this sentence mean?” or “answer a question about this paragraph,” the useful clue might sit on either side of the important word.
writing practice · the right side is off-limits
Hide a word in the middle. Let every other word look both ways to fill it in.
Here is how they made “both ways” a fair game.
Take a real sentence. Hide a word (sometimes a few). The machine’s job is to guess the missing piece.
clues on the left and the right
Same looking-around machine as chapter 2 — but now every word may attend to every other word, including the ones after the blank. That is the difference from GPT’s one-way window.
Sometimes they also show two stretches of text and ask: does the second one really follow the first? That nudges the model to think about pairs, not just single sentences — handy later for questions and answers packed together.
After that practice, they add one extra output layer and fine-tune on a specific task — question answering, sentence judgment, and so on. The same pretrained body, a small new hat.
Understanding a finished sentence is a different sport from writing the next word — so they changed the homework.
They called the model BERT — bidirectional encoder representations from Transformers. The hide-a-word game is a masked language model. The pair game is next-sentence prediction.
It set new records on a pile of understanding tests.
Question answering, language inference, and a bundle of other sentence jobs jumped. The paper’s claim is simple: deep both-ways practice, then a small fine-tune, beats one-way pre-training on those understanding benchmarks.
One-way practice
Great for writing the next word. Blind to clues on the right.
Both-ways practice
The blank sits in the middle. The whole sentence may help fill it.
That’s why this still matters.
Search, autocomplete, and “understand this paragraph” tools still lean on the idea: if the text is already there, let every word see every other word.