Metric

A metric is a number that measures how well an AI model or system performs on something people care about, such as accuracy, error rate, speed or cost.

A metric turns a model's behaviour into a number that can be tracked and compared. Google's machine learning glossary defines it simply as a statistic you care about. Accuracy, precision, recall and the F1 score are metrics for classifiers. Perplexity is a metric for language models. ROUGE and BLEU score generated text against reference text. Latency, cost per request and the share of answers a human rater prefers are metrics too.

Metrics come in two roles. Some are used during training: Google's glossary calls the metric a system tries to optimise its objective, and a loss function is the usual example. Others are used afterwards to judge the finished model on a validation or test set. The two often differ. A language model is trained to lower its loss on next-token prediction, but people judge it on whether its answers are correct, useful and safe.

Choosing the metric is a real decision, because each one hides something. Google's own example is a model that predicts snow in a city where it snows on 25 days per century: a model that always says no snow scores 99.93% accuracy and is useless. Its recall of zero would expose it straight away. For that reason serious evaluations report several metrics side by side rather than one headline figure.

Metrics can also mislead when they become targets. In a 2020 paper, Rachel Thomas and David Uminsky argued that heavy reliance on optimising metrics invites gaming and manipulation, encourages short-term thinking and has other unexpected harmful consequences. They proposed using a slate of metrics, pairing them with qualitative accounts, and involving the people most affected in deciding what counts.

In practice, when a story says a model scored higher, the first question is: higher on which metric, measured on what data? A jump on one benchmark score can be real progress, a quirk of the test, or a sign the model was tuned for that number.

Common questions

What is the difference between a metric and a loss function?

A loss function is the quantity a model minimises during training, so it has to be something the training algorithm can work with directly. A metric is any measurement used to judge the model, and many of the most important ones, such as accuracy or human preference, are not optimised directly. Google's glossary calls the metric being optimised the objective.

What are the most common metrics for AI models?

For classifiers, accuracy, precision, recall and the F1 score. For language models, perplexity during development and benchmark scores, win rates in side-by-side comparisons and human ratings afterwards. For summarisation and translation, overlap scores such as ROUGE and BLEU. Operational metrics such as latency, throughput and cost matter as much once a model is deployed.

Why is accuracy sometimes a bad metric?

When one outcome is rare, a model can score very high accuracy by always predicting the common outcome. Google's example of a snow forecaster that always says no snow reaches 99.93% accuracy while missing every snowy day. Its recall, which is zero, reveals that kind of failure.

Finding more

Search for the specific metric's name together with "definition" or "formula", or for "evaluation metrics for classification" and "LLM evaluation metrics". Machine learning glossaries and courses from Google, documentation for libraries such as scikit-learn, and the original papers that introduced a metric are the most dependable. When a company reports a score, look for which metric it used, on which dataset, and whether the comparison models were measured the same way.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.