← Latest papers
🤖 machine learning

Affinity Is Not Enough: Recovering the Free Energy Principle in Mixture-of-Experts

This paper proposes that standard affinity-based routing in Mixture-of-Experts models fails at domain transitions, and demonstrates that integrating Free Energy Principle-inspired mechanisms—specifically temporal memory, precision-weighted gating, and anticipatory routing—can dramatically improve expert selection accuracy and predictive performance by enabling the model to detect and prepare for distributional shifts before they occur.

Original authors: Man Yung Wong (Russell)

Published 2026-05-04
📖 5 min read🧠 Deep dive

Original authors: Man Yung Wong (Russell)

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are navigating a massive, shifting landscape with a team of four specialized guides (the "Experts"). Your job is to pick the right guide for every step of your journey.

In current AI systems (called Mixture-of-Experts or MoE), the person picking the guides is like a tourist with no map, no compass, and no memory. They only look at the ground directly under their feet right now to decide who to hire.

The paper argues this is a fatal flaw. If you are walking through a forest and suddenly the terrain is about to turn into a desert, a guide who only looks at the current tree under your foot will keep hiring the "forest guide." They won't realize the switch is coming until it's too late.

The author, Russell Wong, suggests we need to upgrade this "hiring manager" using three simple tricks inspired by how the brain works (specifically, the Free Energy Principle). Here is how the paper explains these upgrades using everyday analogies:

1. The Problem: "The Amnesiac Tourist"

Current AI routing is stateless. It forgets everything that happened in the previous 100 steps.

  • The Result: When the AI switches from talking about "cats" to "cars," it often fails to switch experts immediately. In the paper's experiments, at the exact moment of the switch, the AI assigned a 0.6% chance to the correct expert. It was almost completely wrong.
  • The Analogy: It's like a chef who only tastes the spoonful of soup in their mouth right now, ignoring the fact that they just poured in a whole bucket of salt. They can't predict the soup is going to be too salty until it's already ruined.

2. The Solution: Three New Tools for the Hiring Manager

The paper proposes three lightweight changes to fix this.

A. Temporal Memory (The "Backpack")

  • What it is: Instead of looking only at the current step, the system carries a "backpack" (called a membrane potential) that holds a weighted memory of the last few steps.
  • The Analogy: Imagine the hiring manager now carries a backpack. If they've been walking through a forest for 30 minutes, the backpack gets heavy with "forest dust." Even if the ground under their foot looks like a forest, the heavy backpack tells them, "We've been here a long time; we are likely about to leave."
  • The Result: The AI learns to "forget" old information at just the right speed. If the terrain changes fast, the backpack empties quickly. If the terrain is stable, it holds on longer. This alone improved the AI's ability to catch the switch from 0.6% to 30%.

B. Precision-Weighted Gating (The "Trust Score")

  • What it is: The system tracks how reliable each expert has been recently. If an expert keeps making mistakes, the system lowers their "trust score" (precision) and stops listening to them, even if they look like a good fit for the current word.
  • The Analogy: Imagine you have four guides. Guide A is great at forests but terrible at deserts. Guide B is the opposite. The current system hires Guide A just because they are standing in a forest. The new system says, "Wait, Guide A made a huge mistake 5 minutes ago when we were near a desert. I'm lowering their trust score. I'll only hire them if they are 100% sure."
  • The Result: This helps the AI adapt when experts become unreliable. It creates a 31x difference in how much the system trusts a reliable expert versus an unreliable one.

C. Anticipatory Routing (The "Crystal Ball")

  • What it is: The system tries to predict what the next step will look like and hires the expert for that step, not the current one.
  • The Analogy: A normal tourist hires a guide for the path they are on now. An anticipatory tourist looks at the path ahead and hires the guide for the next turn.
  • The Catch: The paper found a secret ingredient. A "crystal ball" doesn't work if the tourist has no memory. If you try to predict the future without remembering the past, you can't tell when a switch is coming.
  • The Magic Combo: When you combine the Backpack (Memory) with the Crystal Ball (Prediction), the system becomes superhuman. The backpack fills up with "forest dust," and the crystal ball reads that saturation to say, "We are full of forest dust; the desert is coming next!"
  • The Result: This combination is super-additive.
    • Backpack alone: +30% improvement.
    • Crystal Ball alone: +0% improvement (it was blind).
    • Backpack + Crystal Ball: +74% improvement.
    • Together, they closed 75% of the gap between the AI and a perfect "Oracle" (a perfect guide).

3. Why This Matters (The "Navigation" Metaphor)

The paper concludes that current AI is just reacting to the present. It's a machine that says, "This word looks like a cat, so I'll use the cat expert."

The new system navigates. It says:

  1. Where have I been? (Backpack/Memory: "I've been in the forest for a long time.")
  2. Who can I trust? (Trust Score: "The desert guide is reliable; the forest guide is tired.")
  3. Where am I going? (Crystal Ball: "The terrain is shifting to desert next.")

The Bottom Line

The paper claims that by adding these three simple, low-cost mechanisms (Memory, Trust, and Prediction), we can stop the AI from getting "lost" at the moments when it matters most: when the topic changes.

In their tests, this upgrade reduced the number of experts needed to get the job done from an impossible number (hundreds) to a tiny, manageable number (3 or 4). It turns a confused tourist into a skilled navigator.

Note: The paper does not claim this fixes all AI problems or applies to medical diagnosis. It strictly focuses on making the "routing" (the decision of which part of the AI to use) smarter during language generation.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →