---
title: "Predictive Coding"
description: "Alternative biological learning frameworks vs Backpropagation."
canonical_url: "https://angeloai.vercel.app/docs/concepts/08-predictive-coding"
markdown_url: "https://angeloai.vercel.app/docs/concepts/08-predictive-coding.md"
last_updated: "2018-10-20"
---

# Predictive Coding
URL: /docs/concepts/08-predictive-coding
LLM index: /llms.txt
Description: Alternative biological learning frameworks vs Backpropagation.

# Predictive Coding vs. Backpropagation

*Note: While Angelo is trained using standard Backpropagation, understanding alternative optimization frameworks provides a broader perspective on AI research.*

### Backpropagation
**Backpropagation** is the standard algorithm used to train neural networks (including LLMs). It works in two phases:
1. **Forward Pass:** Data flows through the network to generate a prediction.
2. **Backward Pass (Backprop):** The error (difference between prediction and reality) is calculated at the end. Calculus (the chain rule) is used to calculate "gradients", which show how much each weight in the network contributed to the error. The weights are then updated.

### Predictive Coding (PC)
**Predictive Coding** is an alternative, biologically inspired learning framework. 

Instead of calculating gradients sequentially from the output back to the input, Predictive Coding focuses on **local prediction errors**:
1. Every layer in the network constantly tries to predict the activity of the layer below it.
2. If the prediction is wrong, a local error is generated.
3. During a single "step," the network undergoes multiple iterative *inference* cycles where hidden states adjust themselves to minimize these local errors, settling into a stable state.
4. Only after stabilizing are the actual weights updated locally.

While Backpropagation is incredibly efficient on modern GPUs and remains the industry standard, Predictive Coding is highly active in neuroscience-inspired AI research because it allows for local learning without needing a global backward pass.

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
