Evolutionary optimization of deep learning activation functions

Garrett Bingham, William Macke, Risto Miikkulainen

Introduction

In the architecture of deep neural networks, the activation function serves as a critical "gatekeeper," governing the non-linear transformation of signals and the subsequent flow of information through neurons. For over a decade, the Rectified Linear Unit (ReLU) has remained the industry standard due to its computational simplicity and its ability to mitigate the vanishing gradient problem. However, manual engineering of alternatives—such as Swish or Leaky ReLU—is a slow, intuition-driven process that often yields marginal gains.

This research explores a paradigm shift: treating activation function design as a searchable "metalearning" dimension. By employing evolutionary algorithms, the authors demonstrate that it is possible to automatically discover novel, tree-based activation functions that consistently outperform human-engineered baselines across various architectures and datasets.

Methodology

Function Representation and Search Space

The researchers represent activation functions as trees of mathematical operators, a technique rooted in genetic programming. These trees are constructed from a library of unary operators (e.g., $\sin(x)$, $\log(|x|)$, $\text{erf}(x)$) and binary operators (e.g., $x_1 + x_2$, $\max\{x_1, x_2\}$).

Tree-based representation of an activation function using unary and binary operators.

The study defined two distinct search spaces:

  • $S_1$: A constrained space of simple functions with approximately 3,400 possibilities.
  • $S_2$: A vast space of complex, nested functions exceeding 41 billion possibilities.

Evolutionary Strategy

The optimization process utilized a population-based approach driven by two primary genetic operators:

  1. Mutation: Randomly replacing a node within a tree with a different operator.
  2. Crossover: Swapping subtrees between two "parent" functions to produce offspring.

To evaluate "fitness," candidate functions were integrated into a Wide Residual Network (WRN) and trained on a target dataset. A key methodological insight was the transition from accuracy-based fitness to loss-based fitness. The authors found that validation loss provides a more granular signal, effectively penalizing poor-performing candidates that might otherwise appear similar in raw accuracy metrics.

Experimental Results

The approach was rigorously tested on the CIFAR-10 and CIFAR-100 benchmarks using WRN-28-10 and WRN-40-4 architectures.

Performance Gains

On the challenging CIFAR-100 dataset, the best evolved functions achieved a median accuracy of 74.2%, a statistically significant improvement over ReLU's 73.2%. In the specific testing environment used, these evolved functions also proved more stable than Swish, which occasionally caused training stalls. Independent t-tests yielded $p$-values as low as $10^{-16}$, confirming that the performance boosts were not due to stochastic variance.

Characteristics of Evolved Functions

Analysis of the high-performing evolved functions revealed several recurring traits:

  • Smoothness: Unlike the sharp "kink" found in ReLU at $x=0$, many evolved functions are smooth and differentiable everywhere. This characteristic likely facilitates more stable gradient descent during the training process.
  • Complexity: Evolution frequently discovered highly unintuitive, complex strings of operations. While seemingly "messy" to a human designer, these structures proved highly effective at optimizing the network's learning dynamics.
A visualization of a smooth, non-linear activation function discovered in the 4th generation of evolution.

Discussion and Key Insights

The Power of Specialization

While functions evolved on CIFAR-10 demonstrated strong generalization when moved to CIFAR-100, the highest performance was achieved through specialization. Functions evolved specifically for a particular architecture and dataset combination consistently outperformed general-purpose alternatives. This suggests that the future of neural network optimization may involve "evolving on the fly" to tailor components to specific tasks.

Limitations and Future Directions

The primary barrier to widespread adoption is computational cost; the search process required approximately 2,000 GPU hours for just 10 generations. Furthermore, the current study utilized balanced tree structures. Future research into asymmetric trees and more flexible architectures may unlock even more efficient functions. While this study focused on computer vision, the authors suggest that the true potential of evolutionary discovery lies in specialized domains like Natural Language Processing (NLP) and Reinforcement Learning (RL), where standard activations may be even less optimal.

Summary updated

BibTeX
@inproceedings{bingham2020evolutionary,
  author = {Garrett Bingham and William Macke and Risto Miikkulainen},
  title = {{Evolutionary optimization of deep learning activation functions}},
  booktitle = {GECCO},
  year = {2020},
  doi = {10.1145/3377930.3389841},
}
Figure