AI Hints
Home›Generative AI Tutorial›Evaluating and Running Real Models
Generative AI · Lesson 72 of 77

Evaluating Language Models

Perplexity, benchmarks and judges.

⏱ 2 min read▶ Video at 2:34:46🎓 Free
Watch this lesson in the Generative AI courseWatch on YouTube ↗Full Generative AI course

How do researchers measure whether one language model is better than another? There is no single number that captures everything. In this lesson, you will meet the main methods, perplexity, benchmarks, human ratings, and models as judges, and learn what each one can, and cannot, tell you.

Evaluating Language Models
From the video: Evaluating Language Models
  • No single number tells the whole story
  • Four main methods
  • What each can and cannot tell you

Perplexity: how surprised is the model

The oldest measure is perplexity. It tells you how surprised a model is, by real text it has not seen. A lower perplexity means the model predicted the text better. It is useful during training, and for comparing models of the same kind. But it does not tell you whether answers are helpful, honest, or safe, so it is only one piece of the picture.

Measures surpriseon text the model has not seen
Lower is betterbetter next-word predictions
Great during trainingcompare similar models
Limitationsays nothing about helpfulness or safety

Benchmarks

Benchmarks are collections of questions, with known answers. Some test general knowledge, some test maths, some test coding, some test common sense. They give a quick, comparable score. But take care. Models may have seen the questions in training. Many benchmarks become too easy, as models improve. And a high score, may not match your own task. Use them as a first filter, and not as a final verdict.

Questions with known answersknowledge, maths, code, common sense
Quick and comparableone score per model
Watch outtest questions may leak into training
Use as a first filternot as the final verdict

Human ratings and model judges

For open ended tasks, like writing and chatting, people compare answers side by side, and pick the better one. This is the most trustworthy method, but it is slow, and expensive. So teams often use a strong model, as a judge, to score answers, using a clear rubric. It is fast, and scales well, but the judge has its own biases, such as preferring longer answers. A good approach combines both, with spot checks by humans.

Human ratings

  • Trusted, and nuanced
  • Slow and expensive
  • Best for final decisions

Model as judge

  • Fast and scalable
  • Has its own biases
  • Best for frequent testing

Summary

Good. Perplexity measures surprise, benchmarks give quick scores, human ratings are trusted but slow, and model judges are fast but biased. Combine several, and always test on your own task. Next, we get hands on with a real model, in a few lines of code.

Key takeaways
  • Perplexity: surprise on unseen text
  • Benchmarks: quick, but can mislead
  • Humans plus model judges, on your task
Next up: Running a Real Model in Code — GPT-2 on your own computer