---
id: wiki-2026-0508-bayesian-brain-hypothesis
title: Bayesian Brain Hypothesis
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [Bayesian brain, predictive coding, free energy principle, active inference, Friston]
duplicate_of: none
source_trust_level: B
confidence_score: 0.85
verification_status: conceptual
tags: [neuroscience, predictive-coding, bayesian, free-energy, friston, active-inference, perception, generative-model]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
  language: neuroscience / cognitive science
  applicable_to: [Active Inference Agents, Perception Models, World Models]
---

# Bayesian Brain Hypothesis

## 📌 한 줄 통찰
> **"매 brain = 매 inference engine"**. 매 incomplete sensor + 매 prior → 매 best guess (posterior). 매 Friston 의 Free Energy Principle 의 unify perception / action / learning. 매 modern world model + active inference 의 theoretical base.

## 📖 핵심

### 매 core claim
- 매 brain = 매 generative model.
- 매 perception = 매 Bayesian inference.
- 매 prior + likelihood → posterior.
- 매 surprise (prediction error) 의 minimize.

### Bayes' theorem (perception version)
$$P(\text{cause} | \text{sensation}) = \frac{P(\text{sensation} | \text{cause}) \cdot P(\text{cause})}{P(\text{sensation})}$$

### 매 evidence
1. **Optical illusion**: 매 prior 의 dominate.
2. **Multisensory integration**: 매 weighted by reliability.
3. **Cocktail party**: 매 prior context 의 segregate.
4. **Phantom limb**: 매 prior 의 mismatch.
5. **Schizophrenia**: 매 prior weighting 의 broken.

### 매 핵심 개념

#### Predictive Coding
- 매 cortex 의 hierarchical prediction.
- 매 top-down prediction + bottom-up error.
- 매 error 만 의 propagate.
- 매 efficient (most signal 의 cancelled).

#### Free Energy Principle (Friston)
- 매 organism 의 environment 의 surprise 의 minimize.
- 매 free energy = upper bound on surprise.
- 매 perception (model 의 update) + action (world 의 change) 의 둘 다.

#### Active Inference
- 매 action = 매 prediction error 의 reduce 의 way.
- 매 motor 의 proprioception 의 prediction.
- 매 RL 의 reward 의 alternative.

#### Markov Blanket
- 매 system 의 외부 / 내부 의 boundary.
- 매 Friston 의 ontological foundation.

### 매 layer (cortical)
- 매 deep layer (5/6): 매 prediction (top-down).
- 매 superficial (2/3): 매 error (bottom-up).
- 매 NMDA / AMPA receptor 의 different role.

### 매 modern AI 의 응용
1. **World models** (Ha & Schmidhuber): 매 generative model 학습.
2. **Active inference agent**: 매 RL 의 alternative.
3. **PILCO / Dreamer**: 매 model-based RL.
4. **Variational autoencoder** (VAE): 매 generative + recognition.
5. **Predictive coding networks** (PredNet, Lotter): 매 NN 구현.
6. **Self-supervised learning**: 매 prediction-based.

### 매 disorder 의 explanation
- **Autism**: 매 high-precision prior (less plasticity).
- **Schizophrenia**: 매 low-precision prior + high error.
- **Anxiety**: 매 over-prediction of negative.
- **Depression**: 매 prior 의 negative bias.

### 매 critique
- **Falsifiability**: 매 거의 모든 것의 explain.
- **Computational tractability**: 매 brain 의 actual implementation.
- **Strong vs weak**: 매 metaphor vs 매 literal.

## 💻 패턴 (응용 — active inference / predictive coding)

### Predictive coding network
```python
import torch
import torch.nn as nn

class PredictiveCodingLayer(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.predictor = nn.Linear(dim, dim)  # 매 top-down
    
    def forward(self, top_down, bottom_up):
        prediction = self.predictor(top_down)
        error = bottom_up - prediction
        # 매 error 만 의 propagate up
        return error, prediction

class PredNet(nn.Module):
    def __init__(self, dims):
        super().__init__()
        self.layers = nn.ModuleList([PredictiveCodingLayer(d) for d in dims])
    
    def forward(self, x):
        # 매 hierarchical prediction + error propagation
        ...
```

### Active inference (mountain car)
```python
def active_inference_agent(observations, prior_belief):
    # 매 1. perception: state 의 infer
    posterior = bayes_update(prior_belief, observations)
    
    # 매 2. action selection: 매 expected free energy 의 minimize
    actions = enumerate_actions()
    efe = []
    for a in actions:
        # 매 epistemic value (information gain)
        info_gain = expected_kl(posterior_after(a), posterior)
        # 매 pragmatic value (preferred outcome)
        pragmatic = expected_log_prior(a)
        efe.append(-info_gain - pragmatic)
    
    return actions[np.argmin(efe)]
```

→ 매 reward X — 매 prediction error / preference.

### Variational free energy
```python
import torch.distributions as dist

def free_energy(q_phi, p_theta, observations):
    # F = E_q[log q] - E_q[log p(o, s)]
    s = q_phi.rsample()
    log_q = q_phi.log_prob(s)
    log_p_obs = p_theta.likelihood(observations, s)
    log_p_prior = p_theta.prior(s)
    return log_q - log_p_obs - log_p_prior
```

### World model (Dreamer-like)
```python
class WorldModel(nn.Module):
    def __init__(self):
        self.encoder = Encoder()        # 매 obs → state
        self.dynamics = RSSM()          # 매 state + action → next state
        self.decoder = Decoder()        # 매 state → obs (reconstruction)
        self.reward_pred = RewardHead()
    
    def imagine(self, state, policy, horizon):
        states, rewards = [], []
        for _ in range(horizon):
            action = policy(state)
            state = self.dynamics(state, action)
            states.append(state)
            rewards.append(self.reward_pred(state))
        return states, rewards
```

## 🤔 결정 기준
| 응용 | Approach |
|---|---|
| Perception model | Predictive coding |
| RL agent (model-based) | Dreamer / world model |
| Sparse reward | Active inference |
| Generative + recognition | VAE |
| Hierarchical sensory | PredNet |
| Mental disorder modeling | Bayesian brain framework |

**기본값**: 매 perception = predictive coding. 매 action = active inference (sparse reward) or RL (dense).

## 🔗 Graph
- 부모: [[Computational-Neuroscience-RL|Computational-Neuroscience]] · [[Bayesian-Inference]]
- 변형: [[Predictive-Coding]] · [[Free-Energy-Principle]] · [[Active-Inference]]
- 응용: [[World-Model]] · [[VAE]]
- 사상가: [[Karl-Friston]]
- Adjacent: [[Reinforcement-Learning]] · [[Generative-Model]]

## 🤖 LLM 활용
**언제**: 매 active inference agent design. 매 world model. 매 perception system. 매 sparse-reward RL.
**언제 X**: 매 specific neuroscience claim 의 substitute. 매 medical diagnosis.

## ❌ 안티패턴
- **"매 brain literal"**: 매 metaphor 의 over-claim.
- **No precision weighting**: 매 prior / likelihood 의 same weight.
- **Strong free energy 의 unfalsifiable**: 매 모든 것 explain.
- **Active inference 의 reward 의 conflate**: 매 different objective.
- **Hierarchical 의 ignore**: 매 single-layer 의 limit.

## 🧪 검증 / 중복
- Verified (Friston, Rao-Ballard, Knill-Pouget).
- 신뢰도 B (active research).
- Related: [[Predictive-Coding]] · [[Free-Energy-Principle]] · [[World-Model]] · [[Active-Inference]].

## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Friston FEP + predictive coding + active inference + world model code |
