Level 13 · Frontier & proof
Fine-Tuning
Fine-tuning means teaching a model your specific pattern with examples, and only after a careful prompt still fails a test you wrote down first. This level shows how to build that dataset, run a small supervised update, fit the run on one GPU with thin adapters, compare preferred answers, and serve the result without dropping the chat format. You also learn when a smaller model can copy a stronger one, and when you should refuse to train. You need this so a training run is a measured decision, not a reflex.
Assumes You should already be able to prompt a chat model, score its answers on a fixed set of examples, and call a hosted model from a small program. · 16 study sessions · 9 modules
Ship it
Capstone: a LoRA that beats a prompted baseline
Train a small LoRA or QLoRA adapter, a thin update on a frozen model, on one narrow task where the best prompt you will maintain still misses a metric you wrote down first. Compare the two on a held-out set that never chose the checkpoint, and serve the adapter only if those numbers still hold. Leave a one-page decision so someone else can retrain the adapter or throw it away.
You can do the spec, the metric, the baseline, and the decision on a laptop with notes and any free chat window. A real training run is optional and must not need a paid key. If you cannot train, write the command and mark every score unmeasured. Done means the decision says serve or do not serve, and a stranger can see why.
1. A narrow task with a measured failure
1. Open spec.txt and pick one narrow task, such as JSON classification or a fixed house style, where a careful prompt can already be seen to fail.
2. Write the user, the input, and the output contract in a few sentences.
3. Drop the task if you cannot score it on a laptop this week. Say so and pick another.
4. Done when the spec is short enough to grade a row pass or fail, and the task is not "know all the facts."2. Metric & threshold up front
1. Before a large labeling pass, write the failure in one sentence in metric.txt.
2. Name the metric and the number the tune must beat.
3. Add which regressions would block a ship even if the main metric rises.
4. Do not start training, or even a large labeling pass, until those lines are in the folder.
5. Done when the bar is a number and at least one veto is named.3. A strong prompted baseline
1. In prompt.txt, write the strongest prompt you are willing to keep, with a schema and a few worked examples.
2. Add retrieval only if the task depends on fresh facts. If it does, the tune is probably the wrong tool. Say so.
3. Score the prompt on the held-out ids using any free chat window, or write unmeasured if you cannot run them yet. Save the raw outputs.
4. Done when the bar is this prompt's score, not an empty prompt with no examples.4. Clean, leak-free dataset
1. Write train, validation, and held-out files, even if each has only a handful of rows.
2. Format them with the base model's chat template, or a clearly labeled stand-in, and mark loss on the assistant tokens only.
3. Remove duplicates and keep near-copies on one side of the split.
4. Add a hash and a short card that says where each row came from. A fake hash is fine if you label it fake.
5. Done when the test file shares no near-copy with train and the card exists.5. Reproducible LoRA/QLoRA run
1. Write a config file with rank, learning rate, and the base revision. LoRA or QLoRA is the method. Full-weight training is out of scope.
2. Add a preference stage only if the supervised checkpoint already follows the format and still loses a comparison you wrote down. Otherwise write "no preference stage."
3. If you can train without a paid key, save the command and the validation curve. If you cannot, save the command and write unmeasured.
4. Done when someone else could relaunch from the config without opening a chat.6. Same-set comparison & cost
1. Score the tuned model and the prompted baseline on the same held-out ids with the same judge. If you did not train, write unmeasured in both columns and skip the victory sentence.
2. Put the task score, the response delay, tokens per call, and the price of a thousand calls in one table.
3. If latency is unmeasured, say so in the cell. Do not invent a figure in the conclusion.
4. Done when the table has two columns and no blank cell pretending to be a measurement.7. Regressions & one failure
1. Run at least ten prompts outside the target task, using any free chat window for the baseline. Include one refusal and one other format.
2. If you have a tune, run the same prompts on it. If you do not, write the failures you will check when you do.
3. In the README, show one failure the tune added or did not fix, with the input and both outputs. A planned failure is fine if it is labeled planned.
4. Done when an average gain, real or future, is not the only evidence.8. Serve it, reproduce the numbers
1. Write how you would serve the adapter with the training chat template and tokenizer, on a local server or a real endpoint.
2. If you can serve it without a paid key, send the held-out set through that server, not only through a training script.
3. Show the scores still agree within a tolerance you set, or write unmeasured and the tolerance anyway.
4. Repair template drift on paper: list any special token that differs between train and serve.
5. Done when template match is checked before you call it deployed.9. A fine-tuning decision record
1. Write one page: the failure, the data hash, the config, the metric before and after, what serving costs, and the event that should trigger another train.
2. Say plainly whether you would ship the adapter. "Not yet" is a complete answer when scores are unmeasured.
3. A later reader should be able to discard the adapter without redoing your week.
4. Done when the page contains serve or do not serve, and every number you did not measure is labeled.