Introduction
Active Inference, a framework rooted in theoretical neuroscience, suggests that biological agents act to minimize "free energy"—a mathematical proxy for the surprise or uncertainty encountered in their environment. While conceptually powerful, traditional implementations of Active Inference have often been restricted to discrete, manually engineered state spaces, limiting their applicability to complex, high-dimensional tasks. This paper bridges the gap between neuroscience and practical machine learning by introducing Deep Active Inference, an approach that leverages deep neural networks to learn continuous latent representations and transition models from scratch.
The Deep Active Inference Framework
The authors propose an agent architecture composed of three primary neural network components that allow it to perceive and navigate its environment without prior knowledge of the underlying physics:
- Transition Model ($p_\theta$): This network predicts the future latent state based on the current state and a chosen action.
- Likelihood Model ($p_\xi$): Acting similarly to a decoder in a Variational Autoencoder (VAE), this model maps internal latent states back to expected sensory observations.
- Approximate Posterior ($p_\phi$): This encoder network infers the current hidden state by integrating the previous state, the last action taken, and the most recent sensory observation.
By combining these components, the agent can maintain a "belief" about its environment, even when sensory data is noisy or incomplete.
Objectives: Learning and Planning
The agent’s behavior is governed by two distinct but related objectives: Variational Free Energy and Expected Free Energy.
Learning via Variational Free Energy (VFE)
To learn the world model, the networks are trained by minimizing Variational Free Energy (VFE). This objective is mathematically equivalent to the evidence lower bound (ELBO) used in VAEs. Minimizing VFE ensures that the agent’s internal model is both accurate (it explains the observations) and parsimonious (it avoids overcomplicating the latent space).
Planning via Expected Free Energy (G)
For decision-making, the agent evaluates potential future policies by calculating Expected Free Energy (G). Unlike standard Reinforcement Learning (RL), which typically maximizes a scalar reward, Active Inference treats planning as an inference problem. The agent has a "preferred" prior belief (e.g., "I believe I am at the goal state") and selects actions that make this belief a reality.
The objective $G$ naturally decomposes into two terms:
- Goal-Seeking (KL Divergence): A term that drives the agent toward its preferred states.
- Information Gain (Entropy): A term that encourages the agent to visit states that reduce its uncertainty about the environment.
To balance these, the authors introduce a scaling hyperparameter, $\rho$, which tunes the trade-off between exploitation (reaching the goal) and exploration (resolving uncertainty).
Experimental Evaluation: The Mountain Car Benchmark
The framework was tested on the classic Mountain Car problem, where an underpowered car must gain momentum by driving back and forth to reach a hilltop. To increase difficulty, the authors provided only noisy 1D position sensors, forcing the agent to infer the hidden velocity state from sequences of observations.
Key Results
- Latent State Discovery: The model successfully learned a 4-dimensional latent space that captured the essential physics of the environment (position and velocity) directly from noisy data.
- Robust Planning: By unrolling its learned model 90 timesteps into the future using Monte Carlo sampling, the agent successfully navigated the valley to reach the goal.
- Behavioral Tuning: The $\rho$ parameter proved critical for performance. When $\rho > 1$, the agent acted "greedily," often failing because it rushed toward the goal without sufficient certainty. Conversely, with $\rho = 0.1$, the agent adopted a "cautious" policy, moving backward to gain momentum and ensuring a predictable, successful path to the summit.
Discussion and Future Work
Deep Active Inference offers a compelling alternative to traditional RL by building intrinsic motivation (curiosity) directly into the objective function. However, several challenges remain. The current planning method—unrolling search trees—is computationally expensive. Future iterations may use "amortized" policies, where a separate network is trained to predict optimal actions instantly.
Additionally, while the Mountain Car environment demonstrates the framework's viability, scaling to high-dimensional inputs like camera images or LiDAR remains a primary goal. Finally, defining "preferred states" currently relies on expert demonstrations; developing more flexible ways to define goals will be essential for autonomous scaling in real-world robotics.
Summary updated