Derivation. The full forward (jvp) and adjoint (vjp) equations for an algebraic factor. Cost: one linear solve. The parameter cotangent turns out to be rank one.
Sources: original to this vault (design and analysis; no single paper).
Theory (CT-ML wiki): Lens
Setup
, with clamped, inferred, , . Assume the well-posed case and invertible at the solution (Inference as Root Finding; failure is Branches and the Discriminant).
Write, using The Veronese Parametrisation §“Jacobians, exactly”,
All three are exact; no automatic differentiation is involved anywhere.
Total differential
Differentiating the constraint , which holds identically in a neighbourhood:
(the third term because is linear in , so its differential in is just ). Hence the implicit function theorem:
giving the two sensitivities
Forward mode (jvp)
Given tangents :
One solve. Cost for the factorisation, per additional tangent — so a factorisation of is reused across the whole batch of tangents.
Reverse mode (vjp) — the adjoint
This is what the put of a lens needs. Given a cotangent
arriving from downstream, we want and
satisfying
for all tangents.
Substitute:
Define the adjoint variable
— one linear solve with the transpose. Then
using . Therefore
Three things to notice
1. The parameter cotangent is rank one
is an outer product. Every data point contributes exactly a rank-one update to the parameter, and a minibatch of size contributes rank .
Consequences:
- The Grassmannian update of The Parameter is a Grassmannian is a rank- perturbation of a -plane — a subspace-tracking problem, costing rather than .
- Storage of the accumulated gradient can be rather than .
- The Gauss–Newton matrix inherits the same low-rank structure.
This is a real structural gift and it comes directly from the linearity in .
2. The cost is one solve, shared
is factorised once during inference (Newton needs it anyway) and reused for the adjoint. So the backward pass is essentially free given the forward pass — one triangular solve. Compare an unrolled equilibrium solver, which pays in memory and time.
3. Where it breaks
Exactly on the discriminant, where is singular. The conditioning is a cheap, exact early-warning signal; see Branches and the Discriminant. Near the honest options are to regularise the solve (, i.e. a Levenberg–Marquardt/Tikhonov damping) and report that you did, or to refuse.
The overdetermined / minimising case
When there is generically no root and inference minimises instead. The stationarity condition is , and differentiating that gives the sensitivity
The bracketed matrix is the full Hessian; dropping the second term gives the Gauss–Newton approximation , which is exact when and cheap always. Note that the second-derivative term is also exactly computable here (the are again times a fixed monomial Hessian), so unlike in neural settings the Gauss–Newton approximation is a choice, not a necessity.
Why this is not “differential algebra”
The README’s table lists the implicit backward pass as “implicit function theorem / differential algebra”. Everything above is the implicit function theorem — ordinary multivariable calculus. No differential algebra appears, and none is needed. Differential algebra does have genuine roles here, but they are different jobs:
| job | tool | note |
|---|---|---|
| derivative of the solve | implicit function theorem | this note |
| is this polarity well-posed at all? | elimination / dimension theory | Composition is Elimination |
| composing two factors into one | Gröbner / border bases | Composition is Elimination |
| factors that are DAEs, | differential elimination, index reduction | Differential Algebra and DAE Factors |
The last row is where differential algebra genuinely enters a backward pass, and even there it is index reduction of the adjoint DAE rather than differentiation as such.
Related: Inference as Root Finding, The Parameter is a Grassmannian, Lens, Differential Algebra and DAE Factors