Language modeling learns a probability distribution over linguistic symbol sequences. Its core task is predicting the next token from the tokens that came before it. section 16.6 section 14.1
Predicting the next word
Given an incomplete sentence, a language model estimates which word is most likely to come next. Repeating this prediction produces a longer string of text. section 14.1 section 16.6
Once a probability distribution is available, generation can choose tokens in several ways:
- Greedy search selects the most likely token at every step. section 16.6
- Random sampling draws directly from the predicted categorical distribution. section 16.6
- Top-k sampling limits choices to the k most likely candidates. section 16.6
Language models capture statistical regularities rather than human-like understanding. LSTMs improved text modeling but struggled with long dependencies; Transformers addressed major scalability and parallelization problems. section 14.1 section 14.1



