DEV Community

ORCHESTRATE
ORCHESTRATE

Posted on

Active Inference — The Learn Arc, Part 40: Session §8.1 — Generalized coordinates

Session 8.1 — Generalized coordinates

Series: The Learn Arc — 50 posts through the Active Inference workbench.
Previous: Part 39 — Session §7.5: Worked example

Hero line. Generalized coordinates replace the single state s_t with a tower: s, s', s'', s''', … The belief is over the state and all of its derivatives at an instant. That is what makes continuous-time inference tractable.


Why a tower

Discrete-time active inference gets a free lunch: every t gives you a fresh observation, and Eq 4.13 is a single softmax. In continuous time there is no clean tick. You need a representation that captures both where the state is and where it is heading at the same moment.

Generalized coordinates solve this. Instead of s_t, the agent carries (s, s', s'', s''', …) — position, velocity, acceleration, jerk, and so on — as its instantaneous estimate. The gaussian prior binds them together with a characteristic smoothness.

Five beats

  1. Generalized state = position + derivatives. The belief is a multivariate gaussian over (s, s', s'', …). One instant, many orders. No lookback needed.

  2. The generative model becomes differential equations. Instead of s_{t+1} = B · s_t, the dynamics become s' = f(s) + noise. The agent's belief propagates forward by integrating — not by multiplying a transition matrix.

  3. Truncation is a modelling choice. Real physics has infinitely many derivatives. In practice you keep 2–6 orders. The order you keep controls how smooth the trajectory you can track is.

  4. Precision matrix encodes smoothness. The prior over (s, s', s'', …) has a structured precision matrix whose shape says "derivatives are correlated this way." This is where colored noise enters the framework cleanly.

  5. Eq 4.13 becomes a gradient descent. The variational free energy F now has continuous gradients in s, s', s'', …. The update rule is ds/dt = -∂F/∂s + s', and similarly up the tower. Perception becomes smooth descent on F, not a discrete softmax.

Why it matters

Continuous time is not a cosmetic change — it is what lets Active Inference talk to control theory, to Kalman filters, and to predictive coding in the cortex. Generalized coordinates are the bridge. Once you accept "belief over state and all its derivatives at one moment," the rest of Chapter 8 falls into place.

Quiz

  • Why do you need at least second-order derivatives to track a trajectory with acceleration?
  • What does the precision matrix's off-diagonal structure encode?
  • In generalized coordinates, what has replaced the role of B from the discrete chapter?

Run it yourself

mix phx.server
# open http://localhost:4000/learn/session/8/s1_generalized_coords
Enter fullscreen mode Exit fullscreen mode

Cookbook recipe: continuous/gencoord-tracker — a toy 1-D tracker in continuous time. Watch the belief's first and second derivatives separately as the target maneuvers. Follow it with the laplace-tower lab (linked from the session) to see the tower visually.

Next

Part 41: Session §8.2 — Eq 4.19, the quadratic free energy. The continuous-time twin of Eq 4.13. A quadratic approximation to F in generalized coordinates gives a closed-form gradient and turns the agent into a predictive-coding network at the equations level.


Powered by The ORCHESTRATE Active Inference Learning Workbench — Phoenix/LiveView on pure Jido.

Top comments (0)