One idea, 4 fields
Entropy
The unifying principle
Start with a probability distribution over possible states . Define the Shannon entropy:
This single formula is the bridge. It is maximized when is uniform (all states equally likely → maximal ignorance) and zero when one state has (certainty).
If all microstates are equally likely, , and it collapses to:
This is Boltzmann's formula (with a unit constant). So thermodynamic entropy is just the uniform-distribution special case of information entropy. The choice of logarithm base sets the units:
- base 2 → bits (information)
- base → nats (statistics/ML)
- multiply by Boltzmann's → J/K (thermodynamics)
Everything below is this one expression wearing different clothes.
How it shows up in each field
Physics (Thermodynamics & Statistical Mechanics)
Form: (Boltzmann), or (Gibbs). Why it's the same idea: is the number of microstates consistent with the macrostate — literally "the number of arrangements you can't distinguish." The Second Law () says isolated systems drift toward the macrostate with the most microstates, i.e. maximal ignorance. Example: Free expansion of an ideal gas into double the volume. Each molecule now has twice the accessible positions, so and . For one mole, .
Chemistry (Reaction spontaneity)
Form: Gibbs free energy . A reaction is spontaneous when . Why it's the same idea: counts how the number of accessible molecular arrangements (translational, rotational, vibrational modes) changes across the reaction. Dissolving, melting, or producing more gas moles raises and thus . Example: . This dissolution is endothermic (, the pack gets cold) yet spontaneous — because the ordered crystal disperses into many mobile solvated arrangements, so and wins.
AI / Machine Learning (Cross-entropy loss)
Form: For true distribution (one-hot labels) and model prediction : Related: KL divergence measures how far is from . Why it's the same idea: Cross-entropy is the average surprise of the true labels under the model's beliefs. Minimizing it makes the model less surprised by reality. Since with equality iff , the loss floor is the data's intrinsic entropy. Example: A classifier predicts but the truth is class 1 (). Loss nats. If it had predicted , loss — near-zero surprise.
Coding / CS (Data compression)
Form: Shannon's source coding theorem: the minimum average bits per symbol is (in base 2). Why it's the same idea: You can't compress below the entropy — it's the irreducible information content. Frequent symbols get short codes; rare (surprising) symbols get long ones, matching bits per symbol. Example: Text where 'e' appears with , others rare. Huffman/arithmetic coding assigns 'e' ~1 bit and rare letters many bits. A source with bits/char cannot be losslessly stored below 2.1 bits/char on average — that's the entropy wall.
Why this bridge matters
What transfers:
- Physics → ML: The maximum entropy principle — "assume the least, be maximally uncertain given constraints" — derives the Boltzmann/softmax distribution . This is literally the softmax in neural nets, with logits as negative energies and a temperature that flattens or sharpens predictions.
- Information theory → Chemistry: Seeing as "missing information" demystifies why endothermic reactions can be spontaneous: nature maximizes accessible arrangements, not minimizes energy.
- ML → CS: Cross-entropy loss and compression are dual — a good language model is a good compressor (this is the basis of the "compression = intelligence" viewpoint; e.g. arithmetic coding driven by an LLM).
The unlocking intuition: Once you see that "disorder" (physics), "product dispersal" (chemistry), "model surprise" (ML), and "irreducible bits" (CS) are all , temperature, softmax, spontaneity, and compression limits stop being separate facts. They're one theorem in four costumes.
Connections
- 01 Statistical Mechanics & Microstates
- 02 Second Law of Thermodynamics
- 03 Gibbs Free Energy & Spontaneity
- 04 Shannon Information Theory
- 05 Cross-Entropy & KL Divergence
- 06 Softmax & Maximum Entropy
- 07 Lossless Compression & Source Coding
- 08 Boltzmann Distribution
#bridge