Lesson 8.2ModelCode~1 h 15 min
The bigram model
Count which letter follows which, then dream up new names. A language model in a table.
Module 8 · 0/8 done
A language model in a table
A language model predicts the next token from the ones before it: . The simplest possible version only looks at one previous token. Take ~600 first names, and for every letter, count which letter comes next. That table of counts is the model — a bigram model (bi = two: pairs of letters).
We add a special “.” token for the start and end of a name, so the model also learns how names begin and end.