The loss went down. But is the model actually good at our task? Loss alone can't tell us. We need to measure the answers themselves. And that's harder than it sounds.
With a classifier, the answer is one label, so it's either right or wrong. A language model writes free text. The same answer can be written in many ways. And for open tasks, like writing a friendly reply, there may be many good answers.
Here's a small example. Three strings, all saying the same thing. B has the keys in a different order. C has no spaces. Run it. As plain text, they're all different. But parsed as JSON, they're equal. So for our task, we compare parsed JSON, not text.
app.pypython
import jsona = '{"intent": "stock", "book": "Dune"}'b = '{"book": "Dune", "intent": "stock"}'c = '{"intent":"stock","book":"Dune"}'print("a == b as text:", a == b)print("a == c as text:", a == c)print("a == b as JSON:", json.loads(a) == json.loads(b))print("a == c as JSON:", json.loads(a) == json.loads(c))
Output
a == b as text: False
a == c as text: False
a == b as JSON: True
a == c as JSON: True
There are three main kinds of measurement. Exact checks compare against a known answer. They're cheap, and perfect for structured output. Perplexity measures how surprised the model is by the right answer. And for open text, people, or another model, judge the quality.
Let's recap. Loss alone isn't enough. Free text is hard to compare. Parse structured output before comparing. And pick a measurement that fits the task. Next, exact match and valid JSON.