Extracting and Evaluating Model Responses
Many machine learning models are judged with a single, simple calculation.
Why One Accuracy Number Is Not Enough
What do you think happens?
A chatbot is asked to explain photosynthesis. Can you check its answer by comparing it to one stored correct string?
Reveal answer
No, there is usually no single correct string
An instruction-fine-tuned LLM such as a chatbot is asked to follow instructions and produce open-ended responses. Many different responses can be acceptable, so a simple string comparison does not capture quality.
Many machine learning models are judged with a single, simple calculation. If a model is fine-tuned to assign one of a fixed set of labels, every input has a known correct answer. You run the model over the test inputs, count how many predicted labels match the known answers, and report the proportion of matches. That number is a clean measure of quality. This article explains why the same calculation does not work for an instruction-fine-tuned LLM such as a chatbot, and what evaluators do instead.
Classifiers Versus Chatbots
A classifier that is fine-tuned to assign labels has a clear output space. Its answer is one of a fixed set of labels, so the output can be checked directly against a known answer for each input. The evaluation question is simply whether the chosen label matches the expected one.
An instruction-fine-tuned LLM works differently. It is asked to follow instructions and produce open-ended responses. The output is free-form text, and there is usually no single correct string to compare against. Two responses can be different in wording, length, and structure and still both be helpful. A string match would mark good answers wrong, so the accuracy calculation cannot be applied directly.
Three Evaluation Approaches
The source names three approaches for evaluating instruction-fine-tuned LLMs. They are not interchangeable. Each one answers a different question about the model, and each one relies on a different kind of scorer.
| Approach | Example named in the source | What it measures | Who or what does the scoring |
|---|---|---|---|
| Short-answer and multiple-choice benchmarks | MMLU | General knowledge of the model | A fixed answer key |
| Human preference comparison | LMSYS chatbot arena | Which response people prefer | Human raters |
| Automated conversational benchmarks | AlpacaEval | Quality of conversational responses | Another LLM, such as GPT-4 |
The three approaches named in the source for evaluating instruction-fine-tuned LLMs
Extracting a Usable Answer for Multiple-Choice Scoring
Short-answer and multiple-choice benchmarks such as MMLU test general knowledge of a model. For multiple-choice items, the answer key is a fixed option, such as B. A chatbot, however, usually returns a full sentence or paragraph. Before the response can be checked against the key, the evaluator has to pull a single answer out of the free text. The diagram shows one way to think about that pipeline.
Scoring one free-text response
A multiple-choice item has options A, B, C, and D, and the answer key is B. The model returns: The best choice here is B, because the passage supports that reading.
- 1Read the raw response
The response is a sentence, not a bare letter. Scoring cannot compare the whole sentence to the key directly.
- 2Locate the answer statement
The phrase The best choice here is identifies the answer the model committed to.
- 3Map the statement to an option
The text names B, which corresponds to one of the four options.
- 4Compare with the key
B matches the answer key B, so this item is scored as correct.
The free-text response is scored as correct, because one usable answer was extracted and it matches the key.
Human Preference Comparison
Human preference comparison compares LLMs based on human preference. The LMSYS chatbot arena is the source's illustration. Instead of matching an answer key, the evaluation shows people two candidate responses to the same prompt and records which one they prefer. Because the question is about preference, a human rater is the scorer.
Each recorded choice is one vote for one of the two responses. Aggregating many such choices gives a win rate: the share of comparisons in which a model's response was preferred. The win rate is a comparison result, not a match against a stored correct string.
Tracing an LLM Judge
Automated conversational benchmarks replace the human judge with another language model. AlpacaEval is the source's example, and it uses another LLM such as GPT-4 to evaluate responses. The sequence below traces the path step by step. Notice that there are two separate LLMs with two separate roles. The model being tested generates the response. The evaluating LLM assesses it.
Read the sequence in order. The prompt goes to the model being tested, which produces an answer. That answer is passed to the judge model, which reads it and returns a judgment. The score comes from the judge, not from a human and not from an answer key. The two LLMs never play the same role: one generates, the other evaluates.
Matching Approach to Conversational Quality
Compare the three approaches by what they need. A multiple-choice benchmark needs a fixed answer key and produces a clear score, but it can only check responses that reduce to one option. A chatbot's conversational quality is open-ended, so there is often no key to compare with. Human preference comparison and automated judges both work without a single correct string. They assess how a response reads and whether it is preferred, which is closer to what conversational performance means.
Mistakes Learners Make
Common mistake Applying label accuracy to a chatbot
What it looks likeCounting a response as wrong because its wording differs from a stored reference sentence.
Why it failsAn instruction-fine-tuned LLM produces open-ended responses, and there is usually no single correct string to compare against.
Do this insteadUse an evaluation approach designed for open-ended output, such as human preference comparison or an automated conversational benchmark.
Common mistake Treating the three approaches as interchangeable
Why it failsThe source states that each approach answers a different question and they are not interchangeable.
Do this insteadName the question first, then choose the approach that measures it.
Common mistake Assuming the judge and the tested model are the same LLM
What it looks likeBelieving the model that writes the answer also grades it.
Why it failsIn an automated conversational benchmark, the model being tested and the evaluating LLM are two separate LLMs with two separate roles.
Do this insteadTrace the two roles separately: one model generates the response and the other assesses it.
Common mistake Forgetting that a free-text answer must be reduced to a usable option before it can be checked against a multiple-choice key
Practice Tracing a Judge Setup
A team evaluates a chatbot by sending it a prompt, then sending its answer to a second LLM, which returns a score. Name the model that generates the answer, the model that assigns the score, and the approach being used. Then explain in one sentence why a fixed answer key would not suit this chatbot.
Hints
- Ask which model produces text and which model reads that text.
- The source names AlpacaEval as an example of an automated conversational benchmark.
- Think about whether there is usually a single correct string for an open-ended response.
Key Takeaways
- An instruction-fine-tuned LLM such as a chatbot produces open-ended responses, so label-accuracy calculations do not directly apply to it.
- The three approaches are short-answer and multiple-choice benchmarks such as MMLU, human preference comparison such as the LMSYS chatbot arena, and automated conversational benchmarks such as AlpacaEval.
- In an automated conversational benchmark, the model being tested generates a response and a separate evaluating LLM, such as GPT-4, assesses it and returns a judgment.
- Judge-based and preference-based evaluation map best to conversational quality because fixed benchmarks depend on a known answer that open-ended responses usually lack.