EpistemicPhysics
All articles
Bayesian relativity · Model comparison · Thermodynamics · Learning

The latent heat of insight

Watch competing explanations trade places, discover the price of flexibility, and explore how memory changes the insights we can sustain.

Imagine watching a coin that keeps landing heads just a little too often. At first you shrug. Coins do that. After a while, the same small anomaly begins to look like a pattern. Eventually the explanation changes: perhaps this coin has a bias.

The next head now feels less surprising. Something has clicked, even though the coin has been doing the same thing all along.

That is the puzzle of insight: evidence arrives one trial at a time, yet explanations can seem to reorganize in a flash. Can we put a number on the relief of finally seeing the pattern? And could an observer with a short memory miss a pattern that an archive makes obvious?

We can build a small mathematical theater for these questions. Its actors are two competing models. Its currency is surprise. Its resemblance to melting ice is intriguing enough to explore carefully.

Two explanations at the same laboratory bench

Let each trial be a coin toss, independent of the others, with a constant but unknown heads probability p. These are our sampling assumptions. We compare:

Fair model M0Flexible model M1
Claimp=1/2p can lie anywhere between 0 and 1
Initial uncertainty about pNone inside this modelUniform Beta⁡(1,1) prior
Prediction after Y heads and N tails1/2(Y+1)/(Y+N+2)
Main advantageConcentrates its predictions immediatelyCan learn a persistent bias

There are two different uncertainties here. Inside M1, we wonder which bias the coin has. Above both models, we wonder whether flexibility is needed at all. The probability of M1 is a separate quantity from its estimated heads rate.

Suppose the ordered record contains n=Y+N trials. The marginal likelihood, also called model evidence, is the probability that a model assigns to that record before fitting a single preferred parameter. For our two models it is exactly

Z0=2−n,Z1=∫01pY(1−p)Ndp=B(Y+1,N+1)=Y!N!(n+1)!.

Here B(a,b) is the Beta function, the integral that normalizes a Beta density. We are scoring an ordered sequence. Scoring only the counts would multiply both expressions by the same binomial coefficient, which cancels in their ratio.

That ratio, Z1/Z0, is the Bayes factor. It multiplies the prior odds of the models to produce their posterior odds. This is the standard model-comparison rule described by Kass and Raftery.

Write π=P(M1) for the flexible model’s prior probability and wn=P(M1∣Dn) for its probability after the record Dn. Then

wn1−wn=π1−πZ1Z0.

The prior on a model and the prior inside a model play different roles. Choosing π=0.1 favors the fair explanation initially; it does not change the uniform distribution of biases considered inside M1.

Why the right explanation can lose early

Start with equal model probabilities. One head gives both models likelihood 1/2, so nothing happens to their relative standing. Add a tail. The fair model assigns probability 1/4 to this two-trial record; the flexible model assigns 1/6. Its posterior probability falls to

w2=1/61/6+1/4=25.

The flexible model spreads its initial bets across many coins, including nearly all-heads and nearly all-tails coins. Those extreme possibilities predict the mixed record poorly. Averaging over them costs probability.

This is an Occam penalty: unused flexibility lowers a model’s marginal likelihood. It arises from averaging predictions, without an extra rule that complexity is bad. A second head instead would give Z1=1/3 and w2=4/7, so the early dip is a common pattern rather than an inevitable ritual.

Now imagine the actual generating rate is p∗=0.6. The asterisk marks the rate used by the world in our experiment. The fair model can never adjust, while the flexible model can gradually learn it. Flexibility starts collecting a return.

Before revealing trials below, predict which observer will sustain a preference for the flexible model. Try the 60% coin with 50-trial memory, then change the memory to 200. Finally try the fair coin: how often does a temporary streak look like an insight?

The evidence desk

Which explanation will the next packet favor?

Place an explanation on the desk before opening the next 50 trials. The archive and the smaller notebook read the same packet.

Packet 1 of 12 · 0 trials opened · generating heads rate 60%

Full archive

50.0%

probability of flexible model

Last 50 trials

50.0%

probability of flexible model

Choose which model you expect to lead after the first packet.

Change the coin, memory, or model prior

Changing an assumption restarts the desk, so a verdict always belongs to the displayed experiment.

Generating heads probability

Notebook capacity

Prior probability of flexible model

100%0 trials100

Full-archive costs: fair 0.00 nats, flexible 0.00 nats. Notebook costs: fair 0.00, flexible 0.00. These are negative log marginal likelihoods; priors apply separately. The flexible model uses Beta(1,1). A seeded constant-rate independent Bernoulli sequence makes replays comparable. Preference for an explanation is different from proof that it is true.

The teal and gold curves share every revealed trial. Their difference comes entirely from what they retain. Changing the model prior lets you compare a welcoming observer with a skeptical one without changing the coin.

The price of an explanation

Turn probabilities into additive costs by defining

Fj=−log⁡Zj.

