Evolutionary algorithms as an alternative to backpropagation for supervised training of Biophysical Neural Networks and Neural ODEs

James Hazelden, Yuhan Helena Liu, Eli Shlizerman, Eric Shea-BrownarXiv 2023 · DOI · arXiv

Abstract

Training biophysically realistic neural networks has long been a challenge because standard backpropagation (BP) fails when faced with the "stiff," explosive dynamics of biological spikes. This paper demonstrates that Evolutionary Strategies (ES)—a gradient-estimation technique that treats the network as a black box—can successfully train these complex models where backprop diverges. ES offers a memory-efficient and robust alternative for computational neuroscience and Neural ODEs, bypassing the issues of gradient explosions and numerical irreversibility.

Introduction

In modern machine learning, backpropagation is the ubiquitous engine of optimization. However, in computational neuroscience, the goal is often to simulate "biophysical" neurons—models like Hodgkin-Huxley that use differential equations to mimic real ion channels and electrical spikes. These models are notoriously "stiff" and nonlinear, presenting three primary obstacles for gradient-based training:

  1. Gradient Explosions: The rapid "jump" of a neural spike creates near-infinite derivatives, causing gradients to blow up.
  2. Numerical Irreversibility: Efficient BP methods for ODEs often require "reversing" time to calculate gradients. For biological models, small numerical errors in reverse-time simulation grow exponentially, rendering the calculated gradients useless.
  3. Memory Bloat: Standard Backpropagation Through Time (BPTT) requires storing every intermediate state. For simulations lasting thousands of timesteps, this quickly exceeds GPU memory limits.

Methods: Evolutionary Strategies

To address these challenges, we propose using Evolutionary Strategies (ES), specifically a score function estimator approach. Unlike BP, which calculates an exact gradient by differentiating through every operation, ES treats the model as a black box.

Gradient estimation in Evolutionary Strategies (ES). The method estimates the gradient by sampling the loss landscape around current parameters, effectively smoothing non-differentiable or 'stiff' regions.

The ES process involves three main steps:

  • Perturbing: The current model parameters are perturbed with random noise to create a population of "noisy" network versions.
  • Evaluating: A forward pass is executed for all versions to evaluate their performance.
  • Estimating: Using the "log-trick" (a Monte Carlo gradient estimation), the algorithm identifies the direction in parameter space that improves the "smoothed" average loss.

Because ES only requires the forward pass, it never needs to differentiate through a spike or reverse an ODE. This naturally "smooths" a jagged, noisy loss landscape into a navigable surface.

Experimental Setup

The approach was evaluated on four distinct benchmarks:

  1. Single-Neuron "Turn-Off" Task: A Morris–Lecar neuron must learn to stop spiking by adjusting its input current.
  2. Discrete Evidence Integration: A recurrent network of Morris–Lecar neurons accumulates noisy inputs to make a decision, mimicking classic working memory tasks.
  3. Cubic Oscillator: A non-stiff Neural ODE benchmark used to test scaling in over-parameterized regimes.
  4. ROBER Problem: A classic "stiff" chemical reaction ODE that is notoriously difficult for standard gradient methods.

Key Results

The experiments revealed several advantages of ES over traditional BP:

  • Robustness to Explosive Dynamics: In the evidence integration task, BP failed to converge when neuron parameters produced sharp spikes. In contrast, ES maintained stable convergence, reaching over 95% accuracy.
  • Memory Efficiency: For a 1-second simulation, BP required over 25 GB of RAM. ES operated with a tiny, constant memory footprint regardless of simulation length.
  • Superior Scaling: On the cubic oscillator task, ES outperformed BP as the number of parameters increased, suggesting better global exploration in high-dimensional spaces.
  • Solving Stiff ODEs: ES successfully trained networks to approximate the ROBER stiff ODE, where direct BP often becomes unstable due to massive disparities in timescales.

Discussion and Limitations

The primary drawback of ES is sample efficiency. While BP provides a precise gradient from a single pass, ES requires many "noisy" trials (typically $S=100$) to obtain a reliable estimate. This makes the method highly parallelizable but computationally intensive without significant hardware resources.

Future work includes combining ES with biologically plausible local learning rules and testing on heterogeneous networks with diverse neuron types. Furthermore, because ES is agnostic to the underlying code, it could be used to train models within specialized simulators like NEURON or Brian2 that lack native autodiff support.

Summary updated

Abstract

Training networks consisting of biophysically accurate neuron models could allow for new insights into how brain circuits can organize and solve tasks. We begin by analyzing the extent to which the central algorithm for neural network learning -- stochastic gradient descent through backpropagation (BP) -- can be used to train such networks. We find that properties of biophysically based neural network models needed for accurate modelling such as stiffness, high nonlinearity and long evaluation timeframes relative to spike times makes BP unstable and divergent in a variety of cases. To address these instabilities and inspired by recent work, we investigate the use of "gradient-estimating" evolutionary algorithms (EAs) for training biophysically based neural networks. We find that EAs have several advantages making them desirable over direct BP, including being forward-pass only, robust to noisy and rigid losses, allowing for discrete loss formulations, and potentially facilitating a more global exploration of parameters. We apply our method to train a recurrent network of Morris-Lecar neuron models on a stimulus integration and working memory task, and show how it can succeed in cases where direct BP is inapplicable. To expand on the viability of EAs in general, we apply them to a general neural ODE problem and a stiff neural ODE benchmark and find again that EAs can out-perform direct BP here, especially for the over-parameterized regime. Our findings suggest that biophysical neurons could provide useful benchmarks for testing the limits of BP-adjacent methods, and demonstrate the viability of EAs for training networks with complex components.
BibTeX
@misc{hazelden2023evolutionary,
  author = {James Hazelden and Yuhan Helena Liu and Eli Shlizerman and Eric Shea-Brown},
  title = {{Evolutionary algorithms as an alternative to backpropagation for supervised training of Biophysical Neural Networks and Neural ODEs}},
  year = {2023},
  eprint = {2311.10869},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.10869},
}
Figure