Differentiating Functions of the Jacobian with Respect to the Weights

Gary William Flake, Barak A. Pearlmutter

Executive Summary

The J-prop algorithm provides a highly efficient way to train neural networks based on the properties of their Jacobian matrix (the matrix of first-order derivatives). By using a clever differential operator trick, J-prop allows researchers to optimize complex functions of these derivatives with a computational cost only a small constant factor greater than standard backpropagation.

Introduction & Motivation

In standard machine learning, we usually care about the mapping from input $x$ to output $y$. However, in many advanced applications, the sensitivity of the output to the input—represented by the Jacobian matrix ($J$)—is just as important.

For example:

  • Invariance: You might want a model to be insensitive to small rotations or shifts in an image (Tangent Prop).
  • Regularization: You might want to penalize large derivatives to prevent overfitting (Double Backpropagation).
  • System Dynamics: In robotics or signal processing, you might need to optimize specific properties of the system's Jacobian, like its eigenvalues or determinant.

The challenge is that the Jacobian can be massive, and differentiating through it to update model weights is traditionally computationally expensive and mathematically messy. The authors aim to provide a unified, efficient framework to handle these "derivative-of-a-derivative" problems.

The J-prop Algorithm

The core of the paper is the J-prop algorithm. Its "secret sauce" is the use of a specific differential operator, $R_v\{\cdot\}$, which computes the directional derivative of a function in the input space.

The authors' approach follows these steps:

  1. Auxiliary Error Function: They define a "fake" error function $\tilde{E}$ that, when differentiated, yields the product of the Jacobian and a vector.
  2. The $R$-operator Trick: Instead of calculating the full Jacobian matrix, they apply the $R_v$ operator to the gradient of this auxiliary function. This allows them to compute the exact weight updates needed to optimize the Jacobian's properties.
  3. Algorithmic Efficiency: The resulting process looks very similar to standard backpropagation. It involves a modified forward pass and a modified backward pass. Crucially, the time complexity is $O(1)$—meaning it takes roughly the same amount of time as a standard gradient evaluation, rather than scaling poorly with the number of inputs or outputs.

This method generalizes and unifies previous disparate techniques like Tangent Prop and Double Backpropagation into a single mathematical framework.

Experimental Setup

The paper focuses on the theoretical derivation and uses a synthetic toy problem for verification:

  • Synthetic 1D Function: The authors trained a Multi-Layer Perceptron (MLP) using 100 data points where the "target" was not the function value, but the target derivative: $3 \cos(3x) + 5 \cos(10x)$.
  • The input range was restricted to $[-1, 1]$.

Core Concepts

  • Input-Space vs. Weight-Space: While previous work used similar operators to calculate Hessian-vector products in weight space, this paper applies the logic to the input space. This shift is what makes it possible to efficiently handle the Jacobian.
  • Exact, Not Approximate: Unlike "training with noise," which tries to encourage smoothness heuristically, J-prop calculates the exact partial derivatives required to reach a specific Jacobian target.
  • Learning from Shape: You don't need to actually see the function values to learn the function's shape. If you have the derivatives, you can recover the "wiggliness" of the function, even if the absolute vertical position (the integration constant) remains unknown.

Experimental Results

The primary result is the algorithm itself, but the experimental section provides a striking visual proof of concept.

True function vs approximation and their derivatives
  • Learning from Derivatives Alone: The MLP successfully learned to match the complex, oscillating target derivative almost perfectly.
  • Qualitative Success: As shown in the figure above, the model's output function looked nothing like the "true" function in terms of absolute position (because it never saw the $y$-values), but its slope at every point was a near-perfect match for the target.
  • Computational Speed: The authors confirm that the "J-forward" and "J-backward" passes are nearly identical in complexity to standard passes, making this practical for large-scale models.

Limitations & Future Directions

  • Optimization Landscape: The authors note that while the math is sound, we don't yet fully understand how optimizing for Jacobian properties changes the "shape" of the loss landscape. It might make some problems easier to solve and others more prone to local minima.
  • Integration Constants: As seen in the experiment, training on derivatives alone leaves the model's absolute output undefined (it can be shifted up or down). In practice, J-prop would likely be used in combination with standard output-matching.
  • Future Applications: The authors suggest J-prop could be used for more exotic tasks, such as Blind Source Separation (by optimizing the determinant of the Jacobian) or building more robust Nonlinear Controllers in robotics.

Summary updated

BibTeX
@inproceedings{flake1999differentiating,
  author = {Gary William Flake and Barak A. Pearlmutter},
  title = {{Differentiating Functions of the Jacobian with Respect to the Weights}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {1999},
}
Figure