Cross-Entropy and LLM Training Explained

3Blue1Brown · youtube · 2026-07-16

This video explains why cross-entropy serves as the loss function for training language models through the lens of information theory and compression. It reviews the intuition behind optimal coding and language trees, defines cross-entropy, and illustrates how it measures the cost of using one distribution to describe another.

The latter half connects these concepts to LLM pre-training, explaining why minimizing cross-entropy is equivalent to improving next-token prediction, and discusses why it is the optimal loss choice. The video also touches upon distillation and KL divergence, weaving these concepts into a cohesive narrative.

Original post →

More from Research

Research channel →