Foundational Tutorial & Technical Guide
Active Inference & The Free Energy Principle: A Practical Tutorial
Active Inference is a framework for modeling perception, learning, and action with probabilistic generative models. Its applications depend on specific assumptions and implementations. The Free Energy Principle motivates the framework; a model's mathematical consistency does not itself establish its empirical adequacy.
What Is a Generative Model?
A generative model specifies how hidden states give rise to observations and how states change. In discrete-state formulations, an A matrix commonly encodes observation likelihoods, B matrices encode transitions, C encodes preferences over outcomes, and D encodes initial-state beliefs. These conventions are described in Parr, Pezzulo and Friston's Active Inference (2022, MIT Press).
How Do Variational and Expected Free Energy Differ?
Variational free energy is evaluated for observed data and an approximate posterior. Its complexity-minus-accuracy form provides a bound on negative log model evidence. Minimization finds the best approximation within the chosen family; it need not recover the exact posterior. Expected free energy evaluates possible future outcomes under policies and can include preference satisfaction and information-seeking terms. See the textbook above for definitions and assumptions.
How Does Active Inference Compare With Reinforcement Learning?
Both frameworks study action under uncertainty. Reinforcement learning includes model-based and information-seeking methods as well as model-free methods. Active Inference commonly expresses goals as prior preferences and evaluates policies using expected free energy. Neither formulation guarantees sample efficiency, prevents reward hacking, or ensures safe behavior outside its tested setting.
What Is a Markov Blanket?
A Markov blanket expresses a conditional independence: internal and external states are conditionally independent given blanket states. A sensory/active partition adds modeling assumptions. This structure alone is not proof of consciousness or agency. For the original research article, see Sakthivadivel, A worked example of the Bayesian mechanics of classical objects (2022).
A Worked Example of the Bayesian Mechanics of Classical Objects (Sakthivadivel et al., 2022) catalogs associated discussion transcripts, rather than the original research article. The transcript contributors and the original article's sole author have distinct citation roles.
Which Tools and Research Projects Are Available?
Towards Lean 4 Formalization of the Free Energy Principle: AI-Driven Theorem Sketching and Verification for Active Inference and Bayesian Mechanics (Friedman, 2026) describes formalization work whose proofs apply to stated definitions and assumptions. Compilation does not establish the Free Energy Principle as a physical theory. Generalized Notation Notation for Active Inference Models (Smékal & Friedman, 2023) concerns model notation; CEREBRUM: Case-Enabled Reasoning Engine with Bayesian Representations for Unified Modeling (Friedman, 2025) explores case-based representations for modeling.
Repositories include fep_formal, Generalized Notation Notation, RxInfer.jl, and pymdp. RxInfer is a probabilistic programming engine; using it in an Active Inference model requires specifying that model.
Where Can I Study Active Inference?
The Active Inference Institute provides study groups, recordings, and research resources. The textbook line comprises nine completed cohorts for the 2022 Parr, Pezzulo and Friston monograph and a live first cohort for Namjoshi's Fundamentals of Active Inference (2026). See the video archive and domain index for materials and publication types.
References
- Sakthivadivel, Dalton AR; Rahmjoo, Ali; Smékal, Jakub; Friedman, Daniel. 2022. A Worked Example of the Bayesian Mechanics of Classical Objects. Zenodo. Publication source.
- Friedman, Daniel Ari. 2026. Towards Lean 4 Formalization of the Free Energy Principle: AI-Driven Theorem Sketching and Verification for Active Inference and Bayesian Mechanics. Zenodo. Publication source.
- Smékal, Jakub; Friedman, Daniel Ari. 2023. Generalized Notation Notation for Active Inference Models. Zenodo. Publication source.
- Friedman, Daniel Ari. 2025. CEREBRUM: Case-Enabled Reasoning Engine with Bayesian Representations for Unified Modeling. Zenodo. Publication source.
- Parr, Thomas; Pezzulo, Giovanni; Friston, Karl J. 2022. Active Inference: The Free Energy Principle in Mind, Brain, and Behavior. MIT Press. Publication source.
- Namjoshi, Sanjeev V. 2026. Fundamentals of Active Inference: Principles, Algorithms, and Applications of the Free Energy Principle for Engineers. MIT Press. Publication source.
- Sakthivadivel, Dalton A. R. 2022. A Worked Example of the Bayesian Mechanics of Classical Objects. arXiv:2206.12996. Publication source.
Frequently Asked Questions
What is Active Inference in simple terms?
It models agents as updating beliefs about their surroundings and selecting actions using a generative model and preferences over outcomes.
Does minimizing variational free energy recover the true posterior?
Only if the model, approximation family, and optimization permit it. In general, inference is approximate.
Does Active Inference guarantee safe AI?
No. Safety and performance claims require evaluation of the particular model, implementation, environment, and threat assumptions.
Where are the sources?
The textbooks, original Bayesian mechanics article, related publications, and discussion materials are listed in the References section.