The training recipe: loss masking, packing, learning rate, epochs and overfitting
The settings that decide whether a fine-tune works, each shown with numbers from code you can run: why only the answer tokens should carry loss (80% of tokens were prompt in the lab data), how batching and packing waste compute, how learning rate and epochs interact, and how to spot overfitting from validation loss.
Most fine-tuning failures are not about LoRA or the model. They come from the recipe: which tokens count in the loss, how examples are batched, how fast to learn and how long to train. This lesson goes through each setting and shows what it does with numbers. The first half uses the real support-ticket data from the LoRA lab; the second half uses a small model you can train in plain Python.
Pro content
Keep reading with Inference Academy Pro
Unlock the rest of this lesson, including 2 animated diagrams, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.