关于「两条路径:改变认知,还是改变世界」,《沙盘、宿命与主动推理》给出的定量结论是什么?
结论:先看第一部分。当智能体的结果先验是「被拒绝」(接纳只占 0.2)时,敞开的风险项很大(0.701),因为敞开会带来太多它「没有预期到」的接纳;设防的风险几乎为零,因为设防恰好带来它预期的拒绝。再加上设防的结果更可预测(模糊性更低),它选择敞开的概率只有 3%。同一个世界里,结果先验是 0.8 的智能体则 97% 选择敞开。
数据口径:本书不是心理治疗或诊断;关于「旧先验驱动重复挫折」的内容是假说与跨学科类比,绝不意味着受害者要为自己的遭遇负责。 书中以标注框区分已发表的证据、可运行的 Python 计算(15 段程序,全部核对)、原典与作者的假说。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.2, 0.701, 0.8
| C(accepted) | 0.2: G(open) = 0.701+0.499 = 1.200, G(guard) = 0.020+0.349 = 0.369, P(open) = 0.03 |
| C(accepted) | 0.5: G(open) = 0.131+0.499 = 0.630, G(guard) = 0.316+0.349 = 0.666, P(open) = 0.54 |
| C(accepted) | 0.8: G(open) = 0.007+0.499 = 0.506, G(guard) = 1.059+0.349 = 1.409, P(open) = 0.97 |
| the same world: always 'open' is accepted 0.75 of the time, always 'guard' 0.125 | |
| learned preferences, last 100 of 400 trials (200 simulated lives each): | |
| hopeful start C | 0.8 P(open) 0.75, share of lives mostly open 85% |
| bleak start C | 0.2 P(open) 0.01, share of lives mostly open 0% |
| bleak start + 10 sandbox trials of 'open' P(open) 0.16, share of lives mostly open 16% | |
| bleak start + 30 sandbox trials of 'open' P(open) 0.62, share of lives mostly open 70% |
核心公式
\[F[q] = \underbrace{D_{\mathrm{KL}}\big[q(s)\,\|\,p(s)\big]}_{\text{复杂度}} - \underbrace{\mathbb{E}_{q}\big[\ln p(o\mid s)\big]}_{\text{准确度}} \;\ge\; -\ln p(o).\]
查看完整验算程序
# A minimal active-inference agent caught in a self-confirming loop (a simplified model).
# Two actions: 'open' (reach out) and 'guard' (pre-emptive coldness). Two outcomes: accepted, rejected.
# Hidden state: the other person is warm or cool (prior 50:50). In active inference the agent's
# preferences ARE prior beliefs about outcomes, C = p(o). Expected free energy of an action:
# G = risk + ambiguity = KL[q(o|a) || C] + E_q(s)[ H[p(o|s,a)] ]
import math, random
A = {"open": {"warm": 0.90, "cool": 0.60}, # p(accepted | state, action)
"guard": {"warm": 0.20, "cool": 0.05}}
Q_S = {"warm": 0.5, "cool": 0.5}
def H(p):
return -sum(x * math.log(x) for x in (p, 1 - p) if x > 0)
def G(action, c_acc):
qa = sum(Q_S[s] * A[action][s] for s in Q_S) # predicted p(accepted)
risk = qa * math.log(qa / c_acc) + (1 - qa) * math.log((1 - qa) / (1 - c_acc))
ambiguity = sum(Q_S[s] * H(A[action][s]) for s in Q_S)
return risk, ambiguity
def p_open(c_acc, gamma=4.0):
g = {a: sum(G(a, c_acc)) for a in A}
z = {a: math.exp(-gamma * g[a]) for a in A}
return z["open"] / (z["open"] + z["guard"])
for c in (0.2, 0.5, 0.8):
ro, ao = G("open", c); rg, ag = G("guard", c)
print(f"C(accepted) = {c}: G(open) = {ro:.3f}+{ao:.3f} = {ro+ao:.3f}, "
f"G(guard) = {rg:.3f}+{ag:.3f} = {rg+ag:.3f}, P(open) = {p_open(c):.2f}")
def life(c0, trials=400, forget=0.99, n0=10.0, forced_open=0, seed=1):
"""C is learned: it tracks the outcomes the agent has experienced (Dirichlet counts with forgetting).
forced_open = number of early low-stakes trials in which the agent tries 'open' regardless."""
rng = random.Random(seed)
acc, rej = c0 * n0, (1 - c0) * n0
opens = []
for t in range(trials):
c = min(max(acc / (acc + rej), 0.01), 0.99)
a = "open" if t < forced_open or rng.random() < p_open(c) else "guard"
s = "warm" if rng.random() < 0.5 else "cool"
accepted = rng.random() < A[a][s]
acc = forget * acc + accepted
rej = forget * rej + (not accepted)
opens.append(a == "open")
return sum(opens[-100:]) / 100, acc / (acc + rej)
print("the same world: always 'open' is accepted", sum(Q_S[s] * A["open"][s] for s in Q_S),
"of the time, always 'guard'", sum(Q_S[s] * A["guard"][s] for s in Q_S))
print("learned preferences, last 100 of 400 trials (200 simulated lives each):")
for label, c0, f in (("hopeful start C=0.8", 0.8, 0), ("bleak start C=0.2", 0.2, 0),
("bleak start + 10 sandbox trials of 'open'", 0.2, 10),
("bleak start + 30 sandbox trials of 'open'", 0.2, 30)):
res = [life(c0, forced_open=f, seed=k) for k in range(200)]
po = sum(r[0] for r in res) / len(res)
esc = sum(r[0] > 0.5 for r in res) / len(res)
print(f" {label:42s} P(open) {po:.2f}, share of lives mostly open {esc:.0%}")唯一数据源与引用
范雅福(Fan, Y.). (2026). 《沙盘、宿命与主动推理》第 2 章「两条路径:改变认知,还是改变世界」(版本 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23738794
DOI: 10.5281/zenodo.23738794 · 阅读本章所在专著 · 5DL-B-015 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026015,
author = {Fan, Yafu},
title = {The Sandbox, Determinism and Active Inference},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
doi = {10.5281/zenodo.23738794},
url = {https://doi.org/10.5281/zenodo.23738794}
}