This Calculus concept is the current idea: keep the same invariant visible across Intuition, Math, Code, Interactive Demo.
Calculus
Jacobians, Hessians, VJPs, and JVPs
Jacobians are local linear maps; JVPs push perturbations forward, VJPs pull sensitivities back, and Hessian-vector products expose curvature without building every entry.
Concept Structure
Jacobians, Hessians, VJPs, and JVPs
Start with the picture, metaphor, or geometric mechanism.
Make the objects explicit and connect them with notation.
Mirror the equations with runnable implementation details.
Manipulate the mechanism and watch the idea respond.
Learner Contract
What this page should let you do.
3 prerequisites listed; refresh them before leaning on the math or code.
Explain the mechanism, trace the main notation, and test one prediction in the live demo.
Read the intuition before the notation; the math should name a mechanism you already felt.
Follow this edge after making one prediction here; the next page should reuse the result, not restart the route.
Claim/source review status
Substantive review recorded
1/1 claims have bounded review metadata; still check caveats and source scope.Metadata-derived; review may be AI-assisted. Not a human certification.01
Intuition
Build the mental picture first so the rest of the page has something to attach to.
A derivative in one dimension is a slope. In many dimensions, the derivative is a local linear map.
Near an anchor point , a differentiable function behaves like
The Jacobian is the matrix for that local linear map. But deep-learning systems often do not want the whole matrix. They want the matrix acting on a vector.
There are two directions to keep separate.
A JVP asks: "if the input moves a little in direction , how does the output move?"
A VJP asks: "if a downstream objective cares about the output through covector , how should that sensitivity be pulled back to the input?"
That shape discipline is the whole concept:
- moves tangent information forward.
- moves cotangent information backward.
- moves curvature information through the Hessian of a scalar loss.
The full matrix is sometimes useful for inspection. The products are what make modern autodiff practical.
02
Math
Translate the story into symbols, assumptions, and a derivation you can inspect.
Let
At an anchor , the Jacobian is
The first-order Taylor approximation says
If is an input tangent direction, the Jacobian-vector product is
It answers a forward perturbation question: one input-space direction becomes an output-space direction.
If is an output cotangent, the vector-Jacobian product is
It answers a reverse sensitivity question: one output-space scoring vector becomes an input-space sensitivity.
For a scalar loss , the gradient is input-shaped:
The Hessian collects second derivatives:
A Hessian-vector product
answers a curvature question: how does the gradient change if the input moves in direction ?
For neural networks with millions or billions of parameters, materializing full Jacobians or Hessians is usually the wrong first mental model. Autodiff systems expose products because products preserve the useful local action without storing every entry.
03
Code
Keep the implementation aligned with the notation so the algorithm is legible.
import numpy as np
def f(x):
a, b = x
return np.array([a*a + 0.5*b,
np.sin(a) + a*b,
a - b*b])
def jacobian(x):
a, b = x
return np.array([[2*a, 0.5],
[np.cos(a) + b, a],
[1.0, -2*b]])
def hessian_loss(x):
a, _ = x
return np.array([[6*a, 0.5],
[0.5, 2.0]])
x0 = np.array([0.8, -0.4])
v = np.array([0.4, -0.7]) # input tangent, shape (2,)
u = np.array([0.6, -0.8, 0.5]) # output cotangent, shape (3,)
p = np.array([0.25, -0.6]) # curvature probe, shape (2,)
J = jacobian(x0)
print("f(x0):", np.round(f(x0), 3))
print("J shape:", J.shape)
print("Jv:", np.round(J @ v, 3))
print("J^T u:", np.round(J.T @ u, 3))
print("H p:", np.round(hessian_loss(x0) @ p, 3))
Notice the shapes. Here is . The JVP has output shape (3,). The VJP returns to input shape (2,). The Hessian-vector product for a scalar loss also has input shape (2,).
04
Interactive Demo
Use direct manipulation to connect the explanation to a moving system.
Use the lab below as a shape-first autodiff witness. You can inspect the anchor, tangent vector, output cotangent, and the fact that .
Before revealing numbers, answer this question: an output cotangent arrives from a downstream score. Which operation sends that sensitivity back to the two input coordinates?
Then reveal the local Jacobian, the JVP, the VJP, and a Hessian-vector mini-check. Try the presets after the default case. The values change, but the shape contract should not.
Live Concept Demo
Explore Jacobians, Hessians, VJPs, and JVPs
The stage is code-native and interactive. Use it to test the explanation against the mechanism.
Manipulate one control and predict the visible change.
Commit to what Jacobians, Hessians, VJPs, and JVPs should make visible before reading the result.
After The First Pass
Turn the concept into an inspected object.
Once the invariant is visible in the intuition, math, code, and demo, use these panels to inspect the mechanism visually, check source support, practice the idea, and attach a grounded research question.
Mechanism Storyboard
See the idea move before the page explains it
Jacobians are local linear maps; JVPs push perturbations forward, VJPs pull sensitivities back, and Hessian-vector products expose curvature without building every entry.
Start with the picture, metaphor, or geometric mechanism.
Before reading further, choose the kind of change Jacobians, Hessians, VJPs, and JVPs should make visible.
Visual Inquiry
Make the image answer a mathematical question
Jacobians are local linear maps; JVPs push perturbations forward, VJPs pull sensitivities back, and Hessian-vector products expose curvature without building every entry.
Which visible object should carry the first intuition?
Pick the cue that should make Jacobians, Hessians, VJPs, and JVPs easier to reason about before the page gives the answer.
Source Grounding
Canonical references for the mechanism on this page.
Supports Jacobian matrix shape, Hessian matrix/tensor shape, and the multivariate Taylor/local-linearization bridge.
Open sourceSupports forward-mode matrix-free Jacobian-vector products, reverse-mode transposed Jacobian-vector products, and Hessian-vector products.
Open sourceSupports JVP/VJP math, jacfwd/jacrev tradeoffs, and Hessian-vector product recipes.
Open sourceSupports practical API shape contracts: jvp vector same size as input and result shaped like output; vjp vector same size as output and result shaped like input; hessian for scalar functions.
Open sourceSupports the framework behavior that backpropagation usually returns vector-Jacobian products rather than materializing full Jacobians.
Open sourceClaim Review
Jacobians are local linear maps; JVPs push perturbations forward, VJPs pull sensitivities back, and Hessian-vector products expose curvature without building every entry.
Claims without a substantive review badge still need exact source-support review.
deisenroth-2020-mml-jacobian-hessian, baydin-2018-ad-survey-jvp-vjp, jax-2026-autodiff-cookbook, pytorch-2026-autograd-functional, d2l-2026-autograd
Use equations, runnable code, and demos to check whether the source support is operational.
The sources agree on the shape story: Jacobians collect first-order partial derivatives, JVPs push input tangents forward, VJPs apply the transposed Jacobian to output cotangents, and Hessian-vector products are a practical curvature primitive.
Sources: Mathematics for Machine Learning, Automatic Differentiation in Machine Learning: a Survey, JAX Autodiff Cookbook, PyTorch autograd.functional jvp/vjp/jacobian/hessian, Dive into Deep Learning: Automatic DifferentiationThis page teaches finite-dimensional real-valued arrays and local smooth functions. It does not cover complex differentiation conventions, nonsmooth primitives, sparse Jacobian compression, custom derivative rules, checkpointing policy, or full framework edge cases.A bounded review summary is present; still check caveats and exact reference scope.MML, Baydin, JAX, PyTorch, and D2L support the Jacobian/Hessian shape story and product-first autodiff framing; GPT Pro critique remains pending.
Reviewer: codex-local-source-review; reviewed 2026-07-02Source support candidates
book 2020Mathematics for Machine LearningSupports Jacobian matrix shape, Hessian matrix/tensor shape, and the multivariate Taylor/local-linearization bridge.
paper 2018Automatic Differentiation in Machine Learning: a SurveySupports forward-mode matrix-free Jacobian-vector products, reverse-mode transposed Jacobian-vector products, and Hessian-vector products.
documentation 2026JAX Autodiff CookbookSupports JVP/VJP math, jacfwd/jacrev tradeoffs, and Hessian-vector product recipes.
documentation 2026PyTorch autograd.functional jvp/vjp/jacobian/hessianSupports practical API shape contracts: jvp vector same size as input and result shaped like output; vjp vector same size as output and result shaped like input; hessian for scalar functions.
Practice Loop
Try the idea before it explains itself
Jacobians are local linear maps; JVPs push perturbations forward, VJPs pull sensitivities back, and Hessian-vector products expose curvature without building every entry.
Before touching the demo, predict one visible change that should happen in Jacobians, Hessians, VJPs, and JVPs.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
Reveal when your model needs a nudge.
A concrete answer is on the canvas.
The answer names why the claim should hold.
It touches the page context or a neighboring idea.
Research Room
Attach the question to a claim, equation, code, or demo
Pick the concept, equation, source, runnable code, claim, misconception, or demo state before asking for help. The handoff keeps that page item in context.Open the draft below to save one note and next action in this browser.
Jacobians, Hessians, VJPs, and JVPs
What is the smallest example that makes Jacobians, Hessians, VJPs, and JVPs click without losing the math?
Local action draftNo local draft saved yetExpand only when ready to capture one local next action
This draft stays in this browser, attached to the selected learning item.
- References to inspect: attached references on this page.
- Definition, prerequisite, and contrast concept links
- The equation or runnable code 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 - Jacobians, Hessians, VJPs, and JVPs Selected item key: recorded for copy. Context: Calculus Page anchor: recorded for copy. Open question: What is the smallest example that makes Jacobians, Hessians, VJPs, and JVPs click without losing the math? Evidence to inspect: - References to inspect: attached references on this page. - Definition, prerequisite, and contrast concept links - The equation or runnable code that makes the concept operational - One demo state that shows the invariant instead of a slogan 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.
concept/concept-notebook/calculus/jacobians-hessians-vjp-jvp
concept:calculus/jacobians-hessians-vjp-jvp