Skip to main content
QUICK REVIEW

[Paper Review] Randomized Automatic Differentiation

Deniz Oktay, Nick McGreivy|arXiv (Cornell University)|Jul 20, 2020
Gaussian Processes and Bayesian InferenceComputer Science34 references8 citations
TL;DR

This paper introduces Randomized Automatic Differentiation (RAD), a framework that replaces exact reverse-mode automatic differentiation with unbiased, low-memory gradient estimators by introducing randomization into the AD process. By trading memory for variance, RAD enables faster convergence in stochastic optimization—demonstrated on feedforward and recurrent neural networks, and applied to a linear PDE for reactor control with significant memory savings.

ABSTRACT

The successes of deep learning, variational inference, and many other fields have been aided by specialized implementations of reverse-mode automatic differentiation (AD) to compute gradients of mega-dimensional objectives. The AD techniques underlying these tools were designed to compute exact gradients to numerical precision, but modern machine learning models are almost always trained with stochastic gradient descent. Why spend computation and memory on exact (minibatch) gradients only to use them for stochastic optimization? We develop a general framework and approach for randomized automatic differentiation (RAD), which can allow unbiased gradient estimates to be computed with reduced memory in return for variance. We examine limitations of the general approach, and argue that we must leverage problem specific structure to realize benefits. We develop RAD techniques for a variety of simple neural network architectures, and show that for a fixed memory budget, RAD converges in fewer iterations than using a small batch size for feedforward networks, and in a similar number for recurrent networks. We also show that RAD can be applied to scientific computing, and use it to develop a low-memory stochastic gradient method for optimizing the control parameters of a linear reaction-diffusion PDE representing a fission reactor.

Motivation & Objective

  • To address the mismatch between exact gradients from traditional AD and the stochastic nature of modern optimization in deep learning.
  • To reduce memory usage in reverse-mode AD by introducing randomized estimators that trade variance for reduced storage.
  • To develop a general framework for unbiased, low-memory gradient estimation applicable to neural networks and physical simulators.
  • To demonstrate that RAD can achieve faster convergence than small-batch training under fixed memory budgets.
  • To extend the applicability of AD to large-scale scientific computing problems with high memory costs.

Proposed method

  • Proposes a randomized variant of reverse-mode AD that computes unbiased gradient estimates using random sampling of computational graph paths.
  • Applies randomization to the linearized computational graph (LCG), where edge weights (local derivatives) are stochastically subsampled to reduce memory.
  • Uses Bauer’s formula to compute Jacobians via path enumeration in the LCG, with random path selection to reduce storage of intermediate derivatives.
  • Introduces a subsampling scheme that selects a subset of paths in the LCG, maintaining unbiasedness while reducing memory footprint.
  • Employs a telescoping series estimator for intractable graphs, enabling tractable gradient estimation in complex models.
  • Applies RAD to both feedforward and recurrent neural networks, and to a linear reaction-diffusion PDE, demonstrating memory efficiency.

Experimental results

Research questions

  • RQ1Can randomized AD reduce memory usage in reverse-mode differentiation while maintaining unbiased gradient estimation?
  • RQ2How does RAD compare to small-batch training in terms of convergence speed under a fixed memory budget?
  • RQ3Can RAD be effectively applied to scientific computing problems with high memory demands, such as PDE optimization?
  • RQ4What structural properties of computation graphs enable effective randomization in AD without introducing bias?
  • RQ5How does the variance of RAD estimators compare to standard AD, and can it be controlled effectively?

Key findings

  • For feedforward networks, RAD converges in fewer iterations than small-batch training under the same memory budget.
  • For recurrent networks, RAD achieves convergence in a similar number of iterations as small-batch training, despite reduced memory usage.
  • RAD enables low-memory optimization of a linear reaction-diffusion PDE for reactor control, demonstrating applicability to scientific computing.
  • The framework maintains unbiased gradient estimation while significantly reducing memory requirements through path subsampling in the linearized computational graph.
  • RAD outperforms standard AD in memory-constrained settings by leveraging problem-specific structure to reduce storage without bias.
  • The method is generalizable and can be extended to other computation graphs, including those with nonlinearities and loops, via randomized rounding and telescoping estimators.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.