Highlights

Contents

Part XI
11

Measuring the change and its regressions

Specialization can improve one behavior and damage another. Aggregate gains hide those trade-offs. Compare paired trajectories, regressions, and complete task outcomes under a fixed runtime.

THE AGENT AND ITS TRAINING PATHDefine tools01Run the loop02Measure tasks03Choose training04Build LoRA05Count adapters06Serialize traces07Train and validate08Generate tasks09Check traces10Compare models11Prepare inference12

#Section 61Before-vs-after evaluation

The adapted model succeeds on 16 tasks where the starting model succeeded on 12. That is a useful first number, but we still need to know whether the tasks and rules matched and which outcomes changed.

Base model, fine-tuned model, and same benchmark

A before-versus-after evaluation compares the exact starting checkpoint with its adapted version on one benchmark. Base model here means the model under the adapter, as in Section 26. Freeze tasks, environments, runtime, schemas, template, sampling settings, and grading.

Controlled comparison

A controlled comparison changes the intended variable and documents anything else that differs. Pair runs by task and, where relevant, sampling seed. Training seeds and sampling seeds are different sources of variation; record both rather than treating one reproducible generation as a stable result.

PAIR THE SAME TASKS BEFORE AND AFTER TRAININGbefore: 12 / 20after: 16 / 206 gained2 losta net gain can hide new failures
Figure 5.52Illustrative paired results: ten successes in both systems, six gains, two losses, and two failures in both. The aggregate rises from 12 to 16 while two new failures appear.

Paired outcomes expose new failures that a net gain hides.

This small fixture supports no claim of statistical certainty. Repeated sampling, several training seeds, and a representative evaluation set are separate evidence, and a score on synthetic stockroom tasks covers that distribution only.

#Section 62Tool-call improvement

After training, JSON errors nearly vanish, but the assistant still sends quantity 4 for requests of 3. One boundary improved; the user’s outcome is still broken.

Validity, selection, argument accuracy, and task success

Tool-call improvement should be reported separately for validity, selection, argument accuracy, and task success. Format-focused data can lift validity directly; tool choice and value grounding need diverse request-state data. Lower SFT loss implies none of these.

Compare per-task changes and error buckets, not just rates. An extra read raises valid-call counts without improving completion; mean calls and latency reveal it.

Adding a decoding constraint alongside SFT changes both enforcement and weights. For a fine-tuning claim, measure each separately; otherwise call it a system change and name both parts.

#Section 63Regression testing

The trained assistant starts calling get_stock when asked to write a birthday message. The specialization improved its benchmark and changed how it reads unrelated requests.

Normal chat, non-tool tasks, and reasoning

Regression testing checks behaviors a change should preserve: normal chat, non-tool tasks, and reasoning relevant to the starting model’s use. A specialization is not a success because every test resembles its training data.

Formatting and unexpected tool calls

Formatting tests check response structure and boundary tokens. Unexpected tool calls checks whether the model acts when nothing is needed. A no-tool task has a real expected outcome, so an unnecessary call fails it even when the prose is fine.

Keep a separate general-behavior regression set. Stockroom explanations alone do not establish that ordinary chat is preserved.

Isolate the environment during regression runs. An unexpected write should show up as an attempted action, blocked or sandboxed by normal authorization, rather than relying on the model to behave.

#Section 64Generalization

“Set aside 5 nuts” differs from “Reserve 3 bolts” in words and values. If the assistant succeeds, which skill transferred? The test must separate phrasing, arguments, and decision structure.

New phrasings, new argument values, and new combinations

New phrasings keep the request and change the language. New argument values keep the structure and change items or quantities. New combinations compose tools or conditions in ways absent from training. These are separate axes.

CHANGE ONE GENERALIZATION AXIS AT A TIMEwordingreserve -> set asidevalues3 bolts -> 5 nutscombinationone item -> dependent itemsenvironmentenough -> insufficientnew words and new decisions test different things
Figure 5.53Illustrative changes isolate wording, values, combinations, and environment conditions. Each axis defines a different held-out distribution.

At availability 12, an unseen quantity of 5 should reserve and leave 12 - 5 = 7. That shows transfer to a new value under the familiar policy, not competence at an atomic multi-item reservation, which is a different contract.

Hold out by the claim: random splits estimate same-distribution performance, family splits test harder boundaries. Report by axis so success on new wording does not hide failure on new dependencies.

#Section 65Error buckets

Several failed transcripts end with “I could not complete that.” One ran out of steps, one chose the wrong tool, one hit a broken service. The final wording classifies nothing.

Wrong tool, wrong arguments, and invalid syntax

An error bucket groups failures by a common observable cause. Wrong tool is selection, wrong arguments are semantic inputs, invalid syntax is representation. Keep raw output so parser and model responsibility can be separated.

Premature final answer and unnecessary calls

A premature final answer concludes before the required evidence or action. Unnecessary calls spend resources without advancing the task. Answering after the read but before the write is premature; rereading unchanged state is unnecessary.

AN ERROR LEDGER KEEPS ONE PRIMARY CAUSE PER FAILED TASKwrong toolselectionwrong argumentsmeaninginvalid syntaxrepresentationpremature answercompletionunnecessary callsrestraintsecondary tags describe other effects without double-counting tasks
Figure 5.54The ledger defines behavioral buckets before results are counted. The categories are schematic; no measured frequencies are implied.

Give each failed task one primary bucket, then tag secondary consequences. Otherwise one failure can inflate several totals.

Bucket shifts point to the next experiment: schema errors suggest format work, valid but wrong values suggest grounding and diversity, and tool-server failures need execution fixes, not training.

#Section 66Multi-step evaluation

Our teaching benchmark requires a stock read before reserving, to test decisions conditioned on observations, so writing first violates that declared path. The business goal alone does not need the read, since an authorized direct reservation succeeds through the atomic stock check; accept that shorter path unless the read is an explicit requirement.

Correct ordering and intermediate decisions

Multi-step evaluation checks decisions conditioned on earlier results. Correct ordering means dependencies are satisfied, not that independent calls follow one arbitrary order. Intermediate decisions must use available evidence and keep operation identities.

Recovery and final completion

Test recovery with injected errors whose semantics are documented. A schema rejection allows correction with no external effect; a timed-out write needs same-key reconciliation. Final completion checks the environment and the report afterwards, including that only one reservation committed.

A valid recovery may take longer than the reference path. Grade its final state and compliance with the budget, not shortest-path imitation.

FOUR SCENARIOS, ONE CHECK: DID EXACTLY THE RIGHT RESERVATION COMMIT?scenariopathavailable afternormal, quantity 3read → reserve → report9insufficient, quantity 13read → refuse12error before commitreserve ✗ → corrected reserve9lost response after commitreserve ? → same key r1 → receipt9illustrative fixtures starting from 12 available; a second commit would leave 6
Figure 5.55Four illustrative scenarios and their required end states from availability 12. The orange path reconciles a lost response with the same key, so the stock ends at 9 rather than 6.

These four are illustrative, not a complete fault model. Combined faults and concurrent changes need their own cases if the deployment depends on them.