Model Evaluation and Failure Modes
How to find out whether a model is good enough for your agent, and how it tends to fail.
Public benchmarks suggest which models to try; only your own test cases show whether one works for your agent. Score tool choice, arguments, planning and instruction following separately, run each case several times, and watch for the typical failures: invented facts, claimed but unperformed actions, inconsistent tool calls and behavior that changes after an update.
What you will learn: which abilities matter for agents, how to build a small test set, how to score tool use in parts, how to measure consistency, the main failure modes and their remedies, and how to catch drift.
Prerequisites: How LLMs Power Agents: Transformers, Tokens and Sampling and Agent Tools, Function Calling and Tool Registries.
Why ordinary benchmarks are not enough
A public benchmark measures performance on someone else's tasks, with someone else's prompts and scoring. Your agent uses particular tools, follows particular rules and meets particular users. Two models with similar published scores can behave very differently on a refund request with a missing order number.
Think of benchmarks as a shortlist and your own evaluation as the interview. Choosing Models: Reasoning, Open-Weight and Hosted describes how to weigh quality against cost and speed; this page concentrates on measuring quality and understanding failures.
The abilities an agent relies on
| Ability | Question to test | How to score |
|---|---|---|
| Tool selection | Does it pick the right tool, or none? | Compare with the expected tool |
| Argument accuracy | Are values correct, complete and in the right units? | Compare fields; validate against the schema |
| Planning | Are steps valid, ordered and sufficient? | Simulate or check the end state |
| Instruction following | Does it obey format, scope and rules? | Code checks where possible |
| Grounding | Are claims supported by the supplied material? | Trace each claim to a source |
| Restraint | Does it ask, refuse or stop when it should? | Cases where acting is wrong |
| Recovery | What does it do after a tool error? | Inject failures and observe |
| Consistency | Does it succeed every time? | Repeat runs |
Build a first test set
Thirty good cases beat a thousand careless ones at the start. Draw them from real requests where you can, with personal data removed. For each case write the input, any starting data, the expected tool calls or end state, and the rules that must not be broken.
- Typical cases that make up most of the traffic.
- Edge cases: missing details, two requests in one message, unusual formats.
- Negative cases where the correct action is to do nothing or ask.
- Failure cases: a tool times out, returns nothing or returns an error.
- Hostile cases: instructions hidden in documents, attempts to exceed permission.
Add every real incident to the set once it is understood. See Golden Datasets, Synthetic Data and Simulation.
Score tool use in parts
A single pass or fail tells you little. Separate the kinds of error, because each has a different remedy:
"""Score tool use in parts, so you know what to fix."""
CASES = [
# request, expected (tool, args) or None, what the model did
("Where is order A-17?",
("get_order", {"id": "A-17"}), ("get_order", {"id": "A-17"})),
("Cancel order B-2",
("cancel_order", {"id": "B-2"}), ("get_order", {"id": "B-2"})),
("Refund 20 dollars on C-3",
("refund", {"id": "C-3", "cents": 2000}),
("refund", {"id": "C-3", "cents": 20})),
("What are your opening hours?", None, ("get_order", {"id": "?"})),
("Thanks, that is all", None, None),
("Cancel my order", None, ("cancel_order", {"id": "A-17"})),
]
def score(expected, actual):
if expected is None:
return "correct: no call" if actual is None else "unneeded call"
if actual is None:
return "missed call"
if actual[0] != expected[0]:
return "wrong tool"
if actual[1] != expected[1]:
return "wrong arguments"
return "correct call"
if __name__ == "__main__":
results = []
for request, expected, actual in CASES:
results.append(score(expected, actual))
print(f"{results[-1]:<17} {request}")
good = sum(r.startswith("correct") for r in results)
print(f"\n{good} of {len(results)} fully correct")
Output:
correct call Where is order A-17?
wrong tool Cancel order B-2
wrong arguments Refund 20 dollars on C-3
unneeded call What are your opening hours?
correct: no call Thanks, that is all
unneeded call Cancel my order
2 of 6 fully correct
The wrong tool suggests overlapping tool descriptions. Wrong arguments, such as 20 cents instead of 20 dollars, suggest an unclear unit that a better parameter name would fix. Unneeded calls suggest the instructions never say when not to act. In real scoring, allow for harmless variation, such as different but equivalent search text, and check effects rather than exact strings where you can.
A catalog of failure modes
| Failure | What it looks like | Detect | Reduce |
|---|---|---|---|
| Invented fact | A plausible policy or number with no source | Require a source for each claim and check it | Retrieval, permission to say "not found" |
| Invented tool result | Describes data it never fetched | Compare the answer with the call log | Feed real results back; verify in code |
| False completion | "Your refund is processed" with no successful call | Check the system of record | Report success only from the tool response |
| Ignored instruction | Breaks a format or scope rule | Automated rule checks | Clearer rules, structured output, code enforcement |
| Inconsistent tool calls | Same request, different actions | Repeat runs and compare | Narrow tools, examples, workflow steps |
| Lost context | Forgets a constraint after many turns | Long multi-turn cases | Keep constraints in pinned state; see Context Poisoning, Distraction, Confusion, Clash and Rot |
| Premature stop | Declares success with work remaining | Check completion criteria | Explicit definition of done |
| Agreeing too readily | Accepts a user's false premise | Cases with wrong assumptions | Ask it to verify before acting |
| Over-refusal | Declines legitimate work | Benign cases near the boundary | State what is allowed and why |
What a good case records
Write cases as data, so that a script can run them and a colleague can review them. A useful record has these fields:
| Field | Example | Why it matters |
|---|---|---|
| Identifier | refund-017 | Lets you compare the same case across versions |
| Input and history | The message and earlier turns | Many failures only appear after several turns |
| Starting data | Order C-3 exists, delivered, 20 dollars | Makes the correct action unambiguous |
| Expected outcome | One refund of 2,000 cents, confirmation shown | Judges effects, not wording |
| Forbidden outcomes | No second refund; no other order touched | Catches harm that a correct-looking reply hides |
| Slice labels | money, single order, English | Allows separate reporting |
| Origin | Support ticket, anonymized, with date | Shows whether the set still reflects real use |
If two knowledgeable people disagree about the expected outcome, the case is not ready, and often the underlying business rule is unclear too. Settle the rule first. This is one of the quiet benefits of building a test set: it exposes decisions that nobody had made.
Hallucination in agents
Hallucination means output that is presented as fact but is not supported. In a chat, a person can question it. In an agent, an invented value may become the argument of the next call, and the error travels on. Three habits help: pass identifiers from tool results rather than letting the model retype them, validate every argument against real data, and make "I could not find this" an acceptable outcome that your scoring rewards.
Include questions whose answers are not available. If every case has an answer, a model that always guesses will look better than one that admits uncertainty.
Instruction following
Many rules can be checked without judgment: reply length, required fields, forbidden phrases, language, valid JSON, a required confirmation before an action. Research suites such as IFEval use exactly this idea of verifiable instructions. Write your own rules the same way and run them on every output. Keep model-based grading for qualities that code cannot check, and calibrate it against human ratings as described in LLM Judges, Human Review and Ratings.
Consistency: the hidden requirement
Outputs vary between runs. A model that succeeds three times out of four on a task sounds reasonable, yet a user who needs it to work eight times in a row will usually be disappointed. The τ-bench paper introduced pass^k: the chance that all of k attempts at the same task succeed.
"""pass@1 hides inconsistency. pass^k asks: right in all k attempts?"""
from math import comb
# Successes out of 8 attempts for each of ten tasks. Invented data.
MODEL_A = [8, 8, 8, 8, 8, 8, 0, 0, 0, 0]
MODEL_B = [6, 5, 7, 6, 5, 7, 6, 5, 6, 7]
def pass_k(successes, trials, k):
"""Chance that k attempts drawn from the trials all succeed, averaged."""
return sum(comb(c, k) / comb(trials, k) for c in successes) / len(successes)
if __name__ == "__main__":
print(" pass^1 pass^2 pass^4 pass^8")
for name, data in (("model A", MODEL_A), ("model B", MODEL_B)):
row = "".join(f"{pass_k(data, 8, k):8.0%}" for k in (1, 2, 4, 8))
print(f"{name:<8}{row}")
Output:
pass^1 pass^2 pass^4 pass^8
model A 60% 60% 60% 60%
model B 75% 55% 26% 0%
Model B wins on a single attempt and loses badly on repeated ones. Model A always fails four of the tasks, but its failures are predictable: you can find them, route them to a person and trust the rest. In the τ-bench paper's own experiments, GPT-4o succeeded on fewer than half of tasks and fell below 25% on pass^8 in the retail domain. Those figures describe that study and that model at that time; use the method rather than the numbers.
How sure can you be?
Small test sets give rough answers. If a model passes 45 of 50 cases, the score is 90%, but a simple 95% interval is roughly 8 points either side. A rival scoring 94% on the same 50 cases is not clearly better. Either add cases, repeat runs, or compare case by case: how many did the new model fix, and how many did it break?
Report separate scores for important slices. A 95% average can hide 60% on refunds.
Testing planning
For multi-step tasks, judge the outcome and the route. Did the final state match the goal? Was every step allowed at the moment it ran? Were there needless calls? Did it replan sensibly after a failure? Reasoning Traces and Planning Benchmarks includes a small plan checker you can adapt.
Drift: when behavior changes under you
Behavior can change because the provider updates a model behind an alias, because you upgrade a version, because your tools or documents change, or because users start asking different things. A study comparing March and June 2023 versions of GPT-3.5 and GPT-4 found that the behavior of the same named service changed substantially in that short period, including how well instructions were followed.
- Pin a specific model version where the provider offers one.
- Record the model identifier returned with each response.
- Run the evaluation set on a schedule, even when you changed nothing.
- Watch retirement notices and leave time to test replacements.
- Monitor live signals: tool error rate, human corrections, escalations, cost per task.
See Promotion, Feature Flags, Rollback and Drift and Continuous Evaluation, Statistics and Scorecards.
Turn the results into a decision
Agree the thresholds before running the test. An example scorecard:
| Criterion | Threshold | Type |
|---|---|---|
| Forbidden actions in hostile cases | None observed | Blocking |
| Correct end state on core tasks | At least 92% | Blocking |
| pass^4 on money-related tasks | At least 90% | Blocking |
| Valid structured output | At least 99% | Blocking |
| Cost per completed task | Within budget | Review |
| p95 response time | Within target | Review |
The numbers are placeholders. Set yours from the harm a failure causes and from how well the current process performs. "None observed" is not proof that an action cannot happen, which is why permissions must also be enforced outside the model.
Make the harness trustworthy
- Reset test data before every run, so earlier cases cannot help or harm later ones.
- Use fake or sandboxed tools; never let an evaluation send real messages or payments.
- Store inputs, outputs, tool calls, versions and scores for each run.
- Read a sample of passes as well as failures; graders can be wrong in both directions.
- Keep a hidden portion of cases that is not used while tuning prompts.
After many rounds of prompt edits against the same cases, the score rises faster than real quality. Refresh the set with new cases from production and compare against the hidden portion.
Write a failure report people can use
A score alone rarely changes a decision. Alongside it, list the three most common failure types with one real example of each, the worst possible consequence observed, the cases that got worse compared with the current version, and the recommended action. Owners of the process can then judge whether the remaining errors are acceptable, which is their decision rather than the model's.
An invented support team finds that a newer model scores two points higher overall. Case-by-case comparison shows it now cancels orders without confirmation in three situations where the old model asked. The team keeps the old version, moves the confirmation rule into code, and tests again before switching.
Users experience the whole agent, so release decisions need end-to-end tests. When a test fails, replay the same step with fixed inputs to learn whether the model, the prompt, the retrieval or a tool was responsible.
Evaluation checklist
- Cases cover typical, edge, negative, failure and hostile situations.
- Tool choice, arguments and end state are scored separately.
- Important cases are run several times and consistency is reported.
- Unanswerable questions are included.
- Blocking thresholds are agreed before testing.
- Model versions are pinned and recorded.
- The set runs on a schedule and grows from incidents.
Frequently asked questions
Is temperature zero enough to make results repeatable?
It reduces variation but does not guarantee identical outputs from hosted services, and some models do not offer the setting. Repeat runs and measure the variation.
Can one model grade another?
Yes, for qualities that code cannot check, but verify its grades against human judgment first and re-check when the grading model changes.
How often should I re-evaluate?
On every change to the model, prompt, tools or data, plus a regular scheduled run to catch changes you did not make.
References and further reading
- Yao et al., τ-bench: A Benchmark for Tool-Agent-User Interaction
- τ-bench repository, which points to its newer successor
- Chen, Zaharia and Zou, How is ChatGPT's behavior changing over time?
- Zhou et al., Instruction-Following Evaluation for Large Language Models
- NIST AI Risk Management Framework
Next steps
Agent Testing: Unit to End-to-End
Extend model tests to the whole agent.
Task, Tool and Planning Metrics
Choose measures that reflect real success.
Fix Tool Calling and Invalid JSON Errors
Diagnose the failures you find.