Logs are natural logarithms, so the unit is a nat; dividing by log⁡2 converts nats to bits. This quantity is called Bayesian free energy. Lower Fj means the model assigned more probability to the observed sequence.

Our exact formulas give F0=nlog⁡2 and F1=−log⁡B(Y+1,N+1). A large-sample approximation reveals the competition. Put p^=Y/n, the observed heads fraction. Away from the endpoints 0 and 1, Stirling’s factorial approximation gives

F1≈nH(p^)+12log⁡n−12log(2πp^(1−p^)),

where

H(p)=−plog⁡p−(1−p)log⁡(1−p)

is binary entropy, the average surprise when predictions match a coin’s actual rate.

The first term pays for the data. The logarithmic term pays for learning the bias. Because that second term grows slowly, a persistent predictive advantage can eventually outweigh it.

The fair coin’s excess cost at a fixed rate p∗ is

D=KL(Bern⁡(p∗)‖Bern⁡(1/2))=log⁡2−H(p∗).

The notation Bern⁡(p) means the binary distribution with heads probability p. The Kullback-Leibler divergence, abbreviated KL, measures an expected excess log loss when one distribution is used to predict data from another.

Replacing the observed frequency by its typical value p∗ and dropping constant terms gives a rough crossover equation,

nD≈12log⁡n.

For p∗=0.6, D≈0.02014 nats per trial, and the large root is about 119 trials. This is a scale estimate. The omitted constant, prior odds, and random streaks all move the actual crossing. There is no universal 119th-trial revelation.

Where the heat analogy becomes useful

An exact identity connects the cumulative cost with incoming surprise:

Fj(Dn)−Fj(Dn−1)=−log⁡Pj(yn∣Dn−1).

Here yn is the latest outcome. A model’s increase in cost is precisely how surprising it found that outcome. This identity uses a growing record; deleting old trials, as the gold notebook does, adds a separate change to the cost.

Suppose a predictor uses heads probability q. Its expected next-trial cost under the true rate p∗ is

L(p∗,q)=−p∗log⁡q−(1−p∗)log⁡(1−q)=H(p∗)+KL⁡(p∗‖q).

This gives a tidy side-by-side comparison:

Before learning the biasAfter learning it accurately
Predict q=1/2Predict q≈p∗
Expected surprise log⁡2Expected surprise approaches H(p∗)
Pay the full mismatch D each trialMismatch tends toward zero

The asymptotic savings is exactly D. This is the mathematical heart of the “latent heat of insight” metaphor: an explanation that fits releases us from a recurring surprise cost. Earlier costs remain paid; the savings concerns future predictions.

For a 60% coin, the improvement is modest: about 0.02014 nats per trial. That small amount accumulates. An explanation can matter greatly over a long future even when the next prediction changes only a little.

A physical latent heat is energy transferred during a phase change. Our quantity has units of information per trial. Converting it into joules, brain activity, or a person’s reported relief would require a physical or psychological model. The identity itself tells us exactly what a prediction experiment should measure: the difference in expected log loss.

Does an explanation actually undergo a phase transition?

The two branches can cross. If we always choose whichever model has larger posterior probability, the chosen label changes abruptly at the crossing. That hard choice can look like a miniature change of phase.

The full Bayesian observer carries both models. Its marginal likelihood is their weighted sum,

Z=(1−π)Z0+πZ1,F=−log((1−π)e−F0+πe−F1).

This is a smooth, softened minimum of the prior-adjusted branches. Finite positive likelihoods give a smooth dependence on their relative scores. Trials arrive discretely, and a very diagnostic trial can cause a large update, but a branch crossing alone establishes no thermodynamic singularity or first-order transition.

That distinction makes the analogy more interesting. Apparent suddenness can arise at several levels: a steep posterior change, an action threshold, a conscious report, or a genuine collective instability. They need different explanations.

The model-averaged prediction illustrates the separation:

P(next head∣Dn)=(1−wn)12+wnY+1n+2.

Even when the model probability swings strongly, the next-head prediction may move only between roughly 0.5 and 0.6. A large change in which story we tell can accompany a small change in what we predict next.

Put explanations to work with a shared budget

A preference between models becomes useful when it improves a decision. Spend a limited observation budget across three coins, then choose fair, flexible, or model-averaged predictions. Each coin has a sealed future block. Its outcomes are kept separate from the inspected training trials, so the final bill tests prediction beyond the evidence used to choose the recipe.

The explanation workshop

Spend six tokens on three hidden coins

Three coins share six observation tokens. Each token opens four training trials. Allocate them, choose a forecasting recipe for each coin, then open the sealed future.

6 tokens left16 future trials await each coin

Coin A

0 heads · 0 tails observed

Unopened

Forecast: 50.0% heads

Coin B

0 heads · 0 tails observed

Unopened

Forecast: 50.0% heads

Coin C

0 heads · 0 tails observed

Unopened

Forecast: 50.0% heads

What the budget and the bill mean

The fair recipe predicts 50%. The flexible recipe uses a Beta(1,1) prior and the inspected counts. The mixture weights those recipes by model probabilities with equal model priors. Each recipe is frozen before its 16 held-out trials; the bill sums −log₂ of their assigned probabilities. Inspection tokens constrain access to training data and have no conversion into bits. All three coins have fixed generating rates; samples are repeatable seeded Bernoulli sequences. The held-out block is generated separately and stays fixed regardless of which training data you inspect. A model's posterior probability and a forecast's held-out score answer different questions.

Coin A: current probability of the flexible model 50.0%.

Coin B: current probability of the flexible model 50.0%.

Coin C: current probability of the flexible model 50.0%.

The token budget limits access to observations; it is separate from the predictive bill in bits. A model can have the higher posterior probability and still lose on a short held-out block. Replaying the same blocks helps compare allocations, while repeated tuning on those blocks would eventually make them part of the training process.

Memory sets a scale for subtlety

Give an observer a rolling notebook containing only the latest W trials. Each new trial arrives; the oldest leaves. We recompute both models from that retained record with their priors counted once. This is the gold observer’s explicit memory rule.

Its typical accumulated advantage is of order WD, while the flexible model’s complexity cost is of order 12log⁡W. A useful detectability scale is therefore

Dscale≈log⁡W2W.

For an exponential discount rule, old trials instead carry weights rk, where 0<r<1 and k is their age. Their limiting total weight is 1/(1−r). Writing λ=1−r and using W≈1/λ suggests

Dscale≈λ2log⁡(1/λ).

That substitution is a heuristic comparison between memory models. Fractional likelihood weights define another inference rule, and their total weight need not equal an effective sample size for every statistic.

Neither expression creates an absolute insight horizon. Even a short window can contain an unusually one-sided run and favor the flexible model. In fact, with an indefinitely running independent coin having 0<p∗<1, any particular finite run eventually occurs with probability one. The difficulty is sustaining a reliable preference amid repeated forgetting and fluctuation.

The practical idea survives beautifully. Archives can make subtle regularities visible across timescales that exceed an individual’s memory. Longitudinal studies and replay buffers extend the record over which a weak predictive advantage can accumulate. Copying the same testimony many times does not create that advantage: its lineage still points to the same underlying trial. Storage preserves evidence; duplication does not manufacture independence.

Supercooling, stubbornness, and the missing dynamics

What if the familiar explanation receives 90% prior probability? Then π=0.1, and the flexible model must earn a log Bayes factor greater than log⁡9 before becoming more probable. Extra prior support delays a switch.

That resembles a paradigm persisting through anomalies, but physical supercooling involves metastability: a system remains trapped because its dynamics encounter a barrier. Static Bayesian comparison contains no such barrier. Reorder the same retained independent trials and its final answer remains unchanged.

To model hysteresis, where the route into a state affects the route out, we could add switching costs, different thresholds for adopting and abandoning an explanation, social reinforcement, or limited search. These are fertile extensions. Each supplies a concrete mechanism that can be varied and tested.

An “aha calorimetry” experiment could ask people for probabilistic predictions before and after a reported insight, then score later independent outcomes. The observed change in log loss would test the predictive benefit. Comparing that benefit with subjective surprise or physiological measurements would investigate the psychological bridge rather than assume it.

Beyond a single adjustable coin

For a regular model with d identifiable parameters, the leading complexity term is often d2log⁡n. Neural networks and latent-variable models can be singular: different parameters can represent the same distribution, and the usual local quadratic approximation can fail.

Watanabe’s singular learning theory replaces d/2 with a geometric quantity called the real log canonical threshold, or RLCT. Under the theorem’s conditions, the free energy has leading form

Fn=nLn(θ∗)+λRLCTlog⁡n+Op(log⁡log⁡n).

Here Ln is average observed log loss, θ∗ is a best-fitting population parameter, and Op describes the stochastic remainder’s scale. The RLCT depends on the model, true distribution, and prior. It is distinct from the forgetting rate used above. This established theory provides a richer complexity coefficient; identifying it with physical specific heat requires additional structure.

We can imagine three competing explanations, each learning a different pattern and paying a different complexity cost. Their posterior weights might take turns leading. Whether a particular neural system actually passes through such stages is a question for a specified model and measurement.

Epistemic Physics adds a useful map of the two levels. Within the flexible coin model,

α=Y+1,β=N+1,τ=α+β=n+2,x=α−β=Y−N, μ=ατ,v=xτ,m=2αβ,τ2−x2=m2.

Each independent trial extends the evidence lineage by a tracelet. The Beta parameters include the prior, and μ is the mean. Above that cone sits the separate model probability wn. Carrying both requires a richer state than one Beta distribution: a mixture with a point mass at p=1/2 and a continuous Beta component.

That extra layer is where the adventure begins. A slow-moving estimate inside one explanation can feed a much larger change in which explanation organizes the world. The coin gives us a place to explore that possibility with every assumption, trial, and cost visible.

Further reading