Exploiting Class Probabilities for Black-box Sentence-level Attacks
Raha Moraffah, Huan Liu
TL;DR
The paper tackles the vulnerability of text classifiers to black-box sentence-level adversarial attacks by leveraging classifier class probabilities, a rich feedback signal often available in practice. It introduces S2B2-Attack, a score-based framework that models a continuous search space of adversarial sentences via a Variational Autoencoder (OPTIMUS) and optimizes distribution parameters with Natural Evolution Strategies, while enforcing semantic similarity through a BERTScore-based constraint. Empirical results across AG News, IMDB, and Yelp datasets with BERT, RoBERTa, and XLNet show that S2B2-Attack significantly outperforms blind, decision-based, and existing score-based baselines in attack success rate and semantic fidelity, with comparable query budgets to strong word-level attacks. The work demonstrates the practical threat posed by score-based sentence-level attacks and lays groundwork for defenses, albeit with limitations including computational cost and applicability mainly to discriminative classifiers.
Abstract
Sentence-level attacks craft adversarial sentences that are synonymous with correctly-classified sentences but are misclassified by the text classifiers. Under the black-box setting, classifiers are only accessible through their feedback to queried inputs, which is predominately available in the form of class probabilities. Even though utilizing class probabilities results in stronger attacks, due to the challenges of using them for sentence-level attacks, existing attacks use either no feedback or only the class labels. Overcoming the challenges, we develop a novel algorithm that uses class probabilities for black-box sentence-level attacks, investigate the effectiveness of using class probabilities on the attack's success, and examine the question if it is worthy or practical to use class probabilities by black-box sentence-level attacks. We conduct extensive evaluations of our attack comparing with the baselines across various classifiers and benchmark datasets.
