5D Library › The Sandbox, Determinism and Active Inference · 中文
Preface: Why Fall into the Same Trap Twice
Note
Please read this first. This book discusses predictive processing and active inference from computational neuroscience and illustrates them with simplified mathematical models and programs. It is not psychotherapy and not a psychological diagnosis. What it says about “old priors driving repeated setbacks” is a hypothesis and a cross-disciplinary analogy, not an established clinical finding, and it never implies that people who have suffered trauma, abuse or misfortune are responsible for what happened to them; much misfortune is not caused by the person it befalls. If you are in distress, have a history of trauma, or find yourself repeatedly in situations that harm you, please contact a qualified mental-health professional; if there is a risk of harm to yourself or others, contact your local emergency service or crisis line now.
Some people say their life feels as if it follows a script: a new city, a new job, a new partner, and the same conflict and the same disappointment play out again. Folk language calls this fate. Others find that at some point the script loosens: in the same surroundings they choose differently and get different results.
This book examines that experience with a family of theories from computational neuroscience. These theories treat the brain as a prediction machine: it uses prior beliefs, formed by the past, to predict its sensory input, and it works to keep the prediction errors small. There are two ways to shrink an error: change the belief, or act so that the world comes to match the prediction. The second way is “active inference”. The book’s central question is this: when a person’s prior is strong and pessimistic, can active inference lead them, through their own actions, to turn the pessimistic expectation into reality? And if so, what can break the loop?
What this book is and is not
This is a book of models and reviews. Each chapter first presents a published theory or study and then runs it as a short Python program, so readers can change the numbers and see what happens. Unless a source is given, the numbers in the programs are illustrative: they show how an argument works, not a measurement of any person. Whenever a model from physics, information theory or reinforcement learning is applied to human mind and behaviour, the book treats it as a cross-disciplinary analogy or simplified model: the model can show whether a mechanism is logically possible and what conditions it needs, but not that the mechanism is what actually happens in a particular person.
Several of the ideas behind this book turned out, when checked, to be weaker or more complicated than first stated. For example, “over-exploitation inevitably locks a person into a local trap” should read “locks them in with substantial probability”; “curiosity is the only mathematical route to the global optimum” is false, since random exploration, optimism and Thompson sampling are all valid ways to explore; and chaotic dynamics does not prove free will. Each chapter says so where it happens, and the editorial notes collect these corrections.
How to read the boxes
As in other 5D Library books, different kinds of statement are marked separately.
Evidence
Evidence boxes report published findings, with sources.
Calculation
Calculation boxes give formulas and short Python programs. Every program runs as printed in a standard Python 3 installation with no other software, and its actual output is printed beneath it.
Hypothesis · not established
Hypothesis boxes contain the author’s ideas, marked “not established”, with a statement of what result would show them wrong.
Source text
Source text boxes quote classical texts, with the author’s plain-language explanation.
Note
Note boxes give cautions and explain choices.
Plan of the book
- The Bayesian brain and self-fulfilling prophecy. How priors, precision and evidence combine into belief, and how behavioural confirmation can sustain a false expectation.
- Two routes. Variational free energy; how a simplified active-inference agent with a pessimistic prior keeps choosing the same trap, and how low-stakes trials can free it.
- Markov blankets. The statistical boundary between “me” and the environment, its mathematical meaning, the dispute around it, and how changing the source of input affects both the internal state and the world.
- Exploration and exploitation. Multi-armed bandits, upper confidence bounds, Thompson sampling, simulated annealing and information gain.
- The sandbox. Why low-stakes simulated environments might help rewrite priors: evidence on psychological safety, stress and over-exploitation, and a temperature-parameter model.
- Determinism and chaos. The Lorenz attractor, the Lyapunov exponent and the predictability horizon, and what they do and do not say about agency.
- Source texts. Yuan Huang’s Four Lessons of Liaofan, the Yogācāra notions of seeds and perfuming, and the Śūraṅgama Sūtra’s “if one can turn things”, read beside active inference.
- Practice and a pre-registered trial. A four-step Bayesian audit, and a pre-registered randomised controlled trial comparing a structured sandbox workshop with conventional reading and lectures.
About this edition
This is version 1.0.0, the first complete edition: a preface and eight chapters in Chinese and English. Corrections and missing references are welcome through the 5D Library website.
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.
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).