TL;DR
DeepZero is the first framework to successfully scale Zeroth-Order (ZO) optimization—which requires only function evaluations, not gradients—to train deep neural networks from scratch. By combining coordinate-wise gradient estimation with model pruning and clever parallelization, it achieves near-backpropagation performance on ResNet-20 and sets new benchmarks for black-box adversarial defense.
What Problem Does This Paper Address?
In the world of deep learning, backpropagation is king. It relies on "First-Order" (FO) information—gradients—to update model weights. However, we often encounter "black-box" scenarios where gradients are unavailable or impossible to compute. Examples include:
- Intricate Simulators: Physics or chemistry engines that are non-differentiable.
- Black-Box APIs: Interacting with models where you can only send an input and get a score (e.g., prompt engineering or adversarial attacks).
- Specialized Hardware: On-chip learning systems that don't support the complex memory overhead of backpropagation.
While Zeroth-Order (ZO) optimization (estimating gradients via finite differences) exists, it has historically failed to scale. As the number of parameters grows into the millions, traditional ZO methods become too slow, too noisy, or simply fail to converge.
Methods
The authors introduce DeepZero, a framework built on three core innovations designed to break the scalability barrier:
- Coordinate-wise Gradient Estimation (CGE) over RGE: Most ZO methods use Randomized vector-wise Gradient Estimation (RGE), which perturbs all parameters at once. DeepZero proves that for deep models, CGE (perturbing one coordinate at a time) is significantly more accurate and computationally efficient, especially as models get deeper.
- ZO-GraSP (Sparsity-Induced Training): To handle the high dimensionality of DNNs, DeepZero exploits the fact that deep models are often over-parameterized. They developed a ZO version of "Gradient Signal Preservation" (GraSP) to identify a sparse sub-network at initialization using only model queries. By only optimizing this sparse set of "active" parameters, they drastically reduce the number of queries needed.
- Feature Reuse and Forward Parallelization:
- Feature Reuse: Since CGE perturbs parameters layer-by-layer, DeepZero doesn't recompute the entire forward pass from scratch for every query. It reuses the "frozen" features from earlier layers, leading to a 2x speedup.
- Forward Parallelization: Because each coordinate perturbation is independent, the work can be perfectly distributed across multiple GPUs without the synchronization bottlenecks typical of standard data-parallel training.
Datasets
The authors evaluated DeepZero across three distinct domains:
- Image Classification: ResNet-20 and simple CNNs on CIFAR-10.
- Certified Adversarial Defense: A 10-class subset of ImageNet (ImageNet-10).
- Scientific Computing: A 2D unsteady wake flow fluid dynamics benchmark for partial differential equation (PDE) error correction.
Key Insights and Ideas
- The "Sparsity for Free" Realization: The authors found that you can find a high-quality sparse mask at the very beginning of training using a limited query budget. This "pruning-at-initialization" is the key to making ZO optimization tractable for models with hundreds of thousands of parameters.
- CGE is Actually Faster: While RGE seems cheaper (one query for all parameters), the mathematical "noise" it introduces in high dimensions forces the optimizer to take tiny, inefficient steps. CGE’s precision allows for much faster convergence in deep architectures.
- Breaking the Autoencoder Dependency: In black-box adversarial defense, previous SOTA methods relied on autoencoders to reduce dimensionality. DeepZero eliminates this need, allowing the optimizer to work directly on the defense operation, which preserves image fidelity and improves robustness.
Key Results
- Closing the Gap: On ResNet-20 (CIFAR-10), DeepZero achieved 86.46% accuracy. This is the best-reported result for gradient-free training from scratch, approaching the performance of standard first-order SGD.
- Adversarial Robustness: In black-box defense tasks on ImageNet, DeepZero outperformed the previous state-of-the-art (ZO-AE-DS) by 10-20% across various perturbation radii.
- Physics-Informed ML: In PDE error correction, the "ZO-SOL" (Solver-in-the-loop) approach significantly reduced numerical errors compared to non-interactive baselines, proving it can handle complex, non-differentiable simulators.
Limitations and Future Work
Despite these leaps, the authors acknowledge that ZO optimization still requires significantly more model queries than backpropagation. While they scaled to ResNet-20 (~270K parameters), scaling to "extreme-scale" models like LLMs remains a massive challenge.
Future work will likely focus on even more efficient "sparse priors" and hybrid methods that might combine limited FO information with ZO techniques to further reduce the query overhead.
Summary updated