Index Ai Academy
Glossary · Phase 2 · Math, when you need it

KL divergence

A measure of how different one set of probabilities is from another.

Try it now

Pick which word actually came next. Raise its score and the loss falls toward 0; give probability to the wrong words and it climbs. Training nudges the logits exactly this way.

Learn it properly

Cross-entropy and KL divergence · The loss function language models are trained on. About 30 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write