Your Eval Failed. Now What? Turning Failures Into Your Next Dataset
In Episode 7 you built the harness, froze the held-out set, and scored your fine-tune like a skeptic. The score came back ugly. Good: that failing report is the most valuable artifact in the series, because every failed example is a labeled, real-world case your model gets wrong, which is exactly the training data you could never buy or brainstorm. This is the companion tutorial to Train Your Own AI, Episode 8: the failure-fix loop on a single 24 GB, 4090-class GPU. No headline hourly GPU price is quoted here because rental prices move daily; check the directory for today's.
Triage: every failure gets a bucket
Start where Episode 7 ended: the eval run saved every raw output next to its expected answer. If you only saved the headline score, rerun the held-out set with sample logging on, because you cannot fix an average. Read the failures (all of them if the set is small, a sample of fifty if it is not) and give every one a bucket:
- Wrong facts: a knowledge or reasoning gap.
- Wrong format: structure, keys, or style off.
- Refusals: the model is over-cautious and dodges the task.
- Rambling: no stop discipline.
- Wrong prompt: the example itself is ambiguous or the expected answer is debatable. That is a test bug, not a model bug.
- Inconsistent labels: two near-identical inputs carry different expected answers, so the model was trained to be confused. That is a data bug.
Write the bucket next to each failure in a working file, failures.jsonl (prompt, expected, model output, bucket), and count the buckets before you touch anything. The counts are the diagnosis, and they decide where the next GPU hour goes.
Data problem or model problem?
The two kinds of failure have opposite cures:
- Data problem: the model never had a fair chance to learn the behavior. The cluster is missing from training, underrepresented, contradicted by inconsistent labels, or taught in the wrong format. Data problems are the majority in most first fine-tunes, and they are cheap: write better examples.
- Model problem: the data was there and the model still cannot do it. The task needs reasoning the base model does not have, the context is longer than training ever showed, or one adapter is being asked to hold two behaviors that fight each other. More of the same data will not fix it; the cures are a bigger base model, a longer training context, splitting the task, or honestly rescoping the ask.
One question separates them per cluster: if I showed a competent human these training examples, would they learn to pass these failures? If yes and the model did not, suspect capacity. If the examples never taught it, it is data, and data is the good news.
Build the failure set
For each data-problem cluster, write targeted examples that teach exactly the failed behavior, in the same format as your original dataset (the format from Episode 2). A cluster of twelve format failures does not need five hundred new examples; it needs 30-80 good ones that hammer the pattern from different angles: pull the prompts from the failures, then vary the names, numbers, order, and messiness so the model learns the behavior, not the twelve specific answers.
Two rules guard the whole operation:
- The frozen held-out set stays frozen. Never copy a held-out example into training, or Episode 7's proof becomes worthless. Write neighbors of the failures, never the failures.
- Clean the poison. Fix the inconsistent labels and ambiguous examples you found in the original training data. Retraining on the same contradictions just teaches the confusion again, with more confidence.
The output is one new file, fixes.jsonl, plus a changelog of what you repaired in the old data.
Assemble the retraining mix
Do not train on fixes.jsonl alone. An adapter trained only on the failure clusters learns the new behaviors and quietly unlearns the old ones, and Episode 7's regression slice will catch it doing exactly that. Assemble a mix instead:
- Fixes: the failure-cluster examples, upsampled (repeat each one 2-3 times) so a small file gets real weight in a short run.
- Replay: a random 10-20% of your original training data, so the behaviors that already worked stay exercised.
- General: a few general instruction examples of the kind the base model already handles well, if the regression slice was your weakest number.
The total can stay small, a few hundred to a couple of thousand examples, because you are doing surgery, not a rebuild. Write the recipe down: how many fixes, what upsampling, how much replay. When the re-eval moves, you need to know which ingredient moved it.
Retrain the adapter
The retrain is Episode 1 machinery with two deliberate changes. Train a fresh LoRA adapter on the mix, starting from the base model, not on top of your old adapter: stacking adapters compounds their quirks. Use the same Unsloth + TRL SFTTrainer setup, same chat template, same target modules, and keep the run short: 1-2 epochs over the small mix, learning rate at or slightly below your original run. Save the new adapter under a new version name and never overwrite v1; the old checkpoint is your rollback and your comparison point.
# Episode 1 machinery: Unsloth + TRL SFTTrainer
# Dataset = fixes.jsonl (upsampled 2-3x)
# + replay slice (10-20% of original data)
# Train a FRESH adapter from the BASE model.
# Do NOT stack on adapter v1.
trainer = SFTTrainer(
model = model, # base + new LoRA
train_dataset = mix, # fixes + replay
args = SFTConfig(
per_device_train_batch_size = 2,
gradient_accumulation_steps = 4,
num_train_epochs = 2, # small mix: 1-2 epochs
learning_rate = 1e-4, # at/below Ep 1's rate
output_dir = "adapter-v2", # never overwrite v1
),
)
The FlopSource math is friendly here: the original Episode 1 run trained on the full dataset, and this loop trains on a fraction of it, so one failure-fix cycle costs a fraction of that run on the same 4090-class GPU. Cheap iteration is the entire point of building the harness first.
Re-eval and decide
Close the loop with the only judge that counts: the same frozen held-out set, same prompts, same decoding, same metric and pass bar from Episode 7. Score adapter v2 next to v1 and the base model, per slice, not as one blended average. Three outcomes are possible, and all three are wins if you read them honestly:
- Target clusters jump, regression slice holds: the loop worked. Ship v2 and let the next failure list start accumulating.
- Target clusters jump, regression slice slips: the mix was too hot. More replay, fewer epochs, lower rate, and run the loop again.
- Target clusters barely move despite clean, targeted data: that cluster is a model problem after all. The answer is capacity, a bigger base, or a rescoped task, not a fourth round of examples.
What you never do is declare victory on a fresh, easier test set, or quietly edit the frozen one. The set that caught the failure is the set that certifies the fix.
Recap: the full loop
A failed eval is not the end of a fine-tune; it is the start of the dataset you actually needed. Triage every failure into a bucket and count the buckets. Sort each cluster into a data problem or a model problem with one test: would a human learn it from these examples? Fix data problems with 30-80 targeted examples per cluster, neighbors of the failures, never copies of the held-out set, and clean the inconsistent labels on the way through. Retrain a fresh adapter on a mix of upsampled fixes plus a replay slice, short run, versioned output, at a fraction of the original run's cost. Then let the same frozen held-out set judge v2 against v1 and the base, per slice, and read the outcome honestly, including the outcome that says the model, not the data, is the limit. That is the loop this series has been building toward: train, prove, fail, fix, prove again.
Find the cheapest GPU for your next run
Live pricing, hardware specs, and availability across 30 GPU clouds, neoclouds, and bare-metal providers.
Open the Directory