TL;DR
This paper introduces the Neural Zeroth-Order Kernel (NZK) to bridge the gap in understanding the training dynamics of Zeroth-Order (ZO) optimization for neural networks, which currently lack the theoretical clarity of first-order (FO) methods. The authors show that the expected NZK is time-invariant and can lead to closed-form solutions, offering a new perspective for potentially accelerating ZO training, especially when using shared random vectors.
What Problem Does This Paper Address?
Training neural networks often relies on gradient descent, which typically requires backpropagation to compute gradients. However, backpropagation can be computationally expensive and memory-intensive, especially for large models or when gradients are not directly available (e.g., in black-box optimization scenarios). Zeroth-Order (ZO) optimization offers a memory-efficient alternative by estimating gradients using only forward passes. While effective in practice, the inherent randomness in ZO gradient estimation makes its training dynamics difficult to analyze, unlike first-order (FO) methods which benefit from the well-understood Neural Tangent Kernel (NTK) theory. This paper aims to provide a theoretical framework for understanding ZO training dynamics by introducing a kernel analogous to NTK, specifically for ZO.
Methods
The core contribution is the introduction of the Neural Zeroth-Order Kernel (NZK). This kernel is designed to characterize how a model evolves in function space under ZO updates.
- Linear Models: The authors first analyze linear models. They show that the expected NZK for linear models is time-invariant and depends on the moments of the random perturbation directions used in ZO. This leads to a closed-form expression for model evolution under squared loss, similar to what NTK provides for FO methods.
- Linearized Neural Networks: The analysis is extended to linearized neural networks, demonstrating that the NZK concept can be applied to more complex architectures.
- Shared Random Vectors: A key finding is that using the same random vector for both gradient estimation and parameter updates (i.e., when $\zeta$ and $z$ are identical) can lead to significant convergence acceleration. This is a novel strategy for speeding up ZO.
Datasets
The paper uses the following datasets for evaluation:
- MNIST
- CIFAR-10
- Tiny ImageNet
Key Insights and Ideas
- Bridging the ZO-FO Gap: The NZK provides a theoretical lens to understand ZO training dynamics, making it more comparable to the well-established NTK theory for FO methods.
- Time-Invariant NZK: For linear models, the expected NZK remains constant throughout training. This stability is crucial for deriving closed-form solutions and understanding convergence behavior.
- Moment Dependence: The form of the NZK is directly influenced by the first and second moments of the random perturbation directions, offering a way to tune ZO performance.
- Acceleration via Shared Randomness: Using a single random vector for both gradient estimation and parameter updates (Corollary 2) can significantly accelerate convergence, a practical insight for improving ZO efficiency.
- Hierarchical Structure Insight: The paper explores how ZO handles hierarchical layer structures, suggesting that layer-by-layer estimation is interchangeable with full parameter estimation, with memory trade-offs.
Key Results
- Closed-form dynamics: The paper derives closed-form expressions for model evolution under squared loss for both linear and linearized neural networks using the NZK.
- Empirical Validation: Extensive experiments on synthetic and real-world datasets (MNIST, CIFAR-10, Tiny ImageNet) validate the theoretical findings.
- Acceleration Demonstrated: Experiments show that using a single shared random vector for ZO can accelerate convergence compared to using independent random vectors. For instance, Figure 1 (b) shows faster convergence when $\zeta$ and $z$ are identical.
- NZK vs. NTK: The paper visually compares NTK and NZK in various scenarios (Figures 6, 10, 14, 16, 17, 18), showing how the NZK's structure relates to NTK and how it changes with different parameters.
Limitations and Future Work
- Linearized Networks: While the analysis extends to linearized neural networks, the theoretical framework is primarily developed for linear models. Extending the NZK concept to general, non-linear, finite-width neural networks remains an open challenge.
- Distributional Independence: While the paper shows that for certain conditions (e.g., zero mean, unit variance), the NZK's form is consistent across different distributions (Figure 11, 12, 13, 14), further exploration into the impact of various distributions on NZK and convergence is suggested.
- Generalization: The paper focuses on convergence dynamics. Future work could explore how the NZK relates to generalization properties of models trained with ZO.
- Practical Implementations: While the paper proposes acceleration via shared random vectors, further research could investigate optimal strategies for selecting these vectors and their impact on different network architectures and tasks.
Summary updated