But what is cross-entropy? | Compression is Intelligence Part 2
by 3Blue1Brown33:51 long835K views
Why watch3Blue1Brown explains where the loss function for training LLMs comes from, building cross-entropy up from optimal codes. Good for anyone who trains or studies language models.
What this video covers
This is Part 2 of the Compression is Intelligence series from 3Blue1Brown, and it runs just under 34 minutes. The description states its subject in one line: where the loss function for training LLMs comes from. Part 1 is linked in the description, and since the second chapter is a recap, you can start here, though Part 1 gives fuller context.
The video opens at 0:00 with language trees and zipping, an idea it comes back to later. At 3:02 it recaps optimal codes from the first part. Cross-entropy itself is defined at 5:20, and intuition and examples follow from 8:26.
At 12:59 the video applies cross-entropy to the language trees from the opening. The section on pre-training LLMs starts at 14:55 and runs close to six minutes. From 20:38 the question is what makes this loss function the best choice. For background on Lagrange multipliers, the description links lessons from the author's Khan Academy days, and the credits list Lagrange multiplier scenes among the animations.
Distillation is the topic at 26:13. A segment on 3b1b Talent, which the description links as job opportunities for this audience, runs from 30:12. The final chapter, from 31:35, covers KL divergence.
The animations are made mostly with manim, a custom Python library. The credits also name a NanoGPT animation and a 3D black-box model.
Written by HuiaHub from the creator's title, description and chapters. All credit for the video goes to 3Blue1Brown.
Key takeaways
- Cross-entropy is the loss function used to train LLMs.
- Cross-entropy builds on the idea of optimal codes.
- The same measure applies to building language trees through compression.
- The video argues why this loss function is the best choice.
- Later chapters extend the topic to distillation and KL divergence.
Chapters
- 0:00Language trees and zipping (opens YouTube at this moment)
- 3:02Recap optimal codes (opens YouTube at this moment)
- 5:20Defining cross-entropy (opens YouTube at this moment)
- 8:26Intuition and examples (opens YouTube at this moment)
- 12:59Application to language trees (opens YouTube at this moment)
- 14:55Pre-training LLMs (opens YouTube at this moment)
- 20:38What makes this loss function best? (opens YouTube at this moment)
- 26:13Distillation (opens YouTube at this moment)
- 30:123b1b Talent (opens YouTube at this moment)
- 31:35KL Divergence (opens YouTube at this moment)
More videos
22:46intermediateHow Inference Keeps Up with Our Insatiable Need for Tokens — Cerebras & Gimlet Labs
A 22-minute AI Engineer talk for inference engineers that covers runtime tricks like paged KV cache and chunked prefill, then system-level disaggregation and kernel-writing agents.
AI Engineer · 1.2K views ·
14:22intermediateSandboxes Aren't Optional: 4 Ways to Isolate Coding Agents — Robert Brennan, OpenHands
A 14-minute talk from the OpenHands CEO comparing four ways to sandbox coding agents, for developers who run agents with broad permissions.
AI Engineer · 3.9K views ·
19:17intermediateStop Renting Intelligence: The Train-to-Deploy Loop for Specialized AI — Fireworks AI
A 19-minute Fireworks AI talk on training open models on your own data and redeploying them in a continuous loop, for teams weighing closed-model costs.
AI Engineer · 6.1K views ·
14:07intermediateThree Questions Every Agent Engineer Should Be Able To Answer
A 14-minute LangChain talk on finding, reproducing and fixing agent failures using production traces, for engineers who run agents in production.
LangChain · 8.1K views ·