TECHNOLOGY

JAX linearize: reuse a pushforward at one point without assuming it follows changing parameters

In this article
THE QUICK TAKE

A reusable linearization belongs to the primal point that created it; changing model parameters requires a new mathematical linearization.

Name the point shared by sensitivity queries

A calibration analysis evaluates many parameter-perturbation directions around one fitted model. The linearize reference provides a reusable pushforward that avoids repeating linearization work for each direction. This is useful when the queries share a primal point. It is not a live view that automatically tracks later parameter updates. Store the model revision or analysis identity with the callable so it cannot be accidentally reused for a different point in parameter space.

Distinguish new directions from a new function state

Changing the tangent direction asks another question about the same local derivative. Changing weights, fixed input data or captured configuration can define a different derivative problem. Rebuild the linearization when the mathematical point or function changes. A wrapper should make this invalidation boundary explicit instead of retaining a callable under a generic cache key. Similar array shapes do not establish that two model revisions share the same derivative values.

Account for retained intermediates

The autodiff cookbook describes reusable linearization and saved primal-dependent work. Reuse can retain state that an independent directional calculation would not keep for later calls. Include that lifetime in the analysis memory budget and release stale linearizations when the corresponding model point is no longer needed. A callable is not just a small Python handle if its implementation retains numerical intermediates required by subsequent sensitivity evaluations.

Compare with the actual arrival pattern of directions

The JVP reference defines direct directional evaluation. If every direction is available together, compare an appropriate vectorized JVP arrangement with stored linearization. If directions arrive incrementally, reuse can answer a different operational need. Do not choose a method solely from an isolated timed call: include preparation, retained memory and the number of directions actually evaluated before the primal point changes or the analysis is discarded.

Verify point identity through a controlled update

Check several directions against direct derivative evaluation at the original point, then change the parameters and confirm a newly built linearization answers the updated problem. The guides on autograd chain rules and checkpoint recomputation provide related context. A good reuse policy preserves the mathematical identity of the local derivative while explaining its state lifetime. Fast repeated calls are meaningful only when they still refer to the model point the report claims to analyze.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles