cs.FLFeb 11, 2026

Fast and General Automatic Differentiation for Finite-State Methods

Authors: Lucas Ondel Yang, Caio Corro, Nicolas Denier, Martin Kocour, Tina Raissi, Pablo Riera

Organizations: LISN, CNRS · Université Paris-Saclay, CNRS, Laboratoire Interdisciplinaire du Numérique, Orsay, France · INSA Rennes, IRISA, ARCHIMEDIA · INSA Rennes, IRISA, CNRS, Université de Rennes, Rennes, France · 

Abstract

We propose a new method, that we coined the ``morphism-trick'', to integrate custom implementations of vector-Jacobian products in automatic differentiation softwares, applicable to a wide range of semiring-based computations. Our approach leads to efficient and semiring-agnostic implementations of the backward pass of dynamic programming algorithms. For the particular case of finite-state methods, we introduce an algorithm that computes and differentiates the ⊕\oplus-sum of all paths' weight of a finite-state automaton. Results show that, with minimal effort from the user, our novel library allows computing the gradient of a function w.r.t. to the weights of a finite state automaton orders of magnitude faster than state-of-the-art automatic differentiation systems. Implementations are made available via an open-source library distributed under a permissive license.

Explore similar work

CardsList
  1. SoftJAX & SoftTorch: Empowering Automatic Differentiation Libraries with Informative Gradients

    Mar 9, 2026Anselm Paulus, A. René Geist, Vít Musil +3Straight-Through EstimatorDifferentiable Programming

  2. asdex: Automatic Sparse Differentiation in JAX

    Oct 8, 2026Adrian Hill, Guillaume DalleAutomatic DifferentiationStructured Sparsity

  3. Floating-Point Networks with Automatic Differentiation Can Represent Almost All Floating-Point Functions and Their Gradients

    May 3, 2026Sejun Park, Yeachan Park, Geonho HwangAutomatic DifferentiationNeural Network Approximation Theory