Multi-task Adversarial Attacks against Black-box Model with Few-shot Queries

Wenqiang Wang, Yan Xiao, Hao Lin, Yangshijie Zhang, Xiaochun Cao

Abstract

This paper introduces CEMA (Cluster and Ensemble Multi-task Text Adversarial Attack), a novel framework designed to compromise multi-task black-box models—such as ChatGPT or commercial translation APIs—using a remarkably small number of queries. By leveraging a "deep-level attack hypothesis," CEMA simplifies complex multi-task outputs into binary clusters to train effective substitute models. Experimental results demonstrate that CEMA achieves state-of-the-art (SOTA) attack success rates with as few as 100 queries, significantly outperforming existing methods that require thousands of interactions.

Introduction

Most existing adversarial attacks on text models assume a "white-box" scenario or require extensive querying of a "black-box" API to succeed. However, real-world AI agents like ChatGPT-4o or Claude 3.5 are black boxes with strict query limits and often perform multiple tasks simultaneously (e.g., translation and summarization). CEMA addresses the dual challenges of query efficiency and task diversity by exploiting the intrinsic features shared across different tasks. By attacking these fundamental hidden features, a single perturbation can effectively disrupt multiple downstream tasks.

Methodology

The CEMA framework operates in three main stages, as illustrated in the architecture overview:

  1. Deep-level Substitute Model Training: Instead of mimicking complex multi-task outputs, CEMA uses a small set of auxiliary texts and their corresponding victim model outputs. These are vectorized and processed via Spectral Clustering to generate binary "deep-level labels," which are then used to train a simple binary classification substitute model.
  2. Candidate Generation: CEMA employs an ensemble of established attack methods (e.g., Hotflip, FD, and TextBugger) to generate a pool of potential adversarial texts based on the substitute model.
  3. Transferability-Oriented Selection: To ensure effectiveness against the actual victim model, CEMA trains multiple versions of the substitute model on different data subsets. It selects the candidate that successfully fools the highest number of these models, maximizing transferability.
Overview of the CEMA framework including deep-level substitute training, candidate generation, and selection.

Experimental Setup

The researchers evaluated CEMA using standard benchmarks including SST5 (sentiment classification) and Emotion (categorization). Scalability was tested on a "six-task" dataset involving translation, summarization, and text-to-image generation. Victim models included state-of-the-art LLMs (ChatGPT-4o, Claude 3.5) and commercial APIs from Baidu and Alibaba.

Key Results

CEMA demonstrated superior performance across all metrics. On classification tasks, it achieved an Attack Success Rate (ASR) of over 80% with only 100 queries. Against LLMs, it maintained high ASR while significantly degrading translation quality (measured by BLEU scores).

Comparative performance of CEMA against baseline methods on SST5 and Emotion datasets.

As shown in the comparative analysis, CEMA drastically reduces the total query count (Total-Qry) to a fixed 100 while maintaining or exceeding the ASR and BLEU degradation of methods requiring tens of thousands of queries. For instance, on the SST5 dataset against Victim Model A, CEMA achieved a 73.57% ASR with 100 queries, compared to the next best baseline, HQA, which reached 46.11% ASR but required over 64,000 queries.

Conclusion

CEMA proves that attacking fundamental hidden features is a highly efficient strategy for compromising multi-task black-box models. While the framework introduces some computational overhead for training substitute models, its extreme query efficiency makes it a potent threat to commercial AI services. Future research will focus on extending CEMA to other domains, such as computer vision and multi-modal systems.

Summary updated

BibTeX
@inproceedings{wang2025multi,
  author = {Wenqiang Wang and Yan Xiao and Hao Lin and Yangshijie Zhang and Xiaochun Cao},
  title = {{Multi-task Adversarial Attacks against Black-box Model with Few-shot Queries}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure