---
title: "An Autograd Gradient Can Be One Weighted Output Sensitivity"
description: "Leviathan Systems — Technical content Published 2026-10-21; updated 2026-10-21."
canonical: "https://www.leviathansystems.co/articles/ai-autograd-vector-jacobian-product-output-sensitivity"
last-updated: "2026-10-21"
---

# An Autograd Gradient Can Be One Weighted Output Sensitivity

Leviathan Systems — Technical content
Published 2026-10-21; updated 2026-10-21.

A vector-Jacobian product combines incoming output sensitivities into one sensitivity per input coordinate. With fixed output weights v and an output-by-input Jacobian J, the result is Jᵀv: the input gradient of the weighted scalar vᵀf(x). That product can fully satisfy a weighted-sensitivity request. A request for every output/input partial derivative instead requires the full Jacobian information, with its axes identified.

## Identify the outputs, inputs and incoming sensitivities

A derivative handoff needs to say what each returned number describes. For a differentiable function f with n input coordinates and m output coordinates, define Jᵢⱼ = ∂fᵢ/∂xⱼ at the input point being assessed. This Jacobian has one row per output and one column per input. It preserves the separate local sensitivity of each output to each input.

An incoming output-sensitivity vector v supplies one coefficient for each output coordinate. For input xⱼ, the chain rule multiplies each output's partial derivative by its incoming coefficient, then adds those contributions: gⱼ = Σᵢ vᵢJᵢⱼ. The resulting g has input coordinates. Output contributions have been combined within each input coordinate.

With column vectors this is g = Jᵀv. The row-vector notation vᵀJ describes the same components. The term vector-Jacobian product refers to this weighted combination; writing the transpose explicitly keeps the chosen axes clear.

PyTorch 2.14 documents grad_outputs as the incoming vector for torch.autograd.grad. Its functional.jacobian reference separately describes a Jacobian result whose dimensions retain output/input associations. These are different derivative objects that can serve different requests.

