> Paper: Affinity Is Not Enough: Recovering the Free Energy Principle in Mixture-of-Experts > Author: Man Yung Wong > arXiv: 2605.00604 | 2026-04-30
1. The MoE Model That "Stutters" at Domain Switches
Imagine a sparse Mixture-of-Experts (MoE) model:
- 4 experts, each handling a different domain of knowledge
- Current token is medical content → routed to the medical expert
- Next token suddenly becomes legal content → should switch to the legal expert
- Standard affinity routing: probability of correct expert = 0.006 (0.6%)
- Number of experts needed for 99% coverage: infeasible
- Different experts handle different subtasks/domains
- A routing network decides which experts to activate
- Enables conditional computation and improves efficiency
- Standard routing is stateless
- Each token is decided independently
- The router doesn't know "the previous token belonged to another domain"
- It only measures affinity between the current token and each expert
- The switching token itself may be ambiguous
- Affinity can't distinguish old vs. new domain
- Guaranteeing coverage requires activating many experts
- Sparsity advantage is lost
- Computational efficiency drops
- Biological systems perceive and act by minimizing "free energy"
- Free energy has two parts:
- Accuracy: match between prediction and observation
- Complexity: complexity of the prediction itself (prior constraints)
- High precision + low complexity = good cognition
- Each expert maintains a "membrane potential"
- It accumulates routing context
- Recently activated experts gain higher potential
- This creates "inertia" — keep the current expert unless there's a strong switching signal
- Each expert estimates the "precision" (inverse variance) of its predictions
- High-precision experts receive higher gating weight
- This implements the accuracy term of free energy
- Limits the "complexity" of expert switches
- Avoids excessive switching
- Implements the complexity term of free energy
- Correct-expert probability: 0.6% → 74.8% (a 124x improvement!)
- Experts needed for 99% coverage: infeasible → a small constant
- Purely engineering-driven solutions
- Ignores cognitive-science insights
- Fails at boundary cases
- The brain genuinely has membrane-potential mechanisms
- Neurons show inertia — recently active ones are more easily reactivated
- The brain really does minimize prediction error (free energy)
- Not blind trial-and-error over routing strategies
- Design is guided by a theoretical framework
- We know "why" it works
- The Free Energy Principle is a general framework
- Applicable beyond MoE
- Can guide the design of other AI systems
- AI progress is not only an engineering problem
- It is also a scientific one
- Understanding the nature of intelligence matters more than stacking more parameters
The problem: standard routing gives the correct expert only 0.6% probability!
In a controlled experiment (4 experts, 5 repetitions):
Why? Standard routing only looks at the current token, not the context.
2. Domain Switching: MoE's Achilles' Heel
The core idea of MoE:
But the weakness appears at domain switches:
1. No memory
2. Affinity is not enough
3. Expert count blows up
3. From the Free Energy Principle to MoE Routing
The paper draws on the Free Energy Principle (Friston, 2006):
Applied to MoE routing:
1. Temporal Memory (β)
2. Precision-Weighted Gating (Pi)
3. Complexity Regularization
Results:
It's like giving MoE routing short-term memory: not just the current token, but a memory of "what we were just doing" — switching only on strong evidence.
4. Why Neuroscience-Inspired Design Is So Powerful
Standard MoE problems:
Advantages of the Free Energy Principle:
Biological plausibility:
Theoretical guidance:
Generalizability:
5. A Feynman-Style Judgment: Good Engineering Learns from Nature
As Feynman put it:
> "Nature always seems to do things the simplest way. If two systems converge to the same solution, there must be a deep reason behind it."
In MoE routing:
> "The routing strategy the brain evolved over millions of years is strikingly similar to what we need in MoE. That's not coincidence — it's a deep law of cognition. Learning from neuroscience is more efficient than blindly searching engineering space."
This reminds us:
6. Takeaways
If you're building MoE or conditional-computation systems, ask yourself:
1. Does my router have memory — or does it only see the current input? 2. How does my system behave at domain switches? 3. Can neuroscience insights improve my design? 4. Can a theoretical framework (like the Free Energy Principle) guide engineering decisions?
The paper's core lesson: the best AI engineering doesn't invent from scratch — it learns from nature.
When MoE routing meets the Free Energy Principle, we gain not only a better algorithm but a deeper understanding — of the nature of intelligence, the art of prediction, and the wisdom of choosing in a complex world.
At the intersection of AI and neuroscience, the best innovations often come from the dialogue between the two.