Bring the mental model from Chain Rule; this page will reuse it instead of restarting from zero.
Computation Graphs
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.
01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
Suppose one intermediate value gets used twice. If a=xy, b=sin(a), and c=a+b, then a affects c directly and also through b. How should the derivative remember both uses without differentiating one huge expanded formula by hand?
A computation graph makes that bookkeeping visible.
Instead of treating a function as one large expression, we split it into small operations: multiply here, apply a nonlinearity, add there, reuse an intermediate value. Each operation becomes a node, and each dependency becomes an edge.
A computation graph is not just an expression tree. The expanded expression xy+sin(xy) repeats xy. The graph stores a=xy once and records that two later operations depend on that same value.
This matters because the graph gives backpropagation a route. Values move forward through the graph to produce an output or loss. Derivatives move backward through the same graph, using local slopes on each edge. The chain rule stops feeling like one giant symbolic derivative and becomes bookkeeping over small local changes.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
In this first example, every node is scalar. Let x,y∈R, and draw edges from inputs to the values that depend on them. The graph for one forward pass is a directed acyclic graph: later nodes depend on earlier nodes, not the other way around.
Consider the scalar computation
The graph has inputs x,y, intermediate nodes a,b, and output c. The forward pass stores each node value. The important detail is reuse: a is stored once, but two later uses depend on it. The backward pass asks how a small change in each node would affect the output.
For any node v, write
The output seed is cˉ=1. The final add node c=a+b sends one unit of sensitivity to both inputs:
The sine branch also sends a local contribution into the same stored node a. The important invariant is local: a node's cotangent is the sum of contributions from each immediate downstream use. The demo hides the sine-branch contribution until you predict whether it will lower, preserve, or raise the direct baseline.
The backward pass does not expand every symbolic path; each downstream node has already summarized everything beyond it.
For vector or tensor nodes, the same idea uses Jacobians or local vector-Jacobian product rules. With column-vector cotangents, if vj=f(vi) and Jji=∂vj/∂vi, the reverse update is
Reverse-mode autodiff is the automated version of this bookkeeping: save forward values, then run local backward rules in reverse topological order.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import math
x, y = 2.0, 3.0
# Forward pass: store intermediate node values.
a = x * y
b = math.sin(a)
c = a + b
# Reverse pass bookkeeping: every downstream use appends one local contribution.
bar_c = 1.0
bar_a = 0.0
bar_b = 0.0
bar_x = 0.0
bar_y = 0.0
# c = a + b sends one unit to both inputs.
bar_a += bar_c * 1.0
bar_b += bar_c * 1.0
# b = sin(a) sends another contribution into reused node a.
bar_a += bar_b * math.cos(a)
# a = x * y sends the accumulated sensitivity to x and y.
bar_x += bar_a * y
bar_y += bar_a * x
print("c:", round(c, 4))
print("stored a once:", a)
print("downstream uses of a:", ["direct add edge", "sine edge"])
print("bar_a:", round(bar_a, 4))
print("dc/dx:", round(bar_x, 4))
print("dc/dy:", round(bar_y, 4))
The code is deliberately manual. The += updates are the graph mechanism: a reused node collects every downstream local contribution before sending its accumulated sensitivity to its own inputs.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Live Concept Demo
Explore Computation Graphs
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Choose what to inspect in Computation Graphs. This shared fallback is an observation guide, not evidence of learning.
Use the sliders to change x and y. In Forward mode, watch the stored value a=xy feed both b=sin(a) and the final add node c=a+b.
Before switching into the backward numbers, predict whether the hidden accumulated sensitivity at the reused node a should land lower than, nearly equal to, or higher than the direct contribution from c=a+b.
Use Case A and Case B as neutral graph states. Commit first, then reveal how the downstream paths combine before a sends sensitivity back to x and y.
Copy-only prompts — each action copies a page-grounded prompt to your clipboard. Nothing is sent by this site.
Concept: Computation Graphs
What is the smallest example that makes Computation Graphs click without losing the math?
Object contextCalculus
concept:calculus/computation-graphsComputation Graphs
What is the smallest example that makes Computation Graphs click without losing the math?
Start with the prediction checkpoint, then compare the reveal to the mental model.
Take this moveStudy modes
Keep the object fixed; change the lens.Route back through the notebook
Carry the same object through intuition, math, code, and demo.
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.
The next edge should feel earned: use the demo prediction here before following Reverse-Mode Automatic Differentiation.
After The First Pass
Turn the concept into an inspected object.
The lower panels are one second act: keep the object fixed, inspect it visually, check source boundaries, practice transfer, then attach the research question.Mechanism Storyboard
See the idea move before the page explains it
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.

Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Computation Graphs should make visible.
Visual Inquiry
Make the image answer a mathematical question
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.
Which visible object should carry the first intuition?
Pick the cue that should make Computation Graphs easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
What is the smallest example that makes Computation Graphs click without losing the math?
concept:calculus/computation-graphssources: baydin-2018-ad-survey
Open the closest source note before trusting the local explanation.
1 selected-object source shown first; 1 reference total.
Audit the claim boundary, then ask from the same selected object.
Grounds computation graphs as the program structure used by automatic differentiation systems.
Baydin et al. describe AD over evaluation traces of elementary operations, computational graphs for dependency relations, and reverse mode as a forward pass that populates intermediate va...
Covers differentiable primitives in one executed DAG/program trace and local scalar/vector-VJP teaching model, not symbolic simplification, mutation/aliasing, checkpointing policy, nonsmo...
Claim Review
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.
What is the smallest example that makes Computation Graphs click without losing the math?
concept:calculus/computation-graphssources: baydin-2018-ad-survey
Treat every claim as provisional until source support and a local witness agree.
1 structured claim check on this concept.
Run the prediction or practice transfer before asking for a grounded review.
Publisher-side editorial review is not independent replication. Claims without it still need exact source-support review. 1 reference and 3 local witnesses are available for inspection.
Baydin et al. describe AD over evaluation traces of elementary operations, computational graphs for dependency relations, and reverse mode as a forward pass that populates intermediate variables/records grap...
Covers differentiable primitives in one executed DAG/program trace and local scalar/vector-VJP teaching model, not symbolic simplification, mutation/aliasing, checkpointing policy, nonsmooth primitives, or e...
Checked Baydin et al. for one executed AD trace: programs become elementary-operation traces and graphs of intermediate-variable dependencies; reverse mode runs code forward, populates intermediates, records dependencies, then propagates adjoints backward; a reused variable's adjoint sums downstream contributions before input derivatives are obtained. Local math/code/demo instantiate a=xy,b=sin(a),c=a+b with one stored a, direct + sine-path cotangent accumulation, and propagation to x,y.
Reviewer: codex+oracle; reviewed 2026-05-07Practice notebook
Use the idea, then test it somewhere new
A computation graph breaks a calculation into nodes so values flow forward and sensitivities flow backward.
What is the smallest example that makes Computation Graphs click without losing the math?
concept:calculus/computation-graphssources: baydin-2018-ad-survey
Use one state from Computation Graphs to explain what changes, why it changes, and which assumption the explanation needs.
No learner move yet; no learning state is inferred.
Write first, use only the help you need, then try a new case without it.
Use one state from Computation Graphs to explain what changes, why it changes, and which assumption the explanation needs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Write an attempt before asking the companion.
0 of 3 progressive hints opened.
This draft and any AI response do not establish mastery; a later unassisted case can.
- ObjectConceptComputation Graphs
- PredictBefore revealComputation Graphs prediction
- WitnessCompare codeComputation Graphs code witness 1
- RoomAsk groundedChecking local snapshot
Research Room
Attach the question to an exact object
Pick the concept, equation, source, code witness, claim, misconception, or demo state before asking for help. The handoff stays grounded to that object.Open the draft below to save one note and next action in this browser.
Computation Graphs
What is the smallest example that makes Computation Graphs click without losing the math?
These are fixed, deterministic perspectives derived from the selected object. They do not represent people, community contributions, or independent review.
Source ids baydin-2018-ad-survey must support the exact object, not just the surrounding topic.
Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion.
Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo.
The learner can state the mechanism in their own words
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays locally in this browser for concept:calculus/computation-graphs.
- Source ids to inspect: baydin-2018-ad-survey
- Definition, prerequisite, and contrast concept links
- The equation or code witness that makes the concept operational
- One demo state that shows the invariant instead of a slogan
- The learner can state the mechanism in their own words
- The learner can name the prerequisite that would repair confusion
- The learner can predict how the mechanism changes under one perturbation
I am working in Continuous Function's research reading room. Object: concept - Computation Graphs Object key: concept:calculus/computation-graphs Context: Calculus Anchor id: concept/concept-notebook/calculus/computation-graphs Open question: What is the smallest example that makes Computation Graphs click without losing the math? Evidence to inspect: - Source ids to inspect: baydin-2018-ad-survey - Definition, prerequisite, and contrast concept links - The equation or code witness that makes the concept operational - One demo state that shows the invariant instead of a slogan Deterministic role lenses for this object: - Boundary: fixed perspectives, not people, community contributions, or independent review - Source-checking summary: Treat this as a mechanism object: connect the definition to one equation, code witness, or demo before broadening the discussion. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Teach/transfer move: Turn the mechanism into one sentence that predicts a neighboring concept. - Assumptions: - Source ids baydin-2018-ad-survey must support the exact object, not just the surrounding topic. - The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. - The concept explanation is local atlas prose until checked against its math, code, and source support. - Prerequisite gaps should become a repair route, not a reason to leave the object vague. - Role-lens requests: - Learner: ask for "Ask what would make "Computation Graphs" feel predictable rather than familiar." | assumption: Source ids baydin-2018-ad-survey must support the exact object, not just the surrounding topic. | next action: The learner can state the mechanism in their own words - Researcher: ask for "Source ids to inspect: baydin-2018-ad-survey" | assumption: The stable content-object key lets local drafts, prompts, and route memory attach without changing the source page. | next action: The learner can name the prerequisite that would repair confusion - Experimenter: ask for "Choose one variable or condition to perturb before asking for an explanation." | assumption: The concept explanation is local atlas prose until checked against its math, code, and source support. | next action: The learner can predict how the mechanism changes under one perturbation - Professor: ask for "Find the smallest transferable rule a learner could reuse without the AI." | assumption: Prerequisite gaps should become a repair route, not a reason to leave the object vague. | next action: Teach or transfer: Turn the mechanism into one sentence that predicts a neighboring concept. What would resolve this: - The learner can state the mechanism in their own words - The learner can name the prerequisite that would repair confusion - The learner can predict how the mechanism changes under one perturbation Answer as a careful research tutor: stay source-grounded, separate verified evidence from assumptions, name the relevant math objects, and end with one next action. Current deterministic role lens for this object: - Role lens: Learner - Evidence request: Ask what would make "Computation Graphs" feel predictable rather than familiar. - Assumption to keep visible: Source ids baydin-2018-ad-survey must support the exact object, not just the surrounding topic. - Proposed experiment: Ask the learner to perturb one representation, then check whether the same invariant survives in math, code, and demo. - Next action: The learner can state the mechanism in their own words
concept/concept-notebook/calculus/computation-graphs
concept:calculus/computation-graphs