What is completion-only loss (loss masking)?
Computing the training loss only on the answer tokens, not on the prompt, so the model learns to produce the answer rather than imitate the prompt.
Learn it properly in the lesson →
Where it comes up
Lessons that use this term, most mentions first.
- Fine-tuning, LoRA and instruction tuning · 17 min · Pro
- The training recipe: loss masking, packing, learning rate, epochs and overfitting · 15 min · Pro
- Capstone: fine-tune a model for your own task, evaluate it and write the report · 20 min · Pro
- Data basics: formats, chat templates and checks before you train · 18 min · free
- Fine-tuning for structured output and tool calling: data, grammars and an evaluation harness · 17 min · Pro
- Fine-tuning tools in practice: Unsloth, Axolotl, torchtune and TRL · 15 min · Pro
- Forgetting and choosing a method: full fine-tuning, LoRA, replay and weight interpolation · 14 min · Pro
- How much GPU do you need to fine-tune? Memory for full fine-tuning, LoRA and QLoRA · 14 min · Pro