References: [P1](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.grad.html), [P2](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.functional.jacobian.html), [P3](https://raw.githubusercontent.com/pytorch/pytorch/v2.14.0/torch/autograd/__init__.py)

## VJP49 starts with four separate partial derivatives

VJP49 is an illustrative symbolic example. Let f(x₁,x₂) = (x₁², x₁x₂), assessed at x = (2,3). The outputs are f₁ = 4 and f₂ = 6. All coordinates and weights in this example are dimensionless. The function is differentiable and the values are dense, finite and real. Output weights are fixed constants during differentiation. The calculations below are algebra, with no executed autograd or model result.

The first output has ∂f₁/∂x₁ = 2x₁ = 4 and ∂f₁/∂x₂ = 0. The second output has ∂f₂/∂x₁ = x₂ = 3 and ∂f₂/∂x₂ = x₁ = 2.

In output order (f₁,f₂) and input order (x₁,x₂), the full Jacobian is J = [[4,0],[3,2]]. Its first row describes f₁ and its second row describes f₂. Its first column describes changes with x₁ and its second column describes changes with x₂. There are four entries, including the zero.

## Two weighted rows become one input sensitivity

Now stipulate incoming output weights v = (1,2). For x₁, the first output contributes 1 × 4 and the second contributes 2 × 3, giving g₁ = 10. For x₂, their contributions are 1 × 0 and 2 × 2, giving g₂ = 4. Thus Jᵀv = (10,4). Each returned coordinate gathers the weighted contributions that reach that input.

The scalar represented by these fixed weights is s(x) = f₁(x) + 2f₂(x) = x₁² + 2x₁x₂. At (2,3), s = 16. Its input derivatives are ∂s/∂x₁ = 2x₁ + 2x₂ = 10 and ∂s/∂x₂ = 2x₁ = 4. The product therefore supplies the input gradient of this particular scalar combination.

A small input perturbation εd has first-order scalar change ε(gᵀd). For direction d = (1,-1), Jd = (4,1) gives the first-order output coefficients. Weighting them gives 1 × 4 + 2 × 1 = 6, agreeing with gᵀd = 10 - 4 = 6. These are local first-order coefficients, rather than exact changes for an arbitrary finite input displacement.

References: [P1](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.grad.html)

## Keep the output weights attached to the result

Changing the fixed weights to (2,1), while keeping the function and input point unchanged, gives 2(4,0) + (3,2) = (11,2). This is the gradient of 2f₁ + f₂. The different pair reflects a different scalar combination, even though the underlying Jacobian is unchanged.

All-ones weights (1,1) give (7,2), the gradient of f₁ + f₂. Adding output contributions has not preserved each output's row separately. Unit weights (1,0) give the first row's components (4,0); weights (0,1) give the second row's components (3,2). These identities explain which information a stipulated product represents; they prescribe neither an output-weight choice nor a Jacobian-computation method.

A record containing only the phrase input gradient and the pair (10,4) omits the output combination that gives those values their meaning. The fixed weights, or the equivalent scalar definition, belong with the handoff.

## One product leaves individual partials underdetermined

Consider a separate matrix K = [[6,0],[2,2]]. For the same v = (1,2), Kᵀv = (6 + 4, 0 + 4) = (10,4). K differs from J while sharing this one weighted product.

K is not claimed to be the Jacobian of VJP49's function. The derivatives of that explicitly defined function already establish J = [[4,0],[3,2]]. The comparison shows an information limit: receiving the pair (10,4) for weights (1,2) alone cannot identify all four entries of an otherwise unspecified matrix.

A full Jacobian lets its consumer distinguish each output's contribution to each input. One weighted product retains their combined effect for the supplied weights. Agreement on that product is useful evidence about the requested combination, but it cannot by itself establish agreement on every individual partial derivative.

## Match the derivative handoff to the actual request

Suppose handoff A requests the input sensitivity of f₁ + 2f₂ at (2,3), in input order (x₁,x₂). VJP49's (10,4) is the complete mathematical answer to that request. Requiring a four-entry matrix would add a deliverable the consumer did not request.

Handoff B instead requests every partial derivative of both outputs with respect to both inputs at that point. Its required information is the four entries of J, with their output/input associations. Delivering only (10,4) leaves B incomplete, even if that product is accurate. The consumer's intended derivative object determines completeness.

For an actual sensitivity handoff, identify the function or model revision and fixed state, the assessed input point, selected inputs and their order, output definitions and their order, and any units or normalization. Attach the incoming output sensitivities or the scalar reduction being differentiated. If preprocessing or an output transformation forms part of the differentiated function, that boundary belongs in its definition.

Retain the framework release and numerical settings with the supplied result, and have the appointed software owner connect the delivered values to the requested object. A label such as autograd enabled or backward completed does not specify the incoming sensitivities or establish that every partial was delivered. This mathematical comparison chooses no implementation, memory strategy or training objective and supplies no runtime, quality or causal-attribution result.

References: [P1](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.grad.html), [P2](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.functional.jacobian.html)

## Use the neighboring guides for their separate decisions

The related evaluation-mode guide distinguishes module behavior from autograd recording. The activation-checkpointing guide explains the lifetime and reconstruction of values needed for backward. Those topics concern the circumstances in which derivative work can occur.

The gradient-accumulation guide combines scalar-loss gradient contributions across microbatches and identifies update boundaries. The gradient-clipping guide examines a transformation of an already supplied gradient population. VJP49 instead holds one function and input point fixed and identifies what its incoming output sensitivities mean. Keeping these decisions distinct makes a gradient handoff interpretable.

## Connect an identified equipment need to physical installation

If the independently selected equipment also needs mounting or physical IT cabling, Leviathan's Rack-and-Stack & Colocation Installation service and its project inquiry below provide a route to discuss that work. Share a nonconfidential equipment list, released rack and endpoint plans, site requirements and desired window to discuss agreed mounting, cabling, labels and installation records.

Derivative implementation and numerical acceptance remain with the appointed software owners.

References: [L1](https://www.leviathansystems.co/services/rack-and-stack)

## Primary sources

- [P1 — PyTorch 2.14: torch.autograd.grad](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.grad.html). Checked 2026-10-21. Defines grad_outputs as the incoming vector for a vector-Jacobian product and identifies the inputs receiving the returned derivatives. Applied here to one fixed vector and a differentiable real-valued function.
- [P2 — PyTorch 2.14: torch.autograd.functional.jacobian](https://docs.pytorch.org/docs/2.14/generated/torch.autograd.functional.jacobian.html). Checked 2026-10-21. The return description preserves output/input associations and their dimensions. Used to distinguish the full derivative object from one weighted product, without recommending an API or differentiation strategy.
- [P3 — PyTorch v2.14.0: autograd.grad source docstring](https://raw.githubusercontent.com/pytorch/pytorch/v2.14.0/torch/autograd/__init__.py). Checked 2026-10-21. The tagged grad docstring confirms the incoming-vector contract. The symbolic example explains that contract without claiming library execution or an actual model result.
- [L1 — Leviathan Systems: Rack-and-Stack & Colocation Installation](https://www.leviathansystems.co/services/rack-and-stack). Checked 2026-10-21. Agreed equipment mounting, physical IT cabling, labels and installation records support an inquiry for a separately identified equipment project.

## Related Leviathan resources

- [Evaluation mode and autograd recording](/articles/pytorch-evaluation-mode-versus-autograd-recording)
- [Activation checkpointing and backward-value lifetime](/articles/activation-checkpointing-recompute-versus-training-recovery)
- [Gradient accumulation and the optimizer-update boundary](/articles/gpu-training-microbatch-gradient-accumulation)
- [Gradient clipping: operation, population and stage](/articles/pytorch-gradient-clipping-operation-population-boundary)
- [Rack-and-Stack & Colocation Installation](/services/rack-and-stack)
- [Discuss a separate physical equipment installation](/contact?service=rack-and-stack&from=%2Farticles%2Fai-autograd-vector-jacobian-product-output-sensitivity)

## Does the selected equipment need physical installation?

Share a nonconfidential equipment list, released rack and cable plans, site and desired window to discuss physical installation scope and availability.

[Discuss the scope](/contact?service=rack-and-stack&from=/articles/ai-autograd-vector-jacobian-product-output-sensitivity)
