惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How Backpropagation Works — From Forward Pass to Gradient...
shangkyu shi · 2026-05-06 · via DEV Community

Backpropagation sounds like “sending errors backward.”

But that explanation is too vague.

The real question is:

How does a neural network know which weights caused the error?

That is what backpropagation solves.

Core Idea

Backpropagation is the mechanism that tells each parameter how much it contributed to the final loss.

A neural network first makes a prediction.

Then it measures the error.

Then it sends gradient information backward through the network.

That gradient tells the optimizer how to update the weights.

The Key Structure

The full training flow looks like this:

Input → Forward Propagation → Prediction → Loss → Backpropagation → Gradients → Weight Update

In simple terms:

  1. Forward pass computes the output
  2. Loss measures the error
  3. Backpropagation computes gradients
  4. Optimizer updates parameters

The forward pass answers:

“What did the model predict?”

The backward pass answers:

“What should change to reduce the error?”

Implementation View

At a high level, training works like this:

for each batch:
    prediction = model(input)

    loss = loss_function(prediction, target)

    gradients = backpropagate(loss)

    update_weights(gradients)

Enter fullscreen mode Exit fullscreen mode

This is why backpropagation matters in practice.

Without gradients, the optimizer does not know which direction to move.

Without backpropagation, deep learning becomes guesswork.

Concrete Example

Imagine a model predicts:

prediction = 0.80

But the correct target is:

target = 1.00

The model is wrong by some amount.

But the network may have thousands or millions of weights.

Backpropagation answers a more specific question:

Which weights pushed the prediction away from the target?

Not every weight deserves the same update.

Some weights contributed more to the error.

Some contributed less.

Backpropagation distributes responsibility backward through the computation.

Forward Propagation vs Backpropagation

Forward propagation and backpropagation are opposite flows.

Forward propagation:

  • moves from input to output
  • computes activations
  • produces a prediction
  • calculates loss

Backpropagation:

  • moves from loss back toward earlier layers
  • computes gradients
  • assigns error responsibility
  • prepares weight updates

Forward pass is prediction.

Backward pass is learning.

You need both.

Why the Chain Rule Matters

Backpropagation is built on the chain rule.

A deep neural network is a chain of operations.

Each layer depends on the previous layer.

So the effect of an early weight on the final loss must pass through many steps.

The chain rule lets us compute that effect systematically.

Conceptually:

loss depends on output

output depends on hidden layers

hidden layers depend on weights

So we trace the dependency backward.

That is backpropagation.

Learning and Weight Updates

Backpropagation does not update weights by itself.

It computes gradients.

The optimizer uses those gradients to update parameters.

A simple update looks like this:

new weight = old weight - learning rate × gradient

The gradient gives the direction.

The learning rate controls the step size.

This is why training can fail even when backpropagation is correct.

If the learning rate is too large, updates can become unstable.

If it is too small, learning can be painfully slow.

Why Training Can Still Be Unstable

Understanding backpropagation does not automatically make training stable.

Gradients can be noisy.

Gradient estimates can vary from batch to batch.

This is especially visible in mini-batch training.

One batch may suggest one direction.

Another batch may suggest a slightly different direction.

That variation is called gradient variance.

This is why training loss can wobble instead of moving smoothly downward.

Deeper View: Computational Graphs

A useful way to understand backpropagation is through a computational graph.

Each operation becomes a node.

Each connection shows dependency.

Backpropagation moves backward through that graph and applies differentiation step by step.

This is also why automatic differentiation works.

Modern deep learning frameworks do not manually derive every gradient.

They build a computation graph and apply the chain rule automatically.

Recommended Learning Order

If backpropagation feels abstract, learn it in this order:

  1. Forward Propagation
  2. Backpropagation
  3. Learning and Backpropagation
  4. Gradient Estimate
  5. Gradient Variance
  6. Computational Graph
  7. Automatic Differentiation

This order works because you first understand the forward computation.

Then you understand the backward learning flow.

Then you connect it to training instability and implementation tools.

Takeaway

Backpropagation is not just “error moving backward.”

It is the gradient computation system that makes neural networks trainable.

Forward propagation makes the prediction.

Loss measures the mistake.

Backpropagation computes responsibility.

The optimizer updates the weights.

If you remember one sentence, remember this:

Backpropagation tells each parameter how it should change to reduce the loss.

Discussion

When you first learned backpropagation, was the hardest part the chain rule, the gradient flow, or the connection to actual weight updates?

Originally published at zeromathai.com.
Original article: https://zeromathai.com/en/backpropagation-overview-hub-en/