We often use the metaphor of the market as a "collective brain" or "super-organism." We talk about the "market's beliefs" or how it "panics." This is usually just a poetic shorthand. But what if it's not? What if the mathematics that describes a single, goal-directed agent (like a brain) is genuinely the same mathematics that describes a collection of agents (like a market), just with different settings?
This post sketches a framework called the Typed Free Energy Game (TFEG) that attempts to make this claim mathematically precise. The goal is to build a single formal object that sees a brain as a "game with one player" and a market as a "game with many players," all following the exact same underlying rules.
This isn't just for philosophical kicks. If true, it would give us a powerful new tool: a single "potential function" that we could, in principle, measure for the entire economy—a kind of economic "potential energy" whose gradients could predict market movements and volatility.
Let's start with one agent. Modern theories in neuroscience, particularly Karl Friston's Active Inference, model the brain as a prediction machine. The core idea is simple:
- You have an internal generative model of how the world works (
$p_\theta$ ). This model generates predictions about what you expect to see and feel. - You constantly receive sensory data (
$s$ ) from the world. - You want to minimize surprise (or "prediction error"). Surprise is the gap between what you expected and what you got.
You can minimize surprise in two ways:
- Perception (Update your beliefs): If you see something unexpected, you can change your mind about what's causing it. "I thought that noise was the wind, but it was a cat. I'll update my beliefs."
- Action (Change the world): If you see something unexpected, you can act to make the world match your predictions. "My hand feels cold, which is surprising. I'll move it into the sunlight to make it warm, fulfilling my prediction of being warm."
This entire process is driven by minimizing a quantity called Variational Free Energy (
Minimizing this free energy makes your beliefs a better explanation of reality, and makes your actions shape reality to fit your beliefs. The entire brain, under this view, is an engine built to do one thing: slide downhill on the landscape of its own free energy.
Now, let's look at a market. We have many agents (
- Beliefs: A private model of a stock's future cash flows.
- Goals: A desire to make money, balanced by their risk aversion.
- Actions: Placing buy or sell orders.
The standard way to model this is with Mean-Field Games. The core insight is that an agent in a massive crowd doesn't track every other person. They react to the average behavior of the crowd—the "mean field." You make your best move based on the current price, which is an aggregate of everyone else's actions.
The key tension is that there's no single "market belief." There are millions of conflicting beliefs. The market price is not an opinion; it's the equilibrium point where all these conflicting ambitions and actions temporarily balance out.
Here's the central claim. We can describe the entire market using a single, global free energy function. We construct it by simply taking a weighted sum of the individual free energies of all agents.
Let's define the Population Free Energy
Here,
-
For a single brain: We can think of it as one agent, so
$I = {1}$ and$\mathbf{W}(1)=1$ . The population free energy$\mathcal{F}$ is just the individual free energy$F$ . The math reduces perfectly. -
For a market: This is where it gets interesting. What is an agent's "power" in a market? It's their capital. We can propose that the weighting function
$\mathbf{W}(i)$ is proportional to an agent's wealth.
This gives us the "money = power" principle in a precise, mathematical form. The market's collective objective function
Once we have this global
-
Belief Updates (Perception): Each agent updates their beliefs to reduce the global
$\mathcal{F}$ .$\dot{\mu}_i \propto -\nabla_{\mu_i} \mathcal{F}$ (My beliefs flow down the gradient of collective free energy.)
-
Order Placement (Action): Each agent chooses actions (orders) to reduce the global
$\mathcal{F}$ .$\dot{a}_i \propto -\nabla_{a_i} \mathcal{F}$ (My actions flow down the gradient of collective free energy.)
Remarkably, these simple gradient flows on our proposed
This unification isn't just an elegant mathematical curiosity. It solves several long-standing problems and offers new, testable predictions.
| Old Problem / Fuzzy Analogy | TFEG Resolution: A Concrete Mechanism |
|---|---|
| "The market has no single mind or belief." | Correct. We don't merge beliefs. Each agent |
| "What's the difference between exploring and exploiting?" | We can give actions a type. A limit order is an inspect action: you're placing a cheap bet to gather information about market sentiment. A market order is an enact action: you're paying a premium to force a change. Both serve to minimize the same |
| "There is no 'potential energy' for market prices." | We claim there is: it's |
The most exciting payoff is the last one. If
-
Estimate
$\mathcal{F}$ online from high-frequency order book data. -
Measure its gradient
$|\nabla \mathcal{F}|$ . This value would represent how "out of equilibrium" or "tense" the market is. - Use this as an early-warning signal. A sharp increase in the "tension" metric could predict an imminent volatility spike or market correction, long before prices themselves show a clear signal.
This is a proposal, not a finished theory. The immediate next steps are to prove its core claims:
-
Build a Toy Model: Show that for a classic, simple market model (like the Kyle model), the standard equations really do emerge from our global
$\mathcal{F}$ . -
Prove It: Formally mechanize the proof in a system like Coq to certify that
$\mathcal{F}$ is a true Lyapunov function. -
Test It: Apply this to real financial data. Does the gradient of our estimated
$\mathcal{F}$ actually predict volatility?
By lifting brains and markets into this shared mathematical framework, we get more than just a better metaphor. We get a single optimization principle, a single potential function to measure, and a single framework for building and testing models of complex adaptive systems.
Idea generation w/ o4-mini-high, rewriteup with Gemini 2.5. Looks like an interesting idea but needs more investigation to confirm it.