Highlights

Contents

Part IV
04

Choosing what training should change

Some failures need better context; others need learned behavior. Training the wrong target can reinforce a broken protocol. Establish a baseline and choose an observable specialization goal before collecting demonstrations.

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

#Section 24Prompting vs fine-tuning

Finch-24 emits the wrong tool-call format. You can show it a correct example in the prompt or train it on many correct examples. Both can fix the next call, but they change different things.

What prompting changes and in-context examples

Prompting changes the token input and leaves parameters fixed. In-context examples are demonstrations placed in that input for the current generation to imitate. They cost context, must be resent every time, and can explain a new tool without a new checkpoint.

What fine-tuning changes and behavior encoded in weights

Fine-tuning updates learned parameters with a training objective and dataset. Behavior in the weights appears without repeating demonstrations, but new tools still need a current interface definition, and training cannot update a stale description of a changed API.

CHANGE THE INPUT OR CHANGE THE LEARNED PARAMETERSPromptingtask rules + examplesweights fixednew input each runFine-tuningchecked demonstrationsweights updatednew checkpoint
Figure 5.22Prompting changes the supplied context. Fine-tuning produces a changed checkpoint or adapter, whose behavior must be evaluated under the same runtime.

An adapter may replace repeated demonstrations, but it adds training, validation, and maintenance. That trade only helps if the behavior succeeds without those examples.

Fix the runtime and prompt first when they are wrong. Fine-tune when a stable target behavior still fails across a representative set and correct demonstrations exist. Training never replaces tool execution or error handling.

#Section 25Fine-tuning goals

The failure report says “tool use is poor,” but the transcripts show different problems: some calls lack a closing boundary, others have right syntax and wrong quantity. One vague goal cannot tell you what data to collect.

Tool syntax, tool selection, and arguments

A fine-tuning goal is a behavior change an evaluation can detect. Syntax needs correctly serialized demonstrations. Selection needs situations where competing tools, or no tool, are distinguishable. Arguments need values tied to the request and observations, not copied constants.

EACH OBSERVED FAILURE NAMES THE DATA THAT COULD FIX ITfailure seen in transcriptsdemonstrations to collectcall lacks closing boundarycorrectly serialized callsright tool, quantity 4values tied to the request (3)reserves when asked to explaincontrast cases, including no toolreserves 13 of 12 availableread, then refuse or report failurefinal answer omits remaining 9final reports grounded in the receiptillustrative stockroom failures; one vague goal "better tool use" names none of these
Figure 5.23Illustrative stockroom failures paired with the demonstrations that target them. Each pairing is a hypothesis to test on held-out tasks, not a guaranteed fix.

Multi-step behavior and response format

Multi-step behavior uses a result to choose the next action. Response format governs how the final answer presents the outcome. Our successful trace teaches a read, a conditional action, and a report; training only the reservation JSON never shows how to react to insufficient stock.

In the fixture, the read shows 12, the request is 3, and 9 remain. A request for 13 should teach a refusal or a server-reported failure, since 13 > 12, and a request for an explanation should teach an answer with no stock query.

Validate each target separately. If format validity rises while argument accuracy falls, a format-heavy set may have taught the template at the cost of value generalization. Fine-tuning reinforces biases in demonstrations as efficiently as the behavior you wanted.

#Section 26Base vs instruction-tuned models

A raw completion model treats a user question as part of a document and continues it. An instruction-tuned checkpoint is more likely to answer as an assistant, which matters when the training set is small.

Pretraining and instruction tuning

Pretraining learns broad statistical structure from large collections of text. Instruction tuning then teaches the model to answer requests in a conversational format. A base model in the architecture sense is the raw pretrained checkpoint; in LoRA deployment, base can mean any frozen checkpoint under the adapter.

Chat behavior and further specialization

Chat behavior comes from learned demonstrations and the checkpoint’s chat template. Further specialization can teach a tool protocol or response style while keeping language ability. Record the exact checkpoint, tokenizer, template, and weights, because matching shapes do not mean matching behavior.

The stockroom traces are target demonstrations, not measured Finch outputs. Start from a suitable checkpoint and establish its baseline.

The original Llama 3 8B base and instruction-tuned checkpoints share the dimensions used in our counts but differ in weights and behavior. An adapter trained on one is not equivalent on the other just because the tensors fit.

THE SAME SHAPES CAN HOLD DIFFERENT LEARNED BEHAVIORpretrainedcontinue a sequencetraininstruction-tunedanswer a requesttraintool-specializeduse this protocolthe architecture can stay fixed while weights changeshape compatibility is not checkpoint identity
Figure 5.24Illustrative weight grids keep a fixed architecture across training stages while contents change. Shades are schematic, not real checkpoint values or scores.