5D Library › The Sandbox, Determinism and Active Inference · 中文

Chapter 8 Practice and a Pre-Registered Trial

Part 1 A four-step Bayesian audit

The first seven chapters come down to an audit you can do yourself. It uses a month of simple records to check a pattern that may be sustaining itself. All you need is a notebook or a phone memo: each time an interpersonal or work event disappoints you, write down the situation, your own first move (open or guard) and the outcome.

  1. Repeated setback patterns. In what kind of situation do disappointments cluster? (Chapters 1 and 2)
  2. Self-confirming behaviour. In those situations, does the outcome differ with your own first move? (Chapter 2)
  3. The boundary of sensory input. How much of your daily information comes from low-information sources unrelated to your actual situation? (Chapter 3)
  4. High-information micro-experiments. In situations where the risk is manageable, deliberately try a different move a number of times, record the outcomes, and update your expectation with them. (Chapters 4 and 5)

Calculation

The audit applied to a fictional month of records.

# The four-step audit applied to one month of a (fictional) personal log.
# Each episode: (context, own first move, outcome). 'guard' = a pre-emptive defensive move.
from math import lgamma, exp, log
log_ = ([("proposal at work", "guard", "rejected")] * 7 + [("proposal at work", "open", "accepted")] * 3 +
        [("proposal at work", "open", "rejected")] * 1 + [("proposal at work", "guard", "accepted")] * 1 +
        [("family", "open", "accepted")] * 5 + [("family", "guard", "rejected")] * 2 +
        [("new contact", "guard", "rejected")] * 4 + [("new contact", "open", "accepted")] * 2)

# Step 1 - repeated frustration: where do rejections cluster?
ctx = {}
for c, move, out in log_:
    k = ctx.setdefault(c, [0, 0]); k[0] += out == "rejected"; k[1] += 1
print("1 repeated pattern:", ", ".join(f"{c} {r}/{n} rejected" for c, (r, n) in ctx.items()))

# Step 2 - self-confirming moves: rejection rate after one's own guard vs open move
for move in ("guard", "open"):
    sel = [o for _, m, o in log_ if m == move]
    print(f"2 after the move '{move}': {sum(o == 'rejected' for o in sel)}/{len(sel)} rejected")

# Step 3 - what crosses the boundary: daily input hours by source (from a screen-time export)
inputs = {"news and comment feeds": 2.5, "short-video feed": 1.5, "books and long reads": 0.5, "conversation": 1.0}
low = inputs["news and comment feeds"] + inputs["short-video feed"]
print(f"3 inputs: {low:.1f} of {sum(inputs.values()):.1f} h/day from low-information feeds ({low / sum(inputs.values()):.0%})")

# Step 4 - a micro-experiment: 10 deliberate 'open' proposals, logged as they happen.
remembered = (9, 1)          # what memory says: 9 rejections, 1 acceptance (prior counts)
trial = (3, 7)               # what the log shows: 3 rejected, 7 accepted
a, b = remembered[0] + trial[0] + 1, remembered[1] + trial[1] + 1

def beta_cdf(x, a, b, n=20000):          # P(rate < x) by the midpoint rule
    lb = lgamma(a) + lgamma(b) - lgamma(a + b)
    h = x / n
    return sum(exp((a - 1) * log((i + 0.5) * h) + (b - 1) * log(1 - (i + 0.5) * h) - lb) for i in range(n)) * h

for label, (aa, bb) in (("memory only", (remembered[0] + 1, remembered[1] + 1)),
                        ("memory + experiment", (a, b)), ("experiment only", (trial[0] + 1, trial[1] + 1))):
    print(f"4 {label:20s}: mean rejection rate {aa / (aa + bb):.2f}, P(rate > 0.5) = {1 - beta_cdf(0.5, aa, bb):.2f}")
# 1 repeated pattern: proposal at work 8/12 rejected, family 2/7 rejected, new contact 4/6 rejected
# 2 after the move 'guard': 13/14 rejected
# 2 after the move 'open': 1/11 rejected
# 3 inputs: 4.0 of 5.5 h/day from low-information feeds (73%)
# 4 memory only         : mean rejection rate 0.83, P(rate > 0.5) = 0.99
# 4 memory + experiment : mean rejection rate 0.59, P(rate > 0.5) = 0.81
# 4 experiment only     : mean rejection rate 0.33, P(rate > 0.5) = 0.11

In this fictional record, disappointments cluster around proposals at work (8 rejections in 12) and meeting new people (4 in 6). Step 2 shows a striking contrast: 13 of 14 episodes that began with guarding ended in rejection, against 1 of 11 that began with opening. Step 3 shows that 73 % of 5.5 hours of daily input comes from comment and short-video feeds. Step 4 shows best what Bayesian updating means: memory’s “9 rejections, 1 acceptance” gives an expected rejection rate of about 0.83; of 10 deliberately open proposals, only 3 were rejected; combining the two lowers the expectation to 0.59, and the experiment alone gives 0.33. Memory itself is a biased input, which is why records must be written when events happen, not recalled afterwards.

Note

The contrast in step 2 cannot be read directly as cause: people often guard first in situations where they already sense rejection, so “rejected after guarding” may partly reflect the situation itself. The micro-experiment in step 4 matters precisely because it takes the choice of move out of the hands of the premonition, and so separates cause from selection. This audit is a tool for self-observation, not a psychological assessment; if the records reveal serious distress or harm, please seek professional help.

Part 2 A pre-registered trial

Question

Compared with a conventional reading-and-lecture course matched for time and instructor effort, does a structured cognitive sandbox and card-simulation workshop increase adults’ directed exploration in uncertain decisions?

Design

Element Specification
Participants Adults aged 18–65 recruited from the public (not from the author’s course participants or community); excluded: people currently in psychiatric treatment or psychotherapy, with a diagnosed gambling disorder, or who attended a similar workshop in the past month
Design Two-arm parallel randomised controlled trial; individuals are randomised and then taught in groups of 12; analysis accounts for clustering by group
Sandbox arm Two 3-hour sessions of structured sandbox and card simulation: situation, role and constraint cards; play out a decision’s consequences by the rules; small-group discussion; design one low-risk micro-experiment for daily life
Control arm Two 3-hour sessions of reading and lectures on the same topics (prediction, priors, exploration and exploitation), with reading material, lectures and small-group discussion, but no simulation or micro-experiment
Instructors The same instructors teach both courses from pre-written manuals and take no part in any measurement
Primary outcome The directed-exploration parameter (information bonus) fitted to the Horizon task one week after the course (Wilson et al. 2014), with the baseline value as covariate
Secondary outcomes Random-exploration parameter; net score over the last 40 choices of the Iowa Gambling Task (Bechara et al. 1994); task-switching cost (Monsell 2003); directed-exploration parameter at three months; self-reported number of new approaches tried in daily life
Blinding Participants know which course they attend and cannot be blinded; all measures are computer-administered, the research assistants running measurement sessions and the analysts are blind to arm, and the analysis code is fixed before unblinding
Analysis Linear mixed model (group as random effect); primary outcome tested two-sided at α=0.05\alpha = 0.05; secondary outcomes reported with confidence intervals, not as confirmatory tests

Changes made to the design

The original brief called for a double-blind trial. Here it becomes single-blind (assessors and analysts blind): participants inevitably know whether they are playing card simulations or listening to lectures and cannot be blinded. Using tasks that a computer administers and scores goes a long way toward making up for this.

The primary outcome is the directed-exploration parameter from the Horizon task rather than the Iowa Gambling Task. The Iowa Gambling Task is widely used in clinical research, but its score mixes learning, risk preference and exploration, and its construct validity has been questioned (Buelow and Suhr 2009); the Horizon task was designed precisely to measure directed and random exploration separately (Wilson et al. 2014). The Iowa Gambling Task is kept as a secondary outcome.

Both courses run in groups, and outcomes of members of the same group are correlated, so the sample size must be multiplied by a design effect and the analysis must account for clustering (Campbell et al. 2012).

Sample size

Calculation

# Sample size for a two-arm parallel trial. Primary outcome: the directed-exploration parameter
# (information bonus) fitted to the Horizon task (Wilson et al. 2014), one week after the course,
# analysed by ANCOVA adjusting for the baseline value. Effect expressed in baseline SD units.
import math
from statistics import NormalDist
N = NormalDist()

def n_per_arm(d, r=0.5, alpha=0.05, power=0.90):
    """Normal approximation; ANCOVA on a baseline correlated r with the outcome shrinks the
    variance by (1 - r^2)."""
    za, zb = N.inv_cdf(1 - alpha / 2), N.inv_cdf(power)
    return math.ceil(2 * (za + zb) ** 2 * (1 - r ** 2) / d ** 2) + 1

def power(n, d, r=0.5, alpha=0.05):
    za = N.inv_cdf(1 - alpha / 2)
    return N.cdf(d / math.sqrt(2 * (1 - r ** 2) / n) - za)

for d in (0.3, 0.4, 0.5):
    print(f"standardised effect {d}: {n_per_arm(d, power=0.80)} per arm for 80 % power, {n_per_arm(d)} for 90 %"
          f" (baseline-outcome correlation 0.5)")
print(f"if the correlation is only 0.3, effect 0.4 needs {n_per_arm(0.4, r=0.3)} per arm for 90 %")
# Both courses are taught in groups of 12, so outcomes within a group are correlated (ICC assumed 0.02).
de = 1 + (12 - 1) * 0.02
n = math.ceil(n_per_arm(0.4) * de)
print(f"design effect for groups of 12, ICC 0.02: {de:.2f} -> {n} completers per arm "
      f"(power without clustering would be {power(n, 0.4):.0%}); recruit {math.ceil(n / 0.85)} per arm allowing 15 % loss")
# standardised effect 0.3: 132 per arm for 80 % power, 177 for 90 % (baseline-outcome correlation 0.5)
# standardised effect 0.4: 75 per arm for 80 % power, 100 for 90 % (baseline-outcome correlation 0.5)
# standardised effect 0.5: 49 per arm for 80 % power, 65 for 90 % (baseline-outcome correlation 0.5)
# if the correlation is only 0.3, effect 0.4 needs 121 per arm for 90 %
# design effect for groups of 12, ICC 0.02: 1.22 -> 122 completers per arm (power without clustering would be 95%); recruit 144 per arm allowing 15 % loss

For a smallest worthwhile effect of 0.4 standard deviations, a baseline–outcome correlation of 0.5 and 90 % power, each arm needs 100 people; with a design effect of 1.22 for groups of 12 and an intraclass correlation of 0.02, each arm needs 122 completers, and allowing 15 % loss, 144 recruits, that is 12 groups per arm. The baseline–outcome correlation and the intraclass correlation are assumptions that will be checked in a 24-person pilot; if the baseline–outcome correlation is below 0.4, the sample size will be recalculated before the main trial starts.

Decision rule

Calculation

SESOI = 0.4     # smallest effect worth acting on, in baseline SD units of the directed-exploration parameter

def verdict(d, lo, hi):
    """d = sandbox-workshop arm minus reading-lecture arm (ANCOVA, standardised) with its 95 % CI.
    Positive = more directed exploration. Fixed before any data are seen."""
    if lo >= SESOI:
        v = "more directed exploration, at least the smallest worthwhile effect"
    elif lo > 0:
        v = "more directed exploration; size not shown to reach 0.4"
    elif hi < 0:
        v = "less directed exploration than the reading-lecture course"
    elif lo >= -SESOI and hi <= SESOI:
        v = "no difference worth acting on"
    else:
        v = "unclear"
    return f"effect {d:+.2f} ({lo:+.2f} to {hi:+.2f}): {v}"

# Invented results, to show in advance how the trial will be reported.
for res in ((0.15, -0.13, 0.43), (0.62, 0.42, 0.82), (0.05, -0.20, 0.30)):
    print(verdict(*res))
print("Secondary outcomes (random-exploration parameter, Iowa Gambling Task net score,")
print("task-switching cost) are reported with intervals but cannot make the trial positive.")
# effect +0.15 (-0.13 to +0.43): unclear
# effect +0.62 (+0.42 to +0.82): more directed exploration, at least the smallest worthwhile effect
# effect +0.05 (-0.20 to +0.30): no difference worth acting on
# Secondary outcomes (random-exploration parameter, Iowa Gambling Task net score,
# task-switching cost) are reported with intervals but cannot make the trial positive.

The example results are invented, to show in advance how results will be reported. The report will say that the sandbox arm produced a worthwhile increase only if the lower confidence limit reaches 0.4; when the interval spans 0.4, the conclusion is “unclear”.

What this trial cannot show

The trial compares one two-session workshop with one lecture course, and its outcomes are behavioural parameters in laboratory tasks. Even a positive result would not show that the workshop changed recurring patterns in participants’ lives, that it helps people with psychological distress or trauma, or that it can replace psychotherapy. The link between exploration parameters in laboratory tasks and everyday behaviour itself needs research; the three-month follow-up and the self-reported new approaches are only first clues.

Ethics and conflicts of interest

The trial must be approved by an independent ethics committee, obtain written informed consent, and register its protocol and analysis plan before the first participant is enrolled (Chan et al. 2013; Nosek et al. 2018). Participants are paid for their time; scores in the tasks involve no real-money gambling; participants may withdraw at any time. If a participant shows marked distress in a workshop, the instructor pauses according to the protocol and refers them to a professional.

Disclosure

The author uses this book as the methodological basis of his community cognition courses, 5D Ascension Cards (Dimensional Shift Card Decks) and the Yafu AI knowledge base, and so has a direct commercial interest in its subject and in the result of the Chapter 8 trial. The book promotes no course, card deck or product and makes no health or therapeutic claim; the trial is designed to be run and analysed by researchers independent of the author’s business; all the code and the study protocol are published openly for anyone to check. To limit the influence of this interest: participants are not recruited from the author’s students; the manuals for both courses are published before enrolment; and the results, data and code will be published whatever they show.

References

Bechara, Antoine, Antonio R. Damasio, Hanna Damasio, and Steven W. Anderson. 1994. “Insensitivity to Future Consequences Following Damage to Human Prefrontal Cortex.” Cognition 50 (1–3): 7–15.
Buelow, Melissa T., and Julie A. Suhr. 2009. “Construct Validity of the Iowa Gambling Task.” Neuropsychology Review 19 (1): 102–14.
Campbell, Marion K., Gilda Piaggio, Diana R. Elbourne, and Douglas G. Altman. 2012. “Consort 2010 Statement: Extension to Cluster Randomised Trials.” BMJ 345: e5661.
Chan, An-Wen, Jennifer M. Tetzlaff, Peter C. Gøtzsche, et al. 2013. “SPIRIT 2013 Explanation and Elaboration: Guidance for Protocols of Clinical Trials.” BMJ 346: e7586.
Monsell, Stephen. 2003. “Task Switching.” Trends in Cognitive Sciences 7 (3): 134–40.
Nosek, Brian A., Charles R. Ebersole, Alexander C. DeHaven, and David T. Mellor. 2018. “The Preregistration Revolution.” Proceedings of the National Academy of Sciences 115 (11): 2600–2606.
Wilson, Robert C., Andra Geana, John M. White, Elliot A. Ludvig, and Jonathan D. Cohen. 2014. “Humans Use Directed and Random Exploration to Solve the Explore–Exploit Dilemma.” Journal of Experimental Psychology: General 143 (6): 2074–81.

Fan, Y. (2026). The Sandbox, Determinism and Active Inference: Markov Blankets, Variational Free-Energy Minimisation, Exploration-Exploitation Trade-offs and East Asian Causality in Computational Neuroscience [沙盘、宿命与主动推理] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23738794 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).