Pick the three first things to check when LoRA training loss sits flat from step 0
Flat loss from step 0 is a structural break, not a tuning problem. Check the LR schedule, the target_modules wiring, and whether assistant tokens survive label masking.
Imagine trying to drive a car that will not move. Three things to check first: is there fuel reaching the engine (the labels you are training on), is the engine connected to the wheels (the adapter actually wrapping a layer), and is the gas pedal pressed (the step-size knob the trainer uses not stuck at zero)? Only after confirming all three are working do you start asking whether the engine is too small or the wheels are the wrong size. People who jump straight to swapping engines waste hours when the real fix is plugging in a cable or pressing the pedal. Flat loss is the same: check the structural breaks before changing capacity or precision.
Detailed answer & concept explanation~7 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: why flat loss from step 0 is structural, the three independent failure modes (LR, wrapping, labels), the diagnostic one-liners for each, why capacity and precision fixes do not apply, and the general diagnostic path order.
| Symptom | Likely cause | First check |
|---|---|---|
| Flat loss from step 0 (this case) | Structural break in optimization path | LR, wrapping, label masking |
| Loss drops then spikes to NaN | Numerical overflow or schedule discontinuity | Mixed precision, gradient clipping, beta |
| Loss drops then plateaus | Model is converged or undercapacity | Eval loss trend; capacity if eval flat |
| Loss drops then eval rises | Overfitting | Early stopping; reduce capacity next run |
| Loss oscillates wildly | LR too high or batch size too small | Lower LR, larger batch, more warmup |
Real products, models, and research that use this idea.
- Hugging Face PEFT issues GitHub history is full of target_modules name mismatches between Llama-3 and Mistral, and the standard fix is print_trainable_parameters before training starts.
- TRL SFTTrainer in 2026 logs a warning when more than a configurable fraction of labels are -100, exactly because the all-masked failure mode is common.
- Axolotl YAML configs default to verifying the actual post-warmup LR in the first logging output to catch schedule misconfig immediately.
- Unsloth single-GPU Llama 4 fine-tunes ship example configs that print a tokenized batch sample on startup so users can spot label masking bugs before wasting compute.
- Production Qwen 3.5 fine-tunes at large open-source orgs include a 'sanity training' step of 10 iterations to verify loss drops before launching the full run.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow do you verify the actual post-warmup learning rate is nonzero in Hugging Face Trainer?
QWhy does target_modules silently fail instead of raising an error on a name mismatch?
QWhat is the right way to check label masking in an SFT batch?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Bumping rank or switching models when loss is flat from step 0. Capacity changes do not help when no gradient is flowing; the fix is upstream in the data, the wiring, or the optimizer.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.