Cross-Entropy
Cross-Entropy is a measure from information theory that quantifies the difference between two probability distributions over the same set of events. Formally, given a "true" distribution p and an estimated distribution q, the cross-entropy H(p, q) represents the average number of bits needed to encode events drawn from p when using a coding scheme optimized for q. When the two distributions are identical, cross-entropy reduces to the entropy of the true distribution; when they diverge, cross-entropy grows, penalizing the mismatch.
In modern machine learning, cross-entropy loss is the workhorse objective for classification tasks, including the training of large neural networks and language models. Minimizing it is equivalent to maximum likelihood estimation under a categorical model, making it both theoretically grounded and practically effective. The concept bridges abstract information theory with concrete optimization, allowing engineers to quantify "surprise" and steer models toward more accurate predictions.
- Machine learning and deep learning (classification loss functions)
- Natural language processing (training language models, perplexity)
- Information theory and data compression
- Statistical inference and maximum likelihood estimation
- Reinforcement learning (policy optimization)
- Communication and coding theory
- Bioinformatics (sequence alignment scoring)
- Image recognition and computer vision
Speculations
- Romantic compatibility: measuring the "encoding cost" of one partner's expectations against another's actual behavior, with high cross-entropy signaling miscommunication.
- Cultural translation: quantifying the surprise a traveler feels when their internal model of a foreign society fails to match lived experience.
- Dream interpretation: treating the gap between waking expectations and dream imagery as a cross-entropy between conscious and unconscious distributions.
- Urban planning: scoring how well a city's designed flow matches the spontaneous paths pedestrians actually take.
- Culinary fusion: measuring how "surprising" a dish is by comparing diners' flavor expectations to the chef's actual composition.
- Theology: framing the disparity between divine intention and human action as a kind of moral cross-entropy.
- Fashion forecasting: assessing the mismatch between predicted seasonal trends and what people actually wear on the street.
References