NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

What to Do When Your Discrete Optimization Is the Size of a Neural Network?

Hugo Silva, Martha WhitearXiv 2024 · DOI

Abstract

Modern machine learning increasingly relies on solving discrete optimization problems at massive scales, such as pruning millions of weights or training binary neural networks. This paper investigates the performance gap between two dominant paradigms: Continuation Path (CP) methods, which use smooth relaxation and annealing, and Monte Carlo (MC) sampling methods, which treat discrete choices as probability distributions. While MC methods are theoretically principled for discrete objectives, we demonstrate a significant "scale paradox." In high-dimensional neural network tasks, CP methods decisively outperform MC estimators—even when the latter are given 100x more computational resources—due to a mathematical phenomenon we term "unwanted generalization."

Introduction

Many fundamental tasks in deep learning are essentially pseudo-Boolean (PB) optimization problems. Whether an engineer is deciding which weights to prune (binary masks), training networks with discrete activations, or isolating parameters for continual learning, they are navigating a discrete space of $2^d$ possible configurations.

When the dimensionality $d$ is small, traditional discrete algorithms like branch-and-bound or local search are effective. However, when $d$ reaches the millions—typical for modern neural networks—these methods become computationally intractable. Researchers typically resort to one of two strategies:

  1. Continuation Path (CP): Relaxing binary variables into continuous ones and gradually "hardening" them via a temperature parameter.
  2. Monte Carlo (MC): Using stochastic gradient estimators (like REINFORCE) to optimize the parameters of a distribution over the binary strings.

This paper provides the first rigorous head-to-head comparison of these approaches at the scale of deep neural networks, revealing why the heuristic success of CP often eclipses the theoretical rigor of MC.

Methodology

Optimization Families

The study categorizes discrete optimization into three primary families:

  • Continuation Path (CP): These methods utilize a sigmoid relaxation $\sigma(x/\tau)$. By starting with a high temperature $\tau$, the objective function is smoothed, making it amenable to gradient-based optimization. As $\tau$ is annealed toward zero, the variables are forced to the binary corners of the hypercube.
  • Monte Carlo (MC) Gradient Estimation: These methods treat the binary variables as independent Bernoulli trials. The paper evaluates several estimators designed to reduce variance, including REINFORCE, LOORF (Leave-One-Out), and ARMS (Antithetic REINFORCE Multi-Sample).
  • Hybrid Estimators: This includes the Straight-Through (ST) estimator and Gumbel-Softmax, which attempt to bridge the gap by combining gradient information with stochastic sampling.

To ensure these methods could be applied to modern architectures, the authors developed iterative versions of these algorithms to manage GPU memory constraints effectively.

Experimental Framework

The methods were tested across a hierarchy of complexity:

  1. Microworlds: Small-scale benchmarks ($d \approx 10$) where the ground truth optimal solution is known.
  2. Masked NN Regression: A medium-scale task where a network learns to mimic a teacher network using only binary masks.
  3. Large-Scale Pruning: Pruning LeNet on MNIST and ResNet-20/VGG on CIFAR-10.

The Scale Paradox and Unwanted Generalization

A central contribution of this work is the identification of the "Unwanted Generalization" trap. In MC methods, we typically assume variables are independent (a factorized Bernoulli distribution). The authors prove that in high dimensions, increasing the probability of a high-performing binary string inadvertently increases the probability of nearby "bad" strings.

This creates a mathematical barrier: for MC sampling to succeed in high dimensions, the optimal value must be exponentially better than the second-best value—a condition rarely satisfied in the relatively flat loss landscapes of neural networks. Conversely, while CP methods rely on a heuristic extrapolation from the center of the hypercube (0.5) to its corners (0 or 1), the overparameterized nature of neural networks makes this smooth approximation surprisingly robust.

Key Results

The Superiority of CP at Scale

In large-scale pruning experiments on CIFAR-10, CP methods consistently achieved higher accuracy at higher levels of sparsity compared to all MC variants. Remarkably, even when MC methods were granted 100 samples per step to reduce variance, they could not match the performance of a single-pass CP approach. This suggests that the failure of MC in high dimensions is not merely a matter of variance, but a fundamental structural limitation of the independent Bernoulli assumption.

The Microworld Reversal

Interestingly, the "best" algorithm was found to be entirely dependent on scale. In the $d=10$ Microworld experiments, MC methods often found superior solutions to CP. This reversal highlights why toy problems can be misleading: algorithms that excel in low-dimensional discrete optimization may fail catastrophically when scaled to the millions of parameters found in deep learning.

Sensitivity and Optimization

While CP is more effective at scale, it is also more temperamental. Its success is highly sensitive to the choice of optimizer (e.g., SGD vs. RMSprop) and the specific annealing schedule. MC methods, by contrast, showed more stability across different optimizers, even if their final performance was lower.

Conclusion

The findings suggest that for high-dimensional discrete optimization in neural networks, the smooth approximations of Continuation Path methods are currently unbeatable. The success of CP likely stems from the Lipschitz properties of neural network loss surfaces, which allow the "hints" found in the continuous relaxation to remain valid as the variables are hardened. Future work should focus on developing MC estimators that can account for variable dependencies without the prohibitive cost of full joint distribution modeling, and further exploring why specific optimizers interact so strongly with the CP annealing process.

Summary updated

BibTeX
@misc{silva2024what,
  author = {Hugo Silva and Martha White},
  title = {{What to Do When Your Discrete Optimization Is the Size of a Neural Network?}},
  year = {2024},
  eprint = {2402.10339},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.10339},
}
Figure