7 routes42 sections324 units

Unit 3.8 · about 5 h

192 / 324

Diagnosing failed runs: divergence, stale state, slices and seeds

Loss curves alone never name the broken mechanism. Diagnosis is a designed experiment per failure, and this unit turns the section checkpoint into a repeatable drill.

  • measure

You can now

  • Localize flat, diverging, NaN and eval-gap failures to objective, optimization, state or data causes using competing controls.
  • Instrument the first invalid value and per-slice errors, and report seed variation instead of single-run conclusions.
  • Repair a failing compact run, add a regression test, and defend the configuration with measured evidence.

Covers

  • Nonlearning, divergence, NaN and Inf diagnosis
  • Train-evaluation mismatch and stale state
  • Learning curves, per-slice errors and seed variation

Study, in this order

4 steps

  1. Error sources and learning curves
    Understanding Deep Learning - fitting, gradients and regularization

    Chapter 8, Sections 8.1 through 8.3 (pp. 118 to 126): training a simple model, sources of error, and reducing error

    Depth · Read Sections 8.1 through 8.3. Skip double descent in 8.4 here.

  2. Overfitting, interpolation and early stopping
    D2L - optimization and regularization slice

    Revisiting Overfitting and Regularization, Early Stopping, and Classical Regularization Methods for Deep Networks

  3. Debugging optimization failures
    Deep Learning Tuning Playbook FAQ: debugging optimization failures

    FAQ How can optimization failures be debugged and mitigated: Identifying unstable workloads, Potential fixes, Learning rate warmup, Gradient clipping

  4. Train and eval state revisited
    D2L - optimization and regularization slice

    Batch Normalization During Prediction and Dropout in Practice, revisited with a stale-state lens: frozen statistics, eval mode, and what a mode gap proves

Focus on

  • Flat from the start means no learning signal: check objective wiring and LR scale before touching the architecture. Diverging or NaN means too much update: halve the LR, enable clipping, then bisect to the first invalid op.
  • An eval gap that vanishes in eval mode was stale state, not overfitting. Compare modes before comparing curves.
  • Aggregate metrics hide slice failures. Cut errors by source, length or class, and rerun the fix on a second seed; one seed proves nothing about stability.
  • Patience-based early stopping needs a no-improvement threshold and a fixed budget. Without both, stopping decisions are hindsight.

Reproduce closed-book

Closed-book, write the five-branch drill: flat, diverging, NaN or Inf, eval gap, noisy plateau. For each, name the first measurement, the control that splits two causes, and the fix you try first.

Traps

  • Reading any falling training loss as progress. Memorization falls too; only held-out slices and controls tell fitting from learning.
  • Fixing NaN by switching to float64 or adding an \(\epsilon\) somewhere. Either can hide the first invalid op; find it first, then decide between learning rate, clipping, initialization and objective order.
  • Reporting the best of many seeds as the result. Report the spread across at least two seeds, with the same seeds for the baseline and the fix, before claiming a fix.

Practice

The section mini-project covers this: fault-injection diagnosis of a failing compact run with regression tests across two seeds.

Self-test

  1. Loss is exactly flat from step 0 with a nonzero learning rate. Name three causes and the two measurements that split them.

  2. Loss explodes to NaN at step 200 after falling. What is the ordered response?

  3. Eval error exceeds train error only when dropout and batch norm are in training mode. Diagnosis?

  4. A fix works on seed 0 but fails on seed 1. What do you conclude and what next?

Completion criterion

Stop when

Given a fresh failing run, you name the branch, run its control, repair it and show the fix holding on a second seed.

Mark passed, then open 4.1 Only mark this when you can do it without notes.

Leads to

Comes after

Resources for this unit

  • Understanding Deep Learning - fitting, gradients and regularization
    Simon J. D. Princeprimarytheory
    Use Chapters 6-9 and targeted parts of Chapter 20 for optimization, initialization, measurement, regularization and why training works. Re-derive the update rules you keep in the trainer.
  • D2L - optimization and regularization slice
    D2L authorsrequiredimplementation
    Use MLP implementation, dropout, deep generalization, numerical stability, optimization introduction, SGD, minibatch SGD, momentum, AdaGrad, RMSProp, Adam and learning-rate scheduler. Implement momentum, AdamW, initialization, dropout, one normalization, clipping and one schedule.
  • Deep Learning Tuning Playbook FAQ: debugging optimization failures
    Google Researchreferencereference
    Read How can optimization failures be debugged and mitigated (identifying unstable workloads, warmup, clipping) and Batch normalization implementation details.

Also in this section

Quick find

Search Michi

Type to search every route, section, unit, topic and resource.

Enter opens the first result Esc closes

Reference

Keyboard shortcuts

n
Continue to the first unit not passed
j / k
Next / previous unit
1 2 3
Toggle learned, practised, passed
/
Open search
?
Show this help
Esc
Close open panels