Why is KL divergence not symmetric?

Quick Overview

Explain why KL divergence gives different values when its two arguments are swapped. Tests the definition as an expectation, how zeros are handled, a numeric example, and the practical difference between forward and reverse KL when fitting a model.

Why is KL divergence not symmetric?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Why is KL divergence not symmetric? Explain where the asymmetry comes from and what it changes in practice. ```hint Look at the expectation Write the definition out and ask which distribution supplies the weights in the sum. ``` ### What a Strong Answer Covers - The definition as an expectation under the first argument, and why swapping the arguments changes the weighting. - How zeros in either distribution are treated, and when the divergence becomes infinite. - A small numeric example showing the two directions give different values. - The practical consequence when fitting an approximation: forward KL versus reverse KL, and which objectives use each. - Why KL is not a metric, and a symmetric alternative. ### Follow-up Questions - How does minimizing cross-entropy relate to minimizing KL divergence in classification? - Is there any family of distributions for which KL happens to be symmetric? - Why does variational inference use reverse KL, and what does that cost when the true posterior is multimodal? - How would you estimate KL divergence between two models from samples when you cannot compute it in closed form?

Overview: Explain why KL divergence gives different values when its two arguments are swapped. Tests the definition as an expectation, how zeros are handled, a numeric example, and the practical difference between forward and reverse KL when fitting a model.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Why is KL divergence not symmetric? Explain where the asymmetry comes from and what it changes in practice.

What a Strong Answer Covers Guidance

  • The definition as an expectation under the first argument, and why swapping the arguments changes the weighting.
  • How zeros in either distribution are treated, and when the divergence becomes infinite.
  • A small numeric example showing the two directions give different values.
  • The practical consequence when fitting an approximation: forward KL versus reverse KL, and which objectives use each.
  • Why KL is not a metric, and a symmetric alternative.

Follow-up Questions Guidance

  • How does minimizing cross-entropy relate to minimizing KL divergence in classification?
  • Is there any family of distributions for which KL happens to be symmetric?
  • Why does variational inference use reverse KL, and what does that cost when the true posterior is multimodal?
  • How would you estimate KL divergence between two models from samples when you cannot compute it in closed form?