Prior Convictions: Black-Box Adversarial Attacks with Bandits and Priors

Andrew Ilyas, Logan Engstrom, Aleksander Madry

Here is a blog-style summary of the paper "Prior Convictions: Black-Box Adversarial Attacks with Bandits and Priors".

TL;DR

Generating black-box adversarial examples typically requires an impractical number of queries to estimate a model's gradients. This paper introduces a bandit optimization framework that leverages "gradient priors"—specifically, the fact that gradients are highly correlated across time and share local spatial structures in images. By integrating these priors, the proposed method reduces query complexity by 2x to 4x and cuts attack failure rates by up to 5x compared to previous state-of-the-art methods.

What Problem Does This Paper Address?

Adversarial attacks expose vulnerabilities in neural networks by introducing subtle perturbations that trick models into misclassification. While "white-box" attacks enjoy full access to a model’s internal gradients, real-world attackers usually operate in a "black-box" setting, where they can only query the model and observe the resulting loss.

To bypass this, standard black-box attacks use zeroth-order optimization (like finite differences) to estimate gradients. However, because image inputs have massive dimensionality (e.g., over 268,000 dimensions for Inception v3), estimating these gradients accurately requires an exorbitant number of queries—often hundreds of thousands.

The authors address a key question: How can we drastically reduce the number of queries needed to execute a successful black-box attack? Crucially, they demonstrate that we don't need a perfect gradient estimate to fool a network; even a highly imperfect estimator can succeed if it points in roughly the right direction.

Figure 1: The fraction of correctly estimated coordinates of sgn(∇xL(x, y)) required to successfully execute the single-step PGD (also known as FGSM) attack, with ϵ = 0.05. In the experiment, for each k, the top k percent – chosen either by magnitude (top-k) or randomly (random-k) – of the signs of the coordinates are set correctly, and the rest are set to +1 or −1 at random. The adversariality rate is the portion of 1,000 random ImageNet images misclassified after one FGSM step. Observe that, for example, estimating only 20% of the coordinates correctly leads to misclassification in the case of more than 60% of images.

Methods

The authors first prove a surprising theoretical result: current state-of-the-art black-box methods, like Natural Evolution Strategies (NES), are mathematically equivalent to a classic signal-processing primitive: the minimum-norm least-squares estimator. While information-theoretically optimal if the gradient is a completely random, unknown vector, this approach wastes queries because gradients in real-world problems are not random.

To break through this optimality barrier, the authors introduce a Bandit Optimization framework that incorporates two types of gradient priors:

  1. Time-dependent Priors: In an iterative attack, the gradient at step $t$ is highly correlated with the gradient at step $t-1$. The authors show that successive gradients along an attack trajectory share a cosine similarity of roughly 0.9.
  2. Data-dependent Priors: Because images possess spatially local similarities (neighboring pixels tend to be alike), their gradients do too. The authors exploit this by "tiling" the gradient—downsampling it via average pooling to drastically reduce the dimensionality of the search space without losing critical directional information.

Instead of re-estimating the gradient from scratch at every step, the algorithm maintains a latent variable (the bandit's state) that acts as an evolving prior. At each round, the algorithm uses a single-query or two-query spherical gradient estimator to make minor adjustments to this prior rather than reconstructing the entire vector.

Datasets

The approach was evaluated on the standard ImageNet validation set using 10,000 randomly selected images. The attacks were tested against three major pre-trained computer vision classifiers:

  • Inception v3
  • ResNet-50
  • VGG16

Key Insights and Ideas

  • The Optimality Illusion: Proving that NES is equivalent to least-squares revealed that existing methods had hit a theoretical ceiling only under the assumption of zero prior knowledge. Introducing structure was the only way forward.
  • Gradients Have Memory: The high cosine similarity between successive steps (shown below) means that yesterday's gradient is an excellent statistical predictor for today's gradient.
Figure 2: Cosine similarity between the gradients at the current and previous steps along the optimization trajectory of NES PGD attacks, averaged over 1000 random ImageNet images.
  • Dimension Reduction via Blurring: The success of the "tiling" prior proves that high-frequency details in the gradient aren't necessary to build a successful adversarial perturbation. Coarse, low-frequency directional blocks are more than enough.

Key Results

The authors evaluated two versions of their method: $\text{Bandits}_{\text{T}}$ (using only the time prior) and $\text{Bandits}_{\text{TD}}$ (using both time and data/tiling priors), comparing them against the previous SOTA (NES).

As shown in the main results table, $\text{Bandits}_{\text{TD}}$ drastically outperformed NES across both $\ell_\infty$ and $\ell_2$ threat models on Inception v3:

  • Higher Success Rates: For $\ell_\infty$ attacks, the failure rate dropped from 22.2% (NES) to 4.6% ($\text{Bandits}_{\text{TD}}$).
  • Fewer Queries: On images where both methods succeeded, $\text{Bandits}_{\text{TD}}$ required less than half the queries of NES (703 vs. 1735 queries).
Table 1: Summary of effectiveness of ℓ2 and ℓ∞ImageNet attacks on Inception v3 using NES, bandits with time prior (BanditsT ), and bandits with time and data-dependent priors (BanditsT D). Note that in the first column, the average number of queries is calculated only over successful attacks, and we enforce a query limit of 10,000 queries. For purposes of direct comparison, the last column calculates the average number of queries used for only the images that NES (previous SOTA) was successful on. Our most powerful attack uses 2-4 times fewer queries, and fails 2-5 times less often.

Importantly, these improvements generalized seamlessly to ResNet-50 and VGG16 architectures without any classifier-specific hyperparameter tuning.

Limitations and Future Work

  • Domain Dependence: The data-dependent prior (tiling) relies heavily on the spatial structure of images. Applying this framework to non-vision domains, such as natural language processing or tabular data, would require discovering entirely new domain-specific priors.
  • Hyperparameter Sensitivity: The framework introduces several new hyperparameters (e.g., exploration step size $\delta$, online learning rate $\eta$, and tile size). While the authors found robust defaults via grid search, performance could vary on vastly different model architectures.

Future work includes exploring more sophisticated bandit update mechanisms and identifying priors for non-image data types.

Summary updated

Abstract

We study the problem of generating adversarial examples in a black-box setting in which only loss-oracle access to a model is available. We introduce a framework that conceptually unifies much of the existing work on black-box attacks, and we demonstrate that the current state-of-the-art methods are optimal in a natural sense. Despite this optimality, we show how to improve black-box attacks by bringing a new element into the problem: gradient priors. We give a bandit optimization-based algorithm that allows us to seamlessly integrate any such priors, and we explicitly identify and incorporate two examples. The resulting methods use two to four times fewer queries and fail two to five times less often than the current state-of-the-art.
BibTeX
@inproceedings{ilyas2019prior,
  author = {Andrew Ilyas and Logan Engstrom and Aleksander Madry},
  title = {{Prior Convictions: Black-Box Adversarial Attacks with Bandits and Priors}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=YFLCyW6OExE},
}
Figure