A language model writes two-word sentences. first_chances[i] is the chance it starts with first word i, and second_chances[i][j] is the chance that next word j follows it. Write best_sentence(first_chances, second_chances): return [i, j], the most likely sentence of all.
A model writes two-word sentences: a first word by its chances, then a next word by the chances after it. Greedy takes the likeliest word, then the likeliest next. Watch the model write, keep a tally, and see whether greedy’s pick is the sentence it writes most.
best_sentence(first_chances, second_chances)| first_chances | first_chances[i]: chance the sentence starts with word i | e.g. [0.3, 0.7] |
| second_chances | second_chances[i][j]: chance word j comes next, after word i | e.g. [[0.5, 0.5], [0.2, 0.8]] |
| returns | [i, j], the most likely sentence | |