Optimizing Neural Networks with Gradient Lexicase Selection

Li Ding, Lee Spector

Researchers have developed Gradient Lexicase Selection (GLS), a new optimization framework that combines the efficiency of gradient descent with the diversity-preserving power of evolutionary "lexicase selection." By forcing models to compete on individual training cases rather than just average scores, this method helps neural networks avoid local optima and learn more robust, diverse representations, leading to better generalization on image classification tasks.

The Problem: The "Compromise" Trap

In standard deep learning, models are trained by minimizing an aggregated loss (like Cross-Entropy). We take a batch of images, calculate the average error, and nudge the model weights to reduce that average.

The authors argue this creates a "compromise" problem. Imagine a batch of 10 images where a model gets 9 perfectly right but fails miserably on the 10th. An aggregated loss might produce gradients that tell the model to ignore that 10th "hard" case just to keep the high scores on the other 9. This leads to models that "seek compromises," potentially getting stuck in local optima and failing to generalize to truly diverse data. In evolutionary computation, problems where you cannot afford to fail on even one case are called "uncompromising problems."

The Solution: Gradient Lexicase Selection (GLS)

To address this, the authors propose Gradient Lexicase Selection (GLS), which treats training as an evolutionary process with two main steps:

Gradient Lexicase Selection Framework
  1. Mutation via Subset Gradient Descent (SubGD): Instead of random mutations (like adding noise), the parent model is cloned into a population of $p$ offspring. Each offspring is trained for one epoch on a unique, non-overlapping subset of the training data using standard gradient descent. This ensures each "child" evolves in a slightly different direction.
  2. Lexicase Selection: This is the "survival of the fittest" phase, but with a twist. Instead of picking the model with the best average accuracy, the algorithm:
  3. Shuffles the training cases into a random sequence.
  4. Evaluates all candidates on the first case.
  5. Discards any candidate that doesn't perform as well as the best one on that specific case.
  6. Moves to the next case with the survivors and repeats until only one model remains.

This process prioritizes "specialists"—models that might have lower average scores but are the only ones capable of solving specific, difficult examples.

Key Insights and Mechanisms

  • The Power of the Specialist: Standard training favors "generalists" that are okay at everything. Lexicase selection protects "specialists" that have discovered unique features necessary for hard cases, preventing those features from being averaged out of existence.
  • Representation Diversity: Qualitative analysis showed that GLS-trained networks have a "flatter" distribution of internal activations. While standard models often have many "dead" neurons (zero activation), GLS models use their internal capacity more diversely.
  • Momentum Matters: The authors found that "Resetting Momentum" at the start of each generation was crucial. If momentum is inherited, it carries over the "average" direction from the previous generation, which can interfere with the fine-grained selection pressure of the lexicase process.
  • The MobileNet Exception: Interestingly, the method failed to improve MobileNetV2. The authors suggest this is because MobileNet is already a highly constrained, "compact" architecture. There may be less "room" for diverse representations to emerge when the parameter count is strictly limited.

Experimental Results

The framework was evaluated on three standard computer vision benchmarks (CIFAR-10, CIFAR-100, and SVHN) across six popular architectures, including VGG16, ResNet, DenseNet, and EfficientNet.

Performance comparison across datasets and architectures
  • Consistent Gains: GLS improved test accuracy across almost all architectures. For example, on CIFAR-10, it provided a boost of +0.55% for VGG16 and +0.68% for SENet18 over standard SGD baselines.
  • Robustness: The method proved robust to different population sizes ($p=2, 4, 6, 8$). Even a small population of 2 or 4 candidates was enough to see significant generalization benefits.
  • Outperforming Other Selection Methods: When compared to "Tournament Selection" (which uses aggregated fitness) or "Random Selection," Lexicase Selection was the clear winner, proving that the specific mechanism of filtering by individual cases is the "secret sauce."

Limitations and Future Directions

While highly effective, GLS comes with a computational cost. Training multiple offspring in each generation is computationally expensive. While this can be mitigated by parallelizing the training of offspring across multiple GPUs, it still requires more raw hardware than a single-model run. Additionally, as seen with MobileNetV2, the method might be sensitive to architectures that are already extremely optimized for size.

Looking forward, the authors suggest integrating GLS into Neural Architecture Search (NAS), where the selection process could help evolve not just the weights, but the very structure of the network to be more uncompromising.

Reference: Ding, L., & Spector, L. (2022). Optimizing Neural Networks with Gradient Lexicase Selection. Published as a conference paper at ICLR 2022.

Summary updated

BibTeX
@inproceedings{ding2022optimizing,
  author = {Li Ding and Lee Spector},
  title = {{Optimizing Neural Networks with Gradient Lexicase Selection}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=wa4VlAPkeJ},
}
Figure