Professional domain 4 · Evaluation, testing and optimization
Exam guide v1.1 · the exam from 7 December 2026 · This domain in exam guide v1.0 (the exam until 6 December 2026)
Seven skills. Each starts from evidence: a failure that reached production, a judge that disagrees with people, a trace, telemetry, or regression results.
Evaluation coverage gaps
- A failure got past the evaluation suite. Name the dimension the suite didn't measure: accuracy, groundedness, latency, cost, safety or security. Then name the metric that would have caught it before release.
- The gap can also be the grading target: what the suite looked at. It graded the final message when the fault was in the end state (what the system did), in the path taken (a step, a tool call, the retrieved sources) or between the turns of a conversation; or it graded an average over many fields or cases when one of them carried the harm.
- Match the metric to the failure, and measure it on cases like the ones that failed. An invented figure is a groundedness failure, caught by checking each claim against the source cited for it. A slow tail is a latency failure, caught by a percentile on inputs of production size; for a streamed reply, by the time to the first text. A bill that grew is a cost failure, caught by cost summed over a whole task and read as a mean or a total, because a few expensive tasks don't move a median. A harmful reply is a safety failure, caught by grading what the reply gives, not whether it contains a refusal. A leaked instruction or an unauthorized action is a security failure, caught by adversarial cases.
- Wrong turns: more cases of the kind the suite already has; a general quality score; fixing the prompt with no test added for the failure.
Deriving evaluations from business processes
- An evaluation exists to support a decision: a model change, a prompt change or a release gate. Start from that decision and from the business outcome, and derive the success criterion from it as a number with a threshold, counted in the unit the outcome is counted in (a whole case, not a field) and on the class of case where an error costs most. Overall accuracy can hide a rare, costly class.
- A valid evaluation gives its verdict before the decision takes effect, on the step the decision changes, against answers known to be right. Signals that arrive after release (tickets, surveys, turnaround times) move with other causes and come too late, and a live trial puts real users at risk. Agreement with the present system measures sameness, not correctness.
- A valid evaluation uses the part of the process that the decision affects, with cases that match the deployed distribution: the real mix of request types, including the rare and costly ones, in their real proportions or weighted by what an error costs.
- Mix the methods so that each property gets the cheapest one that judges it reliably: code-based checks where an answer can be checked exactly, model-based grading for judgment at volume once it has been checked against human labels, human review where the judge agrees poorly, for the cases that carry the risk, and for calibrating the rest.
- Wrong turns: a test set of easy or hand-picked cases; a criterion taken from what is easy to measure and not from the outcome; one method for everything.
LLM-as-judge design and bias
- When a judge model and human reviewers disagree, find the bias responsible. Position: the judge favors an answer by where it sits in the comparison. Verbosity: it favors the longer answer. Self-preference: it favors output from its own model family. Judge drift: its scores change over time, for example when the judge model or its prompt changes.
- Find the responsible bias from the evidence. Each suspect has a test: swap the order, judge on required points regardless of length, change the judge's family, re-score a fixed set. The test that brings the judge's figure back to the human one names the bias. If no bias fits and the judge gives different scores to the same answer, the fault is the rubric: replace one overall score with named criteria that each have a defined pass and fail.
- Each has its correction. Position: present the answers in every order (both orders for a pair, rotated orders for a longer list) and keep only what holds across them. Verbosity: score each answer on the required points and give no credit beyond them; don't trim the answers or deduct for length, which swaps one bias for its opposite. Self-preference: a judge from a model family that none of the candidates comes from. Drift: pin the judge's model version and its rubric, check a new judge against human labels before it replaces the old one, and when the rubric has to change, re-score the earlier period under the new one so that the trend stays on one scale.
- A judge needs a clear rubric, a constrained output (a grade, not an essay) and regular checks against human labels on a sample.
- Wrong turns: a larger judge model with the bias unchanged; dropping human review because the judge is cheaper; averaging more runs of a biased judge.
Experimental design for configuration comparison
- Two prompt or model configurations, a fixed sample and cost budget. The design has to make the comparison interpretable: both run on the same cases, with one thing changed.
- Model output varies from run to run. One trial per case can't separate a real difference from that variance, so run each case several times. How many depends on how noisy the case is: stable cases need few, borderline ones more.
- The budget forces a trade between more cases and more trials per case. Spend trials where the variance is, keep enough distinct cases to cover the distribution, and stay inside the budget the question states.
- Hold everything else fixed: the same cases, the same pinned model and judge versions, runs made in the same period. Read the result against the spread: a gap smaller than the run-to-run spread means the two are not separated yet, which is not the same as equal. A configuration picked as the best of many on one set has to be confirmed on cases the search never touched.
- Wrong turns: comparing on different cases; changing the prompt and the model in the same experiment; reading a small difference from single runs as an improvement; the whole budget on repeating a handful of cases.
Root-cause isolation from logs and traces
- Five causes to tell apart. Prompt failure: the prompt left out, contradicted or mis-stated what the task needs, whether an instruction or a fact such as today's date. Retrieval failure: the needed passage exists and never reached the context. Hallucination: the answer states what nothing in the context supports, including an answer given when no source exists. Tool or subagent error: a call failed, returned something wrong or ambiguous, or was given a parameter or a brief that left out what it needed, and the result was used. Model mismatch: the inputs are sound and the task is beyond the tier, or a version changed.
- Read the trace in order. Was the right content retrieved? Was it in the context? Did a tool return an error or bad data? Only then judge the prompt and the model.
- Tests that separate them. The same prompt and inputs pass on a more capable tier: the model is the difference. The same failure on every tier: it isn't. Rewrites that leave the error rate where it was: wording isn't the limit. An accurate answer from the wrong passage is retrieval; a figure that appears nowhere in the context is hallucination.
- The corrective action follows the cause and goes where the fault is: the index or the retriever for a retrieval failure; the instruction or the missing fact for a prompt failure; a requirement to quote a source or to say that it isn't covered for hallucination; for a tool or subagent, the failure returned as an error, the parameter defined in the schema, or the brief completed; the tier for the failing step, or the pinned version, for a mismatch.
- Wrong turns: rewriting the prompt for a retrieval miss; a larger model for a tool that returned stale data; treating a symptom at the last step when the fault was at the first.
Cost and latency optimization
- Start from the telemetry: where is the spend or the time concentrated? One route, one step, input or output tokens, a low cache hit rate. Optimize that, and nothing that the figures show to be small.
- Price each part before you choose. Cached input is read at a fraction of the input price and an output token costs several times an input token, so a short output can outweigh a long cached prefix. Count what isn't tokens too: repeat calls after a response that failed, time spent waiting before a request is sent, and the cost of a failed answer that a person then has to handle.
- A low cache hit rate means the prefix changes or expires between calls. A hit needs the prefix to be identical, in the order tools, system prompt, messages: keep tool definitions and instructions the same and in the same order on every call, put changing content after the stable part, and choose the cache lifetime (5 minutes or 1 hour) that covers the gap between calls.
- Other levers: a smaller tier on the routes where it still meets the floor; shorter outputs, or only the changed part of a long one; independent calls in parallel, within any concurrency limit; batches for work nobody waits for; structured outputs where malformed responses cause repeat calls; stored answers for questions repeated word for word. Streaming shortens the wait for the first text, not the total time.
- The quality floor is a hard limit. Check each optimization against the stated minimum on the evaluation set before choosing it.
- Wrong turns: optimizing the cheapest part of the bill; a saving that drops quality under the floor; cutting input when output dominates the cost.
Model version migration
- Inputs: a deprecation timeline and regression results for the candidate version. Four responses. Pin the current version, by its own identifier and not an alias that someone else can move, to keep behavior stable while it is supported. Re-tune prompts where reviewers confirm that the candidate's failures are real. Re-baseline evaluations where the evaluation is at fault: it compares with the old version's wording, and reviewers rate the new outputs as good. Defer when the timeline has slack and re-tuning hasn't worked or a better candidate is due, with a fixed date to decide by.
- A retirement date is a hard stop: after it, requests to that version fail. Count back from it in rounds: how long one round of re-tuning and a full regression run takes, how many prompts a round covers, and any change freeze before the date. That gives the latest start, and shows whether a candidate can be ready at all. An alias that is about to move is a second, earlier date.
- Read the regression results by case type. An overall score that holds can hide a drop in one category; a drop in a category with a stated floor blocks the move until it is fixed.
- Wrong turns: pinning past the retirement date; switching on the overall score; lowering a threshold to make the candidate pass; deferring until there is no time to re-tune.
See also: Exam guide vs today · Professional, exam guide version 1.1 (from 7 December 2026).
Docs: Success criteria and evaluationsReduce hallucinationsPrompt cachingReducing latencyChoosing a modelModel deprecations
Terms explained: Professional (CCAR-P) glossary: the terms the exam guide uses. How to read the questions: Claude Certified Architect exam technique.
Practice Domain 4