DEV Community

Yodit Weldegeorgise
Yodit Weldegeorgise

Posted on

𝗔𝗜 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝗶𝗻𝗴 𝗖𝗵𝗮𝗽𝘁𝗲𝗿 𝟯: 𝗪𝗵𝘆 𝗘𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗻𝗴 𝗔𝗜 𝗜𝘀 𝗛𝗮𝗿𝗱𝗲𝗿 𝗧𝗵𝗮𝗻 𝗜𝘁 𝗟𝗼𝗼𝗸𝘀

One of the biggest takeaways from Chapter 3 of AI Engineering was realizing that building an AI model is only part of the challenge. Figuring out 𝗵𝗼𝘄 𝘁𝗼 𝗲𝘃𝗮𝗹𝘂𝗮𝘁𝗲 𝗶𝘁 𝗳𝗮𝗶𝗿𝗹𝘆 𝗮𝗻𝗱 𝗮𝗰𝗰𝘂𝗿𝗮𝘁𝗲𝗹𝘆 can be just as difficult.

With traditional software, it's usually easy to tell whether something works. If a calculation is wrong or a test fails, you know there's a bug. But AI doesn't always work that way. A model can generate multiple reasonable answers to the same question, making it much harder to determine which one is actually better.

That made me think:

𝗛𝗼𝘄 𝗱𝗼 𝘄𝗲 𝗸𝗻𝗼𝘄 𝗶𝗳 𝗮𝗻 𝗔𝗜 𝗺𝗼𝗱𝗲𝗹 𝗶𝘀 𝗮𝗰𝘁𝘂𝗮𝗹𝗹𝘆 𝗶𝗺𝗽𝗿𝗼𝘃𝗶𝗻𝗴?

𝗕𝗲𝗻𝗰𝗵𝗺𝗮𝗿𝗸𝘀 𝗡𝗲𝗲𝗱 𝘁𝗼 𝗞𝗲𝗲𝗽 𝗘𝘃𝗼𝗹𝘃𝗶𝗻𝗴

Reading this section made me realize how difficult it is for evaluation benchmarks to keep up with the pace of AI development.

The chapter explains that GLUE (General Language Understanding Evaluation) was introduced in 2018 to measure how well language models performed on common natural language tasks. But within about a year, models had already become so good at it that researchers introduced SuperGLUE in 2019 as a more difficult benchmark.

GLUE evaluates tasks such as:

Question answering
Sentiment analysis
Sentence similarity
Text classification

The chapter also mentions newer benchmarks like:

SuperGLUE
MMLU (Massive Multitask Language Understanding)
MMLU-Pro

Each one was introduced because the previous benchmark was no longer challenging enough.

What I found interesting is that a model getting a higher benchmark score doesn't always mean it understands language better. Sometimes it simply means the model has become very good at solving that particular benchmark.

𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗘𝗻𝘁𝗿𝗼𝗽𝘆 𝗮𝗻𝗱 𝗣𝗲𝗿𝗽𝗹𝗲𝘅𝗶𝘁𝘆

Another section I really enjoyed was the explanation of entropy and perplexity.

The chapter explains entropy as a measure of how much information a token carries and how difficult it is to predict the next token in a sequence.

Perplexity measures uncertainty. If a model is very uncertain about what comes next, its perplexity will be higher. If it predicts confidently and accurately, the perplexity becomes lower.

I also liked learning that cross entropy, perplexity, bits-per-character (BPC), and bits-per-byte (BPB) are all different ways of measuring how well a language model predicts text. The better a model predicts text, the lower these metrics become.

Another point that stood out was that there isn't a single "good" perplexity score. The value depends on:

the dataset being evaluated
the tokenizer being used
how perplexity is calculated
how much context the model has access to

That was a helpful reminder that metrics should always be interpreted in context instead of being compared blindly.

I also found it fascinating that these metrics connect directly to text compression. If a model predicts text efficiently, it can represent that information using fewer bits. I had never thought about language models and data compression being so closely related before reading this chapter.

𝗘𝘅𝗮𝗰𝘁 𝗘𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗼𝗻 𝘃𝘀. 𝗦𝘂𝗯𝗷𝗲𝗰𝘁𝗶𝘃𝗲 𝗘𝘃𝗮𝗹𝘂𝗮𝘁𝗶𝗼𝗻

Another concept that made a lot of sense was the difference between exact and subjective evaluation.

Some tasks have one correct answer.

For example:

Solving a math problem
Passing a unit test
Answering a multiple-choice question

Those are easy to evaluate because the answer is either correct or incorrect.

But many AI applications don't work that way.

How do you measure whether one response is more helpful, more creative, or better written than another?

That's where evaluation becomes much more subjective.

𝗔𝗜 𝗝𝘂𝗱𝗴𝗶𝗻𝗴 𝗔𝗜

This was probably my favorite section of the chapter.

Instead of relying only on humans, researchers are now using one AI model to evaluate another.

An AI judge can answer questions like:

Is this response relevant?
Does it contain hallucinations?
Which response is better?
Which answer would users probably prefer?

The chapter even discusses research showing that some AI judges can agree with human evaluators surprisingly often.

But it also explains why we shouldn't blindly trust these judges.

They can be influenced by:

the prompt
the order responses are presented
the model itself
different scoring methods

One sentence from the chapter really stuck with me:

"Do not trust any AI judge if you can't see the model and the prompt used for the judge."

That feels like a good reminder as more AI tools become black boxes.

𝗟𝗼𝗼𝗸𝗶𝗻𝗴 𝗕𝗲𝘆𝗼𝗻𝗱 𝘁𝗵𝗲 𝗪𝗼𝗿𝗱𝘀

Another idea I found interesting was the difference between lexical similarity and semantic similarity.

Two sentences can use completely different words while meaning almost the same thing.

For example:

"What's up?"
"How are you?"

On the other hand, two sentences can look almost identical while meaning something completely different.

The classic example from the chapter was:

"Let's eat grandma."
"Let's eat, grandma."

A single comma changes everything.

This is where embeddings become so important. Instead of comparing words directly, embeddings represent meaning as vectors, allowing models to compare ideas rather than just matching text.

That's what powers many modern AI applications like semantic search, recommendation systems, retrieval, clustering, and RAG.

𝗖𝗼𝗺𝗽𝗮𝗿𝗶𝗻𝗴 𝗜𝗻𝘀𝘁𝗲𝗮𝗱 𝗼𝗳 𝗦𝗰𝗼𝗿𝗶𝗻𝗴

The chapter also discusses comparative evaluation, an approach that compares responses instead of scoring them individually.

It's often easier to compare two responses than to assign one response an absolute score.

It's much easier to say:

"Response A is better than Response B."

than to confidently say:

"This response deserves exactly 8 out of 10."

That idea is now used heavily in preference training and ranking AI models.

This chapter gave me a new appreciation for AI evaluation.

Before reading it, I mostly thought about model architectures, prompting, fine-tuning, and inference. Now I realize that evaluation is just as important.

A powerful model isn't necessarily a useful model. If we can't measure reliability, usefulness, safety, or alignment, it's difficult to know whether a model is actually improving.

One of my biggest takeaways from this chapter is that evaluation isn't just about assigning a score to a model. It's about understanding what those scores actually mean, choosing the right evaluation method for the task, and recognizing the limitations of each approach.

As AI continues to evolve, I think building better evaluation methods will become just as important as building better models.

Top comments (0)