Learning to Learn by Zeroth-Order Oracle

Yangjun Ruan, Yuanhao Xiong, Sashank J. Reddi, Sanjiv Kumar, Cho-Jui Hsieh

Introduction

Most modern machine learning relies on "first-order" optimization, which uses gradients (the slope of the loss function) to find the minimum. However, in many real-world scenarios—such as attacking a "black-box" neural network where only the output is visible—gradients are inaccessible. This necessitates Zeroth-Order (ZO) optimization, which estimates gradients by querying the function at various points and observing how the output changes.

The primary challenge with standard ZO methods (like ZO-SGD) is their reliance on random sampling to estimate these gradients. In high-dimensional spaces, such as high-resolution images, this random sampling is incredibly inefficient, leading to high variance and slow convergence. To address this, the authors introduce a "Learning to Learn" (L2L) framework specifically designed for ZO optimization. Instead of using hand-designed, random sampling rules, they train Recurrent Neural Networks (RNNs) to learn both the optimization update rules and the best directions to "probe" a function.

Methods: A Dual-RNN Architecture

The authors propose a meta-learning approach utilizing two primary components to guide the optimization process:

  1. UpdateRNN: This module learns the parameter update rule. Instead of relying on a fixed learning rate, it uses an LSTM to determine how to change the parameters based on the history of previous iterations and the current estimated gradient.
  2. QueryRNN: This represents the paper's most novel contribution. In traditional ZO optimization, directions are sampled from a standard, uniform Gaussian distribution. The QueryRNN, however, learns to predict a specific covariance matrix for this distribution. This allows the optimizer to "stretch" its search area toward directions that have historically been more useful, effectively guiding the probes toward more promising areas of the loss landscape.
Architecture of the proposed ZO-LSTM optimizer, featuring the QueryRNN for variance prediction and the UpdateRNN for parameter updates.

To ensure the system is scalable, the authors employ a coordinate-wise architecture, meaning the same small RNN parameters are shared across all dimensions of the problem. During the meta-training phase, a deterministic "surrogate" gradient is used to allow backpropagation through the optimization process itself.

Datasets and Evaluation

The researchers evaluated their learned optimizer, dubbed "ZO-LSTM," on two main types of problems:

  • Black-box Adversarial Attacks: Using the MNIST and CIFAR-10 datasets, the goal was to find the smallest possible image perturbation that would trick a pre-trained, "locked" model into misclassifying an image.
  • Synthetic Binary Classification: They generated 100 different datasets for a non-convex binary classification task to test the optimizer's ability to handle stochastic settings and generalize to new, unseen problems.

Key Insights and Results

The most significant insight from this work is the importance of learning "where" to look. By introducing the QueryRNN, the model learns the underlying structure of the problem (e.g., which pixels in an image are most sensitive to change) and focuses its limited query budget there. While this introduces some bias by not searching everywhere equally, the massive reduction in variance leads to much faster convergence.

Loss curves for MNIST and CIFAR-10 adversarial attacks, demonstrating ZO-LSTM's faster convergence compared to baseline ZO methods.
  • Superior Speed and Accuracy: On black-box attacks, ZO-LSTM reached lower loss values significantly faster than baseline algorithms like ZO-SGD, ZO-signSGD, and ZO-ADAM.
  • Query Efficiency: In the CIFAR-10 attack task, ZO-LSTM achieved successful attacks with far fewer function queries than hand-designed variance-reduction methods.
  • Generalization: Surprisingly, an optimizer trained only on simple MNIST digits performed remarkably well when applied to complex CIFAR-10 color images and synthetic classification tasks. This suggests the RNNs are learning fundamental "meta-rules" of optimization rather than just memorizing a specific dataset.

Limitations and Future Work

Like many deep learning-based meta-learning papers, this work lacks a formal theoretical proof of convergence. The "black-box" nature of the RNN makes it difficult to guarantee it won't fail on extremely unusual loss landscapes. Furthermore, while the optimizer is very fast at test time, the "meta-training" phase requires significant computational resources and access to true gradients or expensive surrogate estimates. Future work will likely focus on proving convergence theoretically and refining the training methodology to make the meta-learning process more efficient.

Summary updated

BibTeX
@inproceedings{ruan2020learning,
  author = {Yangjun Ruan and Yuanhao Xiong and Sashank J. Reddi and Sanjiv Kumar and Cho-Jui Hsieh},
  title = {{Learning to Learn by Zeroth-Order Oracle}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
  url = {https://openreview.net/forum?id=kOA0OYEc0Jw},
}
Figure