Abstract

Many tasks in scientific computing and machine learning require the Jacobian or Hessian matrix of a function. Automatic differentiation (AD) computes these derivatives to machine precision, but materializing a dense $m \times n$ Jacobian requires $n$ forward-mode or $m$ reverse-mode AD passes, one per column or row. For a large class of functions, each output depends on only a few inputs, making the derivative matrix sparse. Automatic sparse differentiation (ASD) exploits this structure in four steps: detection of the input-agnostic sparsity pattern, coloring of a graph to group columns or rows that can share an AD pass, compressed differentiation to compute a compressed derivative matrix with one AD pass per color, and finally decompression into the original sparsity pattern. The number of colors, and hence of AD passes, is often independent of the problem dimension: a banded Jacobian with $b$ contiguous bands, for instance, only ever requires $b$ colors, regardless of its size. asdex offers the first standalone ASD toolkit in the popular JAX ecosystem. With asdex.jacobian and asdex.hessian, it provides sparse drop-in replacements for jax.jacobian and jax.hessian.

Keywords

Subject

Publication details

Journal
Not available
Open access
Green open access

Cite this article

APA 7

Hill, A., & Dalle, G. (2026). asdex: Automatic Sparse Differentiation in JAX. https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax

MLA 9

Hill, Adrian, and Guillaume Dalle. "asdex: Automatic Sparse Differentiation in JAX." https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax.

Chicago (author–date)

Hill, Adrian, and Guillaume Dalle. 2026. "asdex: Automatic Sparse Differentiation in JAX." https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax.

Harvard

Hill, A. and Dalle, G. (2026) 'asdex: Automatic Sparse Differentiation in JAX', Available at: https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax.

Vancouver

Hill A, Dalle G. asdex: Automatic Sparse Differentiation in JAX. https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax

IEEE

A. Hill, and G. Dalle, "asdex: Automatic Sparse Differentiation in JAX," https://omanscience.com/en/articles/asdex-automatic-sparse-differentiation-in-jax.