← all researchcase file 03 / 07
EEE 598 · Stochastic Optimization · Fall 2025

Forward vs. Reverse KL Under SGD

Applied AIIndividual project.

Mean-seeking or mode-seeking? Two ways to match a distribution, the same noisy optimizer, and very different behavior.

/01dig

100

classes in the teacher

/02dig

80

optimization runs

/03dig

20

seeds per configuration

/04dig

2

batch sizes (32, 128)

the questionwhy it matters

KL divergence is not symmetric. Forward KL punishes a model for missing anything the target covers, so it spreads out (mean-seeking). Reverse KL punishes it for putting mass where the target has none, so it locks onto a few modes (mode-seeking). Knowledge distillation usually uses the first and variational inference the second. This study isolates how that choice interacts with the noise of mini-batch SGD.

Method

How it works

  1. step 1Teacher

    Teacher

    A fixed multimodal categorical distribution over 100 classes with four modes, sampled 10,000 times.

  2. step 2Student

    Student

    A softmax-parameterized distribution trained with mini-batch SGD with momentum, so every gradient step sees only a noisy sample of the teacher.

  3. step 3Design

    Design

    Two objectives × two batch sizes (32 and 128) × 20 independent seeds: 80 runs, everything else held fixed.

  4. step 4Measures

    Measures

    Iterations to convergence, final loss, total-variation distance to the teacher and mode coverage, compared with two-sample t-tests.

Results

What it found

finding 1☥

01

The results lined up with the theory: forward KL spread its mass across the teacher's modes, while reverse KL concentrated on fewer of them.

finding 2☥

02

Reverse KL was the more sensitive of the two to mini-batch noise.

finding 3☥

03

Larger batches reduced run-to-run variance for both objectives.

the takeaway

“Choosing a divergence is choosing a failure mode. If missing a mode is costly, forward KL is the safer default under noisy gradients.”

/tools

  • Python
  • NumPy
  • Matplotlib
  • SGD with momentum
  • t-tests

next case file