Table of Contents
Fetching ...

Gradient Estimation and Variance Reduction in Stochastic and Deterministic Models

Ronan Keane

TL;DR

This work develops and unifies gradient estimation for both stochastic and deterministic models via reverse differentiation, introducing a general RD framework that blends pathwise derivatives and score-function estimators. It analyzes convergence for stochastic gradient methods, demonstrates unbiased gradient estimation for diverse activation patterns and piecewise switching, and presents variance-reduction techniques (baselines, per-parameter baselines, and GAE-like schemes) to improve SGD performance. The framework is instantiated across stochastic differential equations, reinforcement learning, and traffic-flow applications, notably calibrating car-following models with an adjoint method and introducing a relaxation mechanism for lane-changing to reduce discontinuities and overreaction. The practical impact includes scalable gradient-based optimization for large, piecewise, and stochastic models, aided by differentiable traffic simulators (HAVSIM) and extensive empirical demonstrations of speed and accuracy gains over gradient-free methods. These results advance the ability to train complex models with stochastic components and discontinuities, enabling end-to-end calibration, control, and optimization in engineering and transportation systems, with broad implications for ML-assisted scientific discovery and simulation-based design.

Abstract

It seems that in the current age, computers, computation, and data have an increasingly important role to play in scientific research and discovery. This is reflected in part by the rise of machine learning and artificial intelligence, which have become great areas of interest not just for computer science but also for many other fields of study. More generally, there have been trends moving towards the use of bigger, more complex and higher capacity models. It also seems that stochastic models, and stochastic variants of existing deterministic models, have become important research directions in various fields. For all of these types of models, gradient-based optimization remains as the dominant paradigm for model fitting, control, and more. This dissertation considers unconstrained, nonlinear optimization problems, with a focus on the gradient itself, that key quantity which enables the solution of such problems. In chapter 1, we introduce the notion of reverse differentiation, a term which describes the body of techniques which enables the efficient computation of gradients. We cover relevant techniques both in the deterministic and stochastic cases. We present a new framework for calculating the gradient of problems which involve both deterministic and stochastic elements. In chapter 2, we analyze the properties of the gradient estimator, with a focus on those properties which are typically assumed in convergence proofs of optimization algorithms. Chapter 3 gives various examples of applying our new gradient estimator. We further explore the idea of working with piecewise continuous models, that is, models with distinct branches and if statements which define what specific branch to use.

Gradient Estimation and Variance Reduction in Stochastic and Deterministic Models

TL;DR

This work develops and unifies gradient estimation for both stochastic and deterministic models via reverse differentiation, introducing a general RD framework that blends pathwise derivatives and score-function estimators. It analyzes convergence for stochastic gradient methods, demonstrates unbiased gradient estimation for diverse activation patterns and piecewise switching, and presents variance-reduction techniques (baselines, per-parameter baselines, and GAE-like schemes) to improve SGD performance. The framework is instantiated across stochastic differential equations, reinforcement learning, and traffic-flow applications, notably calibrating car-following models with an adjoint method and introducing a relaxation mechanism for lane-changing to reduce discontinuities and overreaction. The practical impact includes scalable gradient-based optimization for large, piecewise, and stochastic models, aided by differentiable traffic simulators (HAVSIM) and extensive empirical demonstrations of speed and accuracy gains over gradient-free methods. These results advance the ability to train complex models with stochastic components and discontinuities, enabling end-to-end calibration, control, and optimization in engineering and transportation systems, with broad implications for ML-assisted scientific discovery and simulation-based design.

Abstract

It seems that in the current age, computers, computation, and data have an increasingly important role to play in scientific research and discovery. This is reflected in part by the rise of machine learning and artificial intelligence, which have become great areas of interest not just for computer science but also for many other fields of study. More generally, there have been trends moving towards the use of bigger, more complex and higher capacity models. It also seems that stochastic models, and stochastic variants of existing deterministic models, have become important research directions in various fields. For all of these types of models, gradient-based optimization remains as the dominant paradigm for model fitting, control, and more. This dissertation considers unconstrained, nonlinear optimization problems, with a focus on the gradient itself, that key quantity which enables the solution of such problems. In chapter 1, we introduce the notion of reverse differentiation, a term which describes the body of techniques which enables the efficient computation of gradients. We cover relevant techniques both in the deterministic and stochastic cases. We present a new framework for calculating the gradient of problems which involve both deterministic and stochastic elements. In chapter 2, we analyze the properties of the gradient estimator, with a focus on those properties which are typically assumed in convergence proofs of optimization algorithms. Chapter 3 gives various examples of applying our new gradient estimator. We further explore the idea of working with piecewise continuous models, that is, models with distinct branches and if statements which define what specific branch to use.
Paper Structure (115 sections, 19 theorems, 279 equations, 33 figures, 10 tables, 3 algorithms)

This paper contains 115 sections, 19 theorems, 279 equations, 33 figures, 10 tables, 3 algorithms.

Key Result

theorem 1

Let condition a1 hold. The gradient of eqn6 is given by where it is additionally assumed the derivative and expectation can be interchanged. Any $z_1^n, y_1^n \in Z \times Y$ corresponds to the adjoint variables $\{ \lambda_i : i=1, \ldots, n\}$ defined by the deterministic equations

Figures (33)

  • Figure 1: Predicting the next 3 days of electricity demand. Top left: Standard SDE with Huber loss. Top right: Standard SDE with MLE loss. Bottom left: Jump ODE with Huber loss. Bottom right: Piecewise ODE with Huber loss.
  • Figure 2: Top: model predictions for $\theta_0 = 2.1, \theta_1 = 0.1$ (left panel) and $\theta_0 = 1.6, \theta_1 = 0.1$ (right panel). Bottom: objective values for varying values of $\theta_0$ with $\theta_1=0.1$ (left panel), objective values for varying values of $\theta_1$ with $\theta_0 = 2.1$ (right panel).
  • Figure 3: Using SGD to solve the piecewise model. From top left to bottom right, the plots are of iteration 1, 30, 70, 100, and 200. After roughly 200 iterations we recover the deterministic solution with an expected error close to 0.
  • Figure 4: Plots of \ref{['switcheg1']}. The more timesteps flip branches at once, the larger the resulting discontinuity.
  • Figure 5: In the left panels, ouput (top) and objective/gradient (bottom) of \ref{['switcheg2']}. In the right panels, the discrete time version.
  • ...and 28 more figures

Theorems & Definitions (25)

  • theorem 1
  • theorem 2
  • lemma 1
  • theorem 3
  • theorem 4
  • theorem 5
  • theorem 6
  • proposition 1
  • lemma 2
  • lemma 3
  • ...and 15 more