← LearnWorkbench ▸·Path:

LAPLACE TOWER

A mechanical sandbox for Box 4.3, generalized predictive coding, hierarchy coupling, and action. It uses a quadratic free-energy objective with precision-weighted prediction errors, a Laplace-style local Gaussian approximation, generalized-coordinate shift operator D, and continuous-time style belief updates. You can start simple, then add levels and orders to build your own hierarchy and keep extending it.
Standalone HTML

Preset Bay

Load a teaching world, then alter the hierarchy. Presets range from one-layer intuition to multi-level predictive coding with action.

Hierarchy Builder

Structure

Levels represent the vertical hierarchy. Orders are generalized coordinates within each level.

Engine

Belief updates descend the numerical gradient of the same free energy displayed on screen.

Global parameters

lr μ
lr u
sensory target
base input
act gain

Editable Levels

Each level has linear generative maps so the message passing stays readable. Higher levels predict the hidden causes of the level below.

Session Log

F total
0.000
target pending
Fy
0.000
½ Πy εy²
Fx
0.000
dynamics
Fv
0.000
hierarchy
action u
0.000
y=base+gain·u
shape
1×2
levels × orders
GoalBuild a predictive-coding hierarchy and drive F below the preset's target.
WatchThe tower canvas — μ and ε nodes stack by order on each level.
First moveClick Belief step repeatedly. When beliefs settle, try Action step. Only then Add level.

Machine Status

Total F
0.000
Observation term
0.000
½ Πy εy²
Dynamics term
0.000
Σ ½ Πx ||εx||²
Hierarchy term
0.000
Σ ½ Πv ||εv||²
Action
0.000
y(u)=base+gain·u

Hierarchy Machine

Builder Notes

ConceptHere in the simulator
Laplace approximationQuadratic free energy around current posterior mode μ, with Gaussian-form local approximation.
PrecisionScales how costly each prediction error is.
D operatorShifts generalized coordinates upward: Dμ[k] = μ[k+1].
εxWithin-level temporal/dynamical mismatch: Dμx − f(μx,μv).
εvBetween-level mismatch: μv(lower) − g(upper).
εyLowest-level sensory mismatch y(u) − g(lower).
ActionMoves only sensory data, following equation 4.22’s logic.

Layered Equation Panel

Beat Script