Part II: From Scores to Loss
Prepared features do not yet say which output to produce or how to judge it. A score calculation supplies predictions; a selection rule can turn token scores into generated text. A loss instead compares a prediction with a reference answer.
Chapter 5 builds affine scores and uses loss gradients in §5.4 to describe small parameter changes. Chapter 6 relates scores to probabilities. Because generation with fixed parameters needs only those probabilities, Chapter 7 can compare generation choices before Chapter 8 introduces logarithmic loss. Chapter 9 then assesses generalization using held-out evidence.
The shared score calculation therefore supports different uses. Loss and evaluation show how predictions compare with references. Part III extends the derivative foundation through model computations and uses gradients to update parameters.
Chapters in this part
- Linear models: Weighted features define predictions and decision boundaries. Loss gradients describe the effect of small parameter changes.
- From scores to probabilities: Sigmoid and softmax turn scores into probabilities under different class assumptions.
- Decoding strategies: Next-token probabilities need a selection rule and repeated feedback to produce a generated sequence with fixed parameters.
- Cross-entropy and perplexity: Logarithmic losses compare probabilities with reference answers. An inclusion rule determines their mean and perplexity.
- Validation and testing: Performance on new inputs needs held-out examples, task-appropriate metrics, and development choices separated from final testing.