Back to Discover
Lesson

When a Learning Rate Diverges

A learning rate that worked can diverge when the loss landscape shifts under it — when gradients spike, curvature grows, or accumulated updates push the model into a steeper region — and you can read early warning signs before the explosion.

Before you enter

A complete interactive classroom, not just a preview.

Start when you are ready to enter this Stage's 12 scenes and explore, respond, and learn as you go.

12
Scenes
24 min
Estimated
Content language: en-US
Start this Stage
Sign-in may be required to play
What happens inside
  1. 01The Mystery of the Working Rateslide
    OrientationObserve

    Frame the question: a learning rate that trained stably can suddenly explode. Preview the cases we will investigate.

    • Set up the opening question
    • Show a loss curve that was smooth then diverged
    • Preview: gradients, curvature, schedules, batches
  2. 02Step Size on a Moving Terraininteractive
    Model buildingPredict

    Let the learner drive a ball across a 1D loss landscape with a fixed step size and see when it overshoots the valley.

    • Drag the starting position
    • Observe fixed step size across flat and steep regions
    • Watch overshoot when the valley narrows
  3. 03Effective Step Size: LR × Gradientslide
    Model buildingExplain

    Formalize that the true parameter move per step is LR times gradient, so changes in gradient magnitude change the effective step even when LR is fixed.

    • Effective step = learning rate × gradient
    • Gradient can spike without LR changing
    • Why a fixed LR is not a fixed step size
  4. 04Case 1: The Gradient Spikeslide
    Model buildingExplain

    Walk through how a rare batch, bad sample, or earlier-layer instability produces a sudden large gradient that multiplies a fixed LR into a destructive step.

    • Bad batches and rare tokens can spike gradients
    • Earlier-layer instability amplifies later gradients
    • Result: one oversized parameter jump
  5. 05Case 2: The Sharper Valleyslide
    Model buildingExplain

    Show that as the optimizer moves, the local curvature can grow; a step size safe in a flat basin becomes too large on a sharp ridge.

    • Loss surface is non-stationary
    • Local sharpness can rise late in training
    • Safe step size shrinks as sharpness grows
  6. 06Which Case Broke It?quiz
    AssessmentChoose

    Force the learner to commit to a diagnosis for three short loss-curve snippets before the explanation.

    • Classify each snippet as gradient spike, curvature shift, or other
    • Justify in one line
  7. 07Case 3: Batch Size and the Linear Scaling Ruleslide
    Model buildingExplain

    Show why changing batch size effectively changes the step even when LR is held or rescaled, and why large-batch training often needs warmup.

    • Large batches reduce gradient variance
    • Linear scaling rule: LR scales with batch size
    • Edge of stability differs at large batch
  8. 08Early Warning Signsslide
    Model buildingObserve

    List the diagnostic signals that appear before a full divergence: loss spikes, rising gradient norm, weight-norm jumps, NaN propagation.

    • Loss spike followed by recovery is a warning
    • Gradient norm trending up precedes explosion
    • NaN in one layer corrupts downstream layers
  9. 09Read the Training Loginteractive
    PracticeApply

    Give the learner a short log with loss and gradient norm and let them flag the step where intervention is needed.

    • Scan loss and gradient-norm traces
    • Click the step to intervene
    • See the consequence of intervening early vs late
  10. 10Interventions That Match the Causeslide
    ApplicationApply

    Map each failure mode to its targeted fix: warmup for early curvature, schedules for growing sharpness, gradient clipping for spikes, LR drop as the blunt fallback.

    • Warmup handles early unfamiliar region
    • Schedules pre-shrink LR as sharpness grows
    • Gradient clipping bounds spike damage
  11. 11Pick the Right Fixquiz
    AssessmentChoose

    Present three divergence scenarios and ask the learner to choose the most targeted intervention for each.

    • Choose warmup, schedule, gradient clip, or LR drop
    • Explain why the chosen fix targets the cause
  12. 12Synthesis: Why a Working Rate Breaksslide
    SynthesisExplain

    Unify the three cases under one mental model: divergence happens when the effective step exceeds the local safe step, and the safe step can shrink while the effective step grows.

    • Divergence = effective step exceeds local safe step
    • Gradient spikes and curvature shifts both raise effective step or lower safe step
    • Diagnose by reading loss and gradient-norm traces
Discussion

Discussion threads for a Stage aren't available yet.

Where this leads
Explore more

More in Technology & Computing

See all