Query-Efficient and Scalable Black-Box Adversarial Attacks on Discrete Sequential Data via Bayesian Optimization

Deokjae Lee, Seungyong Moon, Junhyeok Lee, Hyun Oh Song

Abstract

Adversarial attacks on discrete sequential data, such as text and protein sequences, pose a significant threat to the robustness of deep learning models. In the black-box setting, where attackers have limited query access and no knowledge of model parameters, existing methods often rely on greedy heuristics that restrict the search space and lead to suboptimal results. This paper introduces the Blockwise Bayesian Attack (BBA), a query-efficient framework that leverages Bayesian Optimization (BO) with an Automatic Relevance Determination (ARD) categorical kernel. To address the computational challenges of long sequences, we incorporate block decomposition and history subsampling techniques. Our results across natural language and protein classification tasks demonstrate that BBA achieves higher attack success rates with significantly fewer queries and lower modification rates than current state-of-the-art methods.

Introduction

Deep learning models for sequential data, including Transformers like BERT and Recurrent Neural Networks (RNNs), are increasingly used in critical domains. However, these models are vulnerable to adversarial examples—inputs specifically crafted to induce incorrect predictions through minor perturbations. In many real-world scenarios, the attacker operates in a "black-box" environment, only able to observe the model's output scores for specific inputs.

Current black-box strategies typically utilize either greedy algorithms or evolutionary strategies. Greedy methods rank sequence positions by importance once and then perturb them, often failing to capture complex interactions between multiple changes. Evolutionary algorithms explore a broader space but are notoriously query-inefficient, often requiring tens of thousands of interactions with the victim model. BBA addresses these limitations by treating the attack as a global optimization problem solved via Bayesian Optimization.

Methodology: The Blockwise Bayesian Attack (BBA)

The core of BBA is the application of Bayesian Optimization to the discrete, high-dimensional space of sequence perturbations.

ARD Categorical Kernel

Standard BO kernels are often designed for continuous spaces. BBA utilizes a categorical kernel equipped with Automatic Relevance Determination (ARD). This kernel allows the surrogate Gaussian Process (GP) model to dynamically learn the sensitivity of each position in the sequence. By identifying which tokens are most influential in flipping the model's prediction, BBA focuses its search on the most promising areas of the input space.

Scalability and Efficiency

To overcome the "curse of dimensionality" and the $O(n^3)$ computational complexity of Gaussian Processes, the authors introduce two key techniques:

  1. Block Decomposition: For long sequences (e.g., IMDB reviews), the input is divided into smaller blocks. The optimization is performed sequentially across these blocks, keeping the search space manageable while still allowing for complex perturbations.
  2. History Subsampling: As the number of queries grows, training the GP becomes slower. BBA employs "Farthest Point Clustering" to select a diverse subset of historical queries, maintaining the accuracy of the surrogate model without the full computational overhead.

Refined Optimization

BBA further improves attack quality through:

  • Post-Optimization: After finding a successful adversarial example, a secondary optimization step attempts to revert unnecessary changes, minimizing the modification rate while maintaining the adversarial effect.
  • Diverse Batching: Using a Determinantal Point Process (DPP), BBA selects a batch of diverse candidate sequences to query simultaneously. This prevents the optimizer from getting trapped in local optima and ensures a broader exploration of the perturbation space.

Experimental Evaluation

The researchers evaluated BBA against several baselines, including PWWS, TextFooler, and Particle Swarm Optimization (PSO), across diverse datasets including sentiment analysis (Movie Review, IMDB, Yelp), topic classification (AG’s News), textual entailment (MNLI, QNLI), and enzyme function classification (EC50).

Key Results

BBA consistently outperformed existing methods across three primary dimensions:

  • Attack Success Rate (ASR): On the AG News dataset using a BERT-base model, BBA achieved a 77.4% success rate, significantly higher than the 57.1% achieved by PWWS.
  • Query Efficiency: BBA demonstrated a drastic reduction in query count. For instance, on AG News, BBA required approximately 5,000 queries, whereas PSO required over 65,000 to achieve a lower success rate.
  • Modification Rate: BBA found adversarial examples that were more similar to the original input. On the Yelp dataset, BBA achieved near-perfect success while modifying only 8.2% of the text, compared to 10.6% for the leading baseline.

Conclusion

The Blockwise Bayesian Attack represents a significant advancement in black-box adversarial research. By combining the global search capabilities of Bayesian Optimization with scalable techniques like block decomposition and history subsampling, BBA provides a robust and efficient method for evaluating the vulnerabilities of sequence-based models. Beyond natural language, its success in protein classification highlights its generalizability to any discrete sequential data. Future work may explore multi-GPU acceleration and the development of grammar-aware kernels to further enhance the linguistic quality of the generated attacks.

Summary updated

BibTeX
@misc{lee2022query,
  author = {Deokjae Lee and Seungyong Moon and Junhyeok Lee and Hyun Oh Song},
  title = {{Query-Efficient and Scalable Black-Box Adversarial Attacks on Discrete Sequential Data via Bayesian Optimization}},
  year = {2022},
  eprint = {2206.08575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2206.08575},
}
Figure