cs.MSOct 8, 2026

asdex: Automatic Sparse Differentiation in JAX

Authors: Adrian Hill, Guillaume Dalle

Organizations: BIFOLD – Berlin Institute for the Foundations of Learning and Data, Berlin, Germany · Machine Learning Group, Technical University of Berlin, Berlin, Germany · LVMT, ENPC, Institut Polytechnique de Paris, Univ Gustave Eiffel, Marne-la-Vallée, France

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×nm \times n Jacobian requires nn forward-mode or mm 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 bb contiguous bands, for instance, only ever requires bb 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.

Figures & tables

Explore similar work

CardsList
  1. Truncated automatic sparse differentiation for machine learning interatomic potentials

    Sep 17, 2026Marcel F. Langer, Adrian Hill, Michele CeriottiAutomatic DifferentiationMachine Learning Interatomic Potentials

  2. jNO: A JAX Library for Neural Operator and Foundation Model Training

    May 11, 2026Leon Armbruster, Rathan Ramesh, Georg Kruse +1PDE Operator LearningPhysics-Informed Neural Operators

  3. AdamX: Cosine similarity meets gradient descent

    Sep 10, 2026Francisco Caldas, Ruben Belo, Cláudia SoaresDeep Learning OptimizationAdaptive Gradient Methods