SEP-Attack: A Simple and Effective Paradigm for Transfer-Based Textual Adversarial Attack

Han Liu, Zhi Xu, Xiaotong Zhang, Feng Zhang, Xiaoming Xu, Wei Wang, Fenglong Ma, Hong Yu

TL;DR

SEP-Attack is a highly efficient transfer-based black-box adversarial attack for text models. By leveraging Determinantal Point Processes (DPP) to generate diverse ensemble weights and selecting adversarial candidates situated in "flat" loss regions, it achieves state-of-the-art attack success rates against deep neural networks, defense mechanisms, and commercial LLMs while requiring minimal queries.

What Problem Does This Paper Address?

Deep learning models and Large Language Models (LLMs) are increasingly deployed for critical web tasks like content moderation and misinformation detection. However, they remain highly vulnerable to adversarial attacks—subtle, human-imperceptible perturbations that trick models into making incorrect predictions.

In real-world scenarios, attackers rarely have access to a model's internal architecture or weights (white-box), nor can they endlessly query an API due to rate limits and detection systems (query-based black-box). This makes transfer-based black-box attacks particularly dangerous: they craft adversarial examples entirely on local "surrogate" models and transfer them to the target "victim" model without any direct interaction.

While transfer attacks have flourished in computer vision, they struggle in natural language processing (NLP) because text is discrete. Current ensemble-based text attacks suffer from two main flaws:

  1. Equal Treatment: They treat all surrogate models in an ensemble equally, ignoring varying transferability.
  2. Context Destruction: They estimate word importance by deleting words one by one, which alters the sentence context and leads to inaccurate importance scores.

Methods

The authors introduce SEP-Attack, a three-stage framework designed to overcome these limitations.

Overview of the SEP-Attack framework

1. Diversity-Based Surrogate Ensemble Weights

Instead of assigning equal weights to all surrogate models, SEP-Attack uses a Determinantal Point Process (DPP) to sample a diverse subset of weight vectors from a randomly generated weight space. This diversification ensures that the generated adversarial examples span a wide variety of model vulnerabilities rather than clustering around a single model's quirks.

2. Generating Adversarial Candidates (Overshoot and Prune)

To fix the context-destruction problem of standard word-deletion methods, SEP-Attack introduces a temporary budget-release strategy:

  • Order Determination: It calculates word importance using a scaled softmax function to amplify subtle differences in long texts.
  • Updating (Overshoot): It iteratively replaces words with synonyms based on this order, allowing the perturbation distance to temporarily exceed the target budget ($\eta > \epsilon$). This expands the search space to find truly impactful words.
  • Removing (Prune): It then systematically reverts the least important words back to their original forms until the text fits back within the strict adversarial budget ($\epsilon$).

3. Selecting Transferable Adversarial Examples

Not all successful local attacks transfer well. The authors observe that adversarial examples located in sharp local optima on the surrogate ensemble fail to generalize to the victim model. SEP-Attack quantifies a candidate's transferability by evaluating the "flatness" of its discrete neighborhood (replacing words with synonyms and averaging the confidence scores). Candidates in flatter loss regions are selected as the final adversarial examples.

Variation of confidence scores between sharp and flat regions

Datasets

The framework was evaluated on four benchmark text classification datasets:

  • MR: Movie review dataset for short-text binary sentiment classification.
  • AG: News topic classification dataset spanning four categories (short-text).
  • Yelp: Business review dataset for long-text binary sentiment classification.
  • IMDB: Movie review dataset for long-text binary sentiment classification.

Key Insights and Ideas

  • The Flatness Advantage: Adversarial examples that lie in a flat local minimum of the surrogate ensemble's loss landscape transfer significantly better to unknown victim models than those in sharp valleys.
  • Context Preservation Matters: Allowing a temporary "overshoot" of the perturbation budget during word replacement preserves context better than standard greedy deletion methods, yielding far more accurate word importance metrics.
  • Ensemble Diversity via DPP: Random or uniform ensemble weighting limits attack diversity. Using DPP mathematically guarantees a representative yet highly distinct set of surrogate configurations.

Key Results

SEP-Attack was tested against standard models (BERT, LSTM, TextCNN), robust defense models (HotFlip, SHIELD), real-world commercial APIs (Alibaba Cloud, Google Cloud), and state-of-the-art LLMs (Llama-3-8B, Mistral-7B, GPT-3.5).

  • Superior Success Rates with Fewer Queries: Query-based methods were given a budget of 100 queries, while ensemble/transfer methods (including SEP-Attack) were restricted to just 10 queries. Despite this, SEP-Attack consistently outperformed all baselines. On the long-text IMDB dataset, it achieved an Attack Success Rate (ASR) of 99.1% against BERT, outperforming the closest transfer baseline (HAWR) by over 73%.
  • Bypassing Defenses: Against a BERT model hardened with SHIELD defense on the IMDB dataset, SEP-Attack achieved a near-perfect 97.9% ASR, whereas other transfer methods hovered around 16-30%.
  • Commercial APIs & LLMs: When attacking commercial sentiment APIs using a 100-sample subset of Yelp, SEP-Attack achieved a 75.3% ASR on Google Cloud. On Llama-3-8B, it achieved a 65.0% ASR on Yelp, vastly outperforming standard ensemble methods (9.1%).
Attack Success Rate across different query budgets

Limitations and Future Work

While highly effective, the authors note that the current formulation relies heavily on synonym substitution sets, which can occasionally face constraints in vocabulary coverage. For future work, they plan to delve deeper into the theoretical foundations of transferability in discrete spaces and extend the SEP-Attack paradigm to multimodal models (e.g., image-text safety alignment bypassing).

Summary updated

BibTeX
@inproceedings{liu2026sep,
  author = {Han Liu and Zhi Xu and Xiaotong Zhang and Feng Zhang and Xiaoming Xu and Wei Wang and Fenglong Ma and Hong Yu},
  title = {{SEP-Attack: A Simple and Effective Paradigm for Transfer-Based Textual Adversarial Attack}},
  booktitle = {The Web Conference},
  year = {2026},
  doi = {10.1145/3774904.3793042},
}
Figure