Switch language한국어
Back to the list

Six (and a half) intuitions for KL divergence | Hacker News

TL;DR AI

Key summary

2 min read
  1. A company provides an internet connection to a business and uses compression; line management can yield profit.

  2. The company encodes tokens with a Huffman code based on its model q(x) — q(x) is the probability the company assigns to token x.

  3. The true token distribution is p(x), the actual probability of each token x.

  4. Average bit length using the company's code is -∑_x p(x) lg(q(x)); optimal Huffman length is -∑_x p(x) lg(p(x)).

  5. The difference, -∑_x p(x) lg(p(x)/q(x)), equals the Kullback–Leibler (KL) divergence.

Read the original