← Back to Catalog
Chapter 2: The Low Road
1

Perception as Inference

Welcome to the Low Road to Active Inference. This tutorial demonstrates how perception works as a form of statistical inference.

"Perception is not a passive outside-in process—in which information is extracted from impressions on our sensory epithelia from 'out there.' It is a constructive inside-out process—in which sensations are used to confirm or disconfirm hypotheses about how they were generated."

— Parr, Pezzulo & Friston (2022)

The brain doesn't passively receive sensations. It actively predicts what it expects to see, then compares these predictions with actual sensory input.

Key Insight

You don't see the world directly. You see your brain's best guess about what's causing your sensations.

2

The Generative Model

Your brain maintains a generative model—a probabilistic representation of how hidden causes in the world produce sensations.

P(y, x) = P(y | x) · P(x)

This model has two components:

Prior P(x)

What you expect to see before any sensory evidence. Your beliefs about what's likely to be "out there."

Likelihood P(y|x)

How sensory observations are generated from hidden states. Given a certain cause, what sensations would it produce?

Try adjusting the Prior Belief slider on the right. Notice how it changes what you "expect" to see.

3

Prediction Error

When your prediction doesn't match your sensation, a prediction error occurs. This is the discrepancy between what you expected and what you observe.

"Consider a person who expects to see an apple. She generates a top-down visual prediction (e.g., about seeing something red and not jumping). This visual prediction is compared with a sensation (e.g., something jumping)—and this comparison results in a discrepancy."

— Chapter 2, Active Inference Textbook

Look at the Prediction Error indicator on the right. It shows the magnitude of the mismatch between your belief and the actual stimulus.

The Problem

Prediction errors are metabolically costly. The brain—and all living systems—are driven to minimize them.

4

Two Ways to Resolve

There are exactly two ways to minimize prediction error:

1. Perception (Update Belief)

Change your mind to fit the world. If you expected an apple but see something jumping, update your belief: "It's a frog!"

2. Action (Change Sampling)

Change the world to fit your mind. Look somewhere else where an actual apple might be. Make your prediction come true.

"The person can resolve this discrepancy in two ways. First, she could change her mind about what she is seeing (i.e., a frog) to fit the world. Second, she could foveate the nearest apple tree and see something that looks very much like an apple."

— Chapter 2, Active Inference Textbook
5

Free Energy

Both perception and action serve the same objective: minimizing variational free energy.

F = D_KL[Q(μ) || P(μ|o)] − ln P(o)

Free energy is an upper bound on surprise. It increases when:

  • Your beliefs diverge from the true state
  • Observations are unexpected under your model

The Fundamental Insight

Living organisms minimize free energy by actively controlling their action-perception loops. This is the "active" in Active Inference.

Watch the Free Energy gauge. It decreases when you successfully resolve prediction errors.

6

Your Turn

Now experiment with the simulation:

Instructions

  1. Set your Prior Belief (what you expect)
  2. Observe the Stimulus (what's actually there)
  3. Note the Prediction Error
  4. Choose: Update Belief or Look Elsewhere
  5. Watch Free Energy decrease

Notice how both strategies reduce prediction error, but in fundamentally different ways:

Perception = Model fits world
Action = World fits model

"A fundamental insight of Active Inference is that both perception and action serve the very same objective."

— Chapter 2, Active Inference Textbook
Sensory Observation
Ambiguous Stimulus
The stimulus morphs between apple and frog

Generative Model Parameters

Prior Belief P(apple) 50%
Expect Frog Expect Apple
Stimulus State (Reality) 50%
Frog Apple
Posterior Belief P(x|y)
Apple
50%
Frog
50%
Prediction Error ε
0.00
Predictions match observations
Variational Free Energy F 0.00
Low (Good) High (Bad)
Action History
No actions yet. Try resolving the prediction error!
Action complete!