liveBook · Manning

Accuracy

As explained in How Large Language Models Work

Accuracy is the proportion of model outputs or predictions that are correct according to the evaluation criterion.

Accuracy is the share of predictions that match the evaluation criterion. If a model gets 48 of 50 cases right, its accuracy reflects those 48 successful predictions. section 4.1.1

Accuracy is useful for judging predictive success, but it is not smooth: one prediction changes the score in a jump, and partial correct cases do not exist. Because training algorithms need a better-behaved target, cross-entropy loss often acts as a proxy for accuracy. section 4.1.1

A cancer-prediction example

For 50 patients, a model that predicts 48 correctly has 48 successful predictions out of 50. The result cannot become 48.2 correct cases, so accuracy changes discretely rather than continuously. section 4.1.1

Figure 4.2 Examples of a smooth function on the left and two nonsmooth functions on the right. The center example is mostly smooth, but one region is not smooth because the function has no value. On the right, the function is not smooth anywhere due to the hard change in value.
figure

Use the figure to compare smooth functions with abrupt, nonsmooth changes—the behavior that makes accuracy unsuitable as a direct training loss. section 4.1.1

How How Large Language Models Work covers it

How deep it goes
Defines accuracy through correct counts and explains why training uses cross-entropy instead.
Examples
Uses cancer predictions for 50 patients, including a case with 48 correct predictions, to illustrate discrete changes.
What it assumes
Assumes only that predictions can be counted as correct or incorrect.
What you can do after
Evaluate/understand why accuracy measures success but cannot directly train an algorithm.
How it connects
Connects accuracy to loss functions, cross-entropy loss, proxy problems, and machine-learning training.

Also explained in

Compare how 32 books explain accuracy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.