Optimizing Objective Functions from Trained ReLU Neural Networks via Sampling

Georgia Perakis, Asterios TsiourvasarXiv 2022 · DOI

Introduction

Optimizing the input to a trained neural network is a notoriously difficult non-convex problem. In fields such as robotics or reinforcement learning, the goal is often to find an input $x$ that maximizes a specific output, such as a "cost-to-go" function. Traditionally, because ReLU neural networks are piecewise linear but non-convex, this task is framed as a Mixed-Integer Programming (MIP) problem. However, standard MIP solvers like Gurobi struggle to scale as network depth or input dimensionality increases, as the underlying "branch-and-bound" search trees grow exponentially in size.

This paper introduces a scalable alternative: a sampling-based approach that exploits the piecewise linear nature of ReLU networks. By transforming a single complex optimization into a series of Linear Programs (LPs) and "mini-MIPs," the proposed method achieves superior performance in high-dimensional spaces and provides a robust "warm-start" for traditional solvers.

Methodology

The authors propose two primary algorithms based on the observation that a ReLU network defines a collection of linear regions (hyperplanes).

Sampling Algorithm

The basic sampling algorithm explores the input space by evaluating random points. For each point, a forward pass identifies the activation pattern (which neurons fire). This pattern defines a specific linear region where the function is linear. The algorithm then solves a computationally inexpensive Linear Program (LP) to find the local optimum within that region.

Enhanced Sampling Algorithm

The enhanced version incorporates a local search component. When a sampled point yields a promising result, the algorithm investigates neighboring linear regions. It achieves this by solving a "mini-MIP" where only neurons near their activation threshold (the "borderline" neurons) are allowed to change state. This allows the solver to efficiently "hop" between adjacent hyperplanes without the overhead of solving the full global MIP.

The sampling and local search process on a piecewise linear ReLU network landscape.

Crucially, the authors utilize Extreme Value Theory (EVT)—specifically von Mises’ condition—to provide analytical guarantees on convergence. This theoretical framework proves that the algorithm will find the global maximum with high probability given sufficient samples.

Experimental Evaluation

The approach was evaluated using synthetic feed-forward ReLU neural networks with one and two layers (100 neurons per layer). Weights were initialized using the uniform Xavier method. The researchers tested input dimensions ($d$) ranging from 5 to 1,000, with the input space constrained to a unit hypercube $[0, 1]^d$. These benchmarks provide a rigorous test of optimization performance against varying degrees of complexity and dimensionality.

Results and Discussion

The experimental results demonstrate the clear advantages of the sampling-based approach, particularly in high-dimensional settings.

High-Dimensional Superiority

For 2-layer networks with $d \ge 20$, the Enhanced Sampling algorithm consistently outperformed state-of-the-art MIP formulations. In several high-dimensional scenarios, the sampling approach achieved objective values 4.3% to 25% higher than the best traditional MIP methods within a fixed one-hour time limit.

Performance comparison for 2-layer ReLU networks across varying input dimensions.

Efficiency and Scalability

Unlike full MIP formulations, which often failed to produce any solution (marked as "NA" in the results) for complex networks, the sampling algorithms always yielded a result. Furthermore, the sampling approach serves as an excellent "warm-start" mechanism. Providing an initial guess from the sampling algorithm to a MIP solver led to massive improvements; for instance, the "2 Partitions" MIP method saw its final objective value improve by over 2,500% in certain 2-layer scenarios where the solver previously struggled to find any feasible solution.

Conclusion

This work bridges the gap between deep learning optimization and Extreme Value Theory. By exploiting the piecewise linear structure of ReLU networks and the sparsity of local activation changes, the proposed sampling methods offer a scalable and effective alternative to traditional global optimization techniques. Future work may extend these methods to more complex architectures like Convolutional Neural Networks (CNNs) and explore non-uniform sampling strategies to further improve efficiency.

Summary updated

BibTeX
@misc{perakis2022optimizing,
  author = {Georgia Perakis and Asterios Tsiourvas},
  title = {{Optimizing Objective Functions from Trained ReLU Neural Networks via Sampling}},
  year = {2022},
  eprint = {2205.14189},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.14189},
}
Figure