5D Library › The Thermodynamics of Desire · 中文

Chapter 4. The Free-Energy Principle: A Mind That Wants Both Safety and Novelty

Two complaints that are one complaint

People who are unhappy in a long relationship tend to make one of two complaints. The first is “I know exactly what he will say”, “nothing surprises me any more”, “we are like flatmates”. The second is the opposite: “I never know which version of her will come home”, “I am always on edge”, “I cannot relax”. One sounds like boredom and the other like anxiety, and they are usually treated as different problems.

This chapter argues that they are one problem seen from two sides, and that both are about prediction. A mind needs its world, and above all the people closest to it, to be predictable enough to be safe. It also needs that world to keep teaching it something. Too little of the first is anxiety; too little of the second is boredom. The free-energy principle, introduced at the end of Chapter 3, gives a precise way to describe both needs at once, and to ask where the balance lies.

Surprise, and the bound on it

Begin with a single quantity. When something happens that a mind assigned probability p(o)p(o), the surprisal of that observation is −lnp(o)-\ln p(o). A likely event has low surprisal; an unlikely one has high surprisal. Averaged over time, surprisal is entropy, the quantity of Chapter 1.

A brain cannot compute the probability of its sensations directly, because that would require averaging over every possible hidden cause in the world. Karl Friston’s proposal is that it instead minimises a quantity it can compute, the variational free energy

F=DKL[q(s)∥p(s∣o)]−lnp(o)≥−lnp(o),F = D_{\mathrm{KL}}\big[q(s)\,\|\,p(s \mid o)\big] – \ln p(o) \;\geq\; -\ln p(o),

where q(s)q(s) is the brain’s current best guess about the hidden causes ss of what it senses. Because the divergence DKLD_{\mathrm{KL}} can never be negative, FF is always at least as large as the surprisal. By making its guesses better (reducing the divergence) and by acting so that its sensations are the kind it expects (reducing the surprisal), the system keeps both low (Friston 2010; Parr, Pezzulo, and Friston 2022).

Evidence

The free-energy principle and its process theory, active inference, describe perception, learning and action as the minimisation of variational free energy, and planning as the minimisation of expected free energy over possible courses of action (Parr, Pezzulo, and Friston 2022). The principle is influential and also contested: critics argue that, as a principle, it is so general that it is hard to see what observation could count against it, and that its testable content lies in the specific models built under it (Colombo and Wright 2021). This book uses those specific models, which can be tested, and not the principle as a whole.

A partner as a model to be learned

Imagine one partner learning the other’s evenings. Most evenings follow the usual pattern; about one in five brings something different. The learner starts knowing nothing and updates a simple Bayesian belief about how often “the usual” happens. Two things can be measured for each evening: how surprised the learner was, and how much the evening taught it, which is the change in its belief, measured as a divergence between the belief after and the belief before.

Calculation

from math import lgamma, log

def digamma(x):
    r = 0.0
    while x < 6:
        r, x = r - 1 / x, x + 1
    f = 1 / (x * x)
    return r + log(x) - 0.5 / x - f * (1 / 12 - f * (1 / 120 - f * (1 / 252 - f * (1 / 240 - f / 132))))

def kl_beta(a1, b1, a0, b0):
    """KL divergence of Beta(a1, b1) from Beta(a0, b0): what one evening taught us, in nats."""
    lnB = lambda a, b: lgamma(a) + lgamma(b) - lgamma(a + b)
    return (lnB(a0, b0) - lnB(a1, b1) + (a1 - a0) * digamma(a1)
            + (b1 - b0) * digamma(b1) + (a0 - a1 + b0 - b1) * digamma(a1 + b1))

a, b = 1.0, 1.0                                  # no idea yet how the partner's evenings go
evenings = [1, 1, 0, 1, 1, 1, 0, 1, 1, 1] * 10   # 100 evenings: 1 = the usual, 0 = something different
rows, s, g = [], 0.0, 0.0
for n, x in enumerate(evenings, 1):
    p = a / (a + b)                              # predicted chance of "the usual"
    s += -log(p if x == 1 else 1 - p)            # surprisal of what happened
    a1, b1 = (a + 1, b) if x == 1 else (a, b + 1)
    g += kl_beta(a1, b1, a, b)                   # information gained
    a, b = a1, b1
    if n in (10, 30, 100):
        rows.append((n, s, g))

print("evenings     mean surprisal   mean information gain (nats)")
prev_n, prev_s, prev_g = 0, 0.0, 0.0
for n, s, g in rows:
    k = n - prev_n
    print(f"{prev_n + 1:3d}-{n:<3d}   {(s - prev_s) / k:14.3f}   {(g - prev_g) / k:16.4f}")
    prev_n, prev_s, prev_g = n, s, g
print(f"floor: entropy of a 0.8/0.2 pattern = {-(0.8 * log(0.8) + 0.2 * log(0.2)):.3f} nats")
# evenings     mean surprisal   mean information gain (nats)
#   1-10             0.620             0.0927
#  11-30             0.526             0.0239
#  31-100            0.509             0.0082
# floor: entropy of a 0.8/0.2 pattern = 0.500 nats

The two columns tell different stories. Surprisal falls at first and then stops falling: it approaches 0.500 nats, the entropy of the 0.8/0.2 pattern itself, and never goes below it. That remaining surprise is noise; no amount of learning can remove it. Information gain falls by a factor of ten and keeps falling towards zero. After a hundred evenings, the partner is still a little unpredictable, but no longer teaches anything.

This is a precise version of boredom. It is not the absence of surprise; the evenings still vary. It is the absence of learnable surprise, of information. And it suggests why the remedy for boredom is not simply randomness. A partner who became erratic would raise surprisal without raising information gain, and the result would be the second complaint, not the end of the first.

Why minds explore: expected free energy

Chapter 3 mentioned the dark-room problem: if minds minimise surprise, why do they not sit in a dark room? The answer of active inference is that when a mind chooses what to do next, it weighs two things (Friston et al. 2015). One is risk: how far the likely outcomes of an action fall from the outcomes it prefers. The other is epistemic value: how much the action is expected to teach it. The quantity to minimise is

G=risk⏟cost of unwanted outcomes−epistemic value⏟expected information gain.G = \underbrace{\text{risk}}_{\text{cost of unwanted outcomes}} \; – \; \underbrace{\text{epistemic value}}_{\text{expected information gain}} .

An action that is safe but teaches nothing has low risk and no epistemic value. An action that is wild teaches a great deal but risks a great deal. The mind’s choice depends on how heavily it weighs the risk.

Calculation

A couple is choosing how to spend an evening. Their beliefs about each option are Beta distributions: the familiar routine has gone well 45 times and badly 5 times; a new shared activity has been tried a few times; “something wild” is a complete unknown. Let λ\lambda be how costly a bad evening feels. Risk is then λ⋅P(bad)\lambda \cdot P(\text{bad}), and epistemic value is the expected information gain from trying the option once.

from math import log

def digamma(x):
    r = 0.0
    while x < 6:
        r, x = r - 1 / x, x + 1
    f = 1 / (x * x)
    return r + log(x) - 0.5 / x - f * (1 / 12 - f * (1 / 120 - f * (1 / 252 - f * (1 / 240 - f / 132))))

def h(p):
    return -(p * log(p) + (1 - p) * log(1 - p))

def info_gain(a, b):
    """Expected information gain (nats) about the option from trying it once: the epistemic value."""
    m = a / (a + b)
    expected_h = digamma(a + b + 1) - m * digamma(a + 1) - (1 - m) * digamma(b + 1)
    return h(m) - expected_h

options = {                       # what the couple believes about each kind of evening: Beta(good, bad)
    "familiar routine":   (45, 5),
    "new shared activity": (3, 1),
    "something wild":     (1, 1),
}
print("option                P(bad)   epistemic value")
stats = {}
for name, (a, b) in options.items():
    stats[name] = (b / (a + b), info_gain(a, b))
    print(f"{name:20s}  {stats[name][0]:6.2f}   {stats[name][1]:15.3f}")

print("\nlambda (cost of a bad evening)   choice that minimises G = lambda*P(bad) - epistemic value")
for lam in (0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 1.0):
    G = {n: lam * pb - ig for n, (pb, ig) in stats.items()}
    print(f"{lam:6.1f}                          {min(G, key=G.get)}")

names = list(stats)
for i in range(len(names)):
    for j in range(i + 1, len(names)):
        (p1, g1), (p2, g2) = stats[names[i]], stats[names[j]]
        print(f"indifferent between '{names[i]}' and '{names[j]}' at lambda = {(g2 - g1) / (p2 - p1):.3f}")
# option                P(bad)   epistemic value
# familiar routine        0.10             0.010
# new shared activity     0.25             0.104
# something wild          0.50             0.193
# 
# lambda (cost of a bad evening)   choice that minimises G = lambda*P(bad) - epistemic value
#    0.2                          something wild
#    0.3                          something wild
#    0.4                          new shared activity
#    0.5                          new shared activity
#    0.6                          new shared activity
#    0.7                          familiar routine
#    1.0                          familiar routine
# indifferent between 'familiar routine' and 'new shared activity' at lambda = 0.629
# indifferent between 'familiar routine' and 'something wild' at lambda = 0.459
# indifferent between 'new shared activity' and 'something wild' at lambda = 0.357
Expected free energy of three kinds of evening as a function of λ, how costly a bad evening feels. The lowest line at each λ is the one chosen. Between λ = 0.36 and λ = 0.63, the new shared activity wins: novel enough to teach something, safe enough to try.

The result has a clear shape. When a bad evening costs little (λ<0.36\lambda < 0.36), the best choice is the wildest one, because it teaches the most. When a bad evening costs a great deal (λ>0.63\lambda > 0.63), the best choice is the routine, because nothing is worth the risk. Between the two lies a band where the best choice is the new shared activity: uncertain enough to be worth learning from, familiar enough to be safe.

Two features of this calculation matter for what follows. The band exists only because epistemic value is real; a mind that cared only about risk would always choose the routine. And the boundaries depend on λ\lambda, which is not a fixed property of the activities but of the person and the relationship.

Evidence: the Goldilocks zone and the secure base

Evidence

Daniel Berlyne’s experiments in the 1960s and 1970s found that people’s liking for patterns and sounds rises with novelty and complexity up to a point and then falls, an inverted U (Berlyne 1970). Celeste Kidd and colleagues found the same shape in infants’ attention: infants of seven and eight months were most likely to look away from visual sequences that were either very predictable or very unpredictable, and attended longest to those in between (Kidd, Piantadosi, and Aslin 2012).

Evidence

Attachment research describes a secure base: a relationship partner whose availability makes it safe to explore. Brooke Feeney and Nancy Collins reviewed evidence that support of this kind, which encourages a partner’s exploration and growth rather than only comforting them in distress, is associated with people taking on new challenges and thriving (Feeney and Collins 2015).

The two lines of evidence fit the calculation. Interest is highest at intermediate novelty, and what counts as “intermediate” depends on how safe the explorer feels.

Safety buys novelty

Hypothesis · not established · Safety buys novelty

In a relationship, λ\lambda, the felt cost of a bad shared experience, is set largely by how reliable the partner is: whether they show up, keep promises, stay kind when things go wrong. A reliable partner lowers λ\lambda, which moves the Goldilocks band towards more novel shared activities. Safety and novelty are therefore not opposites to be traded against each other; a predictable partner is what makes unpredictable experiences affordable.

The hypothesis makes testable predictions. Couples who report more felt security should choose more novel shared activities when given a free choice, and should gain more from them; and within a couple, increases in felt security should come before increases in shared exploration, not after. If secure and insecure couples choose and benefit from novelty equally, or if exploration rises first and security follows, the hypothesis is wrong.

The practical rule that follows is easy to say: keep the partner predictable and the adventures unpredictable. Reliability belongs to the core of the relationship, to promises, kindness and presence; novelty belongs to its content, to what the two people do, learn and make together. Many couples have this the wrong way round. Their activities are fixed (the same restaurant, the same programme, the same holiday), while their reactions to each other are unpredictable (warm one day, cold the next). The model predicts that this combination produces both complaints at once.

Source text

复命曰常,知常曰明。不知常,妄作,凶。(老子, n.d.)

The author’s translation: Returning to one’s destiny is called the constant; knowing the constant is called clarity. Not knowing the constant, one acts recklessly, and disaster follows. (Daodejing, chapter 16)

The Daodejing does not oppose change; most of the book is about it. But it insists that change is only navigable from a known constant. In the language of this chapter, the constant is the low-surprisal core that lets a mind afford to explore.

Note

Nothing in this chapter is a reason to stay with a partner who is frightening or controlling. In the model, such a partner makes λ\lambda very high and the relationship itself a source of surprisal; no amount of novel activity can fix that, and the right step is to seek help, as the preface says.

Chapter 5 turns from what a mind seeks to what drains it: the outflow of attention, and the kind of reward that is designed never to become predictable.

References

Berlyne, D. E. 1970. “Novelty, Complexity, and Hedonic Value.” Perception & Psychophysics 8 (5): 279–86.
Colombo, Matteo, and Cory Wright. 2021. “First Principles in the Life Sciences: The Free-Energy Principle, Organicism, and Mechanism.” Synthese 198: 3463–88.
Feeney, Brooke C., and Nancy L. Collins. 2015. “A New Look at Social Support: A Theoretical Perspective on Thriving Through Relationships.” Personality and Social Psychology Review 19 (2): 113–47.
Friston, Karl. 2010. “The Free-Energy Principle: A Unified Brain Theory?” Nature Reviews Neuroscience 11 (2): 127–38.
Friston, Karl, Francesco Rigoli, Dimitri Ognibene, Christoph Mathys, Thomas Fitzgerald, and Giovanni Pezzulo. 2015. “Active Inference and Epistemic Value.” Cognitive Neuroscience 6 (4): 187–214.
Kidd, Celeste, Steven T. Piantadosi, and Richard N. Aslin. 2012. “The Goldilocks Effect: Human Infants Allocate Attention to Visual Sequences That Are Neither Too Simple nor Too Complex.” PLoS ONE 7 (5): e36399.
Parr, Thomas, Giovanni Pezzulo, and Karl J. Friston. 2022. Active Inference: The Free Energy Principle in Mind, Brain, and Behavior. Cambridge, MA: MIT Press.
老子. n.d. 道德经.

Fan, Y. (2026). The Thermodynamics of Desire: Entropy, Dopamine Prediction Error and Dissipative Structures in Human Bonds [欲望的热力学] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23682498 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).