Abstract
Traditional text adversarial attacks are primarily designed for static environments with fixed label spaces. However, modern Large Language Models (LLMs) and multi-label systems operate in "Dynamic Output" (DO) scenarios where the number and nature of outputs vary. This paper introduces the Textual Dynamic Outputs Attack (TDOA), a novel hard-label black-box attack framework. TDOA utilizes a clustering-based surrogate model to map dynamic outputs into static coarse-grained clusters and employs a "farthest-label" targeted strategy to maximize disruption. Our evaluations across four datasets and eight victim models, including GPT-4o and Claude, demonstrate that TDOA achieves high attack success rates (up to 50.81% with a single query) and effectively compromises both classification and generative translation tasks.
Introduction
Adversarial attacks in the textual domain have historically focused on static classification tasks, such as sentiment analysis, where a model selects a single label from a predefined set. As AI evolves toward generative LLMs and complex multi-label systems, these "static" assumptions no longer hold. Real-world models now produce dynamic outputs where the label count is variable and the content may fall outside the original training distribution. Existing query-based or transfer-based attacks struggle in these environments because they rely on tracking the probabilities of fixed labels. To address this, we propose TDOA, a method designed to bridge the gap between traditional static attacks and the unpredictable nature of modern generative AI.
The Challenge of Dynamic Outputs
Modern AI systems introduce two primary complexities that break traditional attack methods. First, multi-label models may return a varying number of labels based on the input's nuance. Second, LLMs are generative; they might return a synonym or a related concept (e.g., "Ecstatic") instead of a strict label (e.g., "Joy"). These behaviors create a "Dynamic Output" scenario where the output space is effectively unbounded or inconsistent.
As illustrated in the figure above, traditional models fail to capture the complexity of adversarial shifts in multi-label and LLM contexts. TDOA addresses this by identifying that while fine-grained labels are volatile, the underlying coarse-grained semantic categories (e.g., Positive vs. Negative) remain relatively stable. By targeting these broader categories, an attacker can reliably disrupt the model's more specific dynamic outputs.
Methodology: The TDOA Framework
The TDOA method introduces two key innovations to handle the hard-label black-box constraint, where only the final text output is visible to the attacker.
1. Clustering-based Surrogate Model
To manage "messy" dynamic labels, TDOA trains a surrogate model on coarse-grained clusters. We embed auxiliary text and the victim's dynamic outputs using a pre-trained model (such as T5) and apply K-means clustering. This process groups semantically similar outputs (e.g., "Joy," "Love," and "Happy") into a single stable cluster. This transformation simplifies the dynamic problem into a static classification task, providing a clear target for adversarial perturbation.
2. Farthest-Label Targeted Attack (FLTA)
Rather than a simple untargeted attack aimed at making the model "wrong," TDOA employs the Farthest-Label Targeted Attack strategy. The algorithm identifies the coarse-grained cluster semantically most distant from the original input. By perturbing the text to shift the model's prediction toward this distant cluster, the attack maximizes the semantic disruption while maintaining a degree of textual similarity to the original input.
Experimental Evaluation
We evaluated TDOA across diverse domains, including sentiment analysis (SST5), emotion detection, and question classification (TREC50). We also extended the framework to machine translation (Opus100), treating translation as a classification task with an infinite output space. Victim models included BERT-based architectures and state-of-the-art LLMs like GPT-4o, Claude Sonnet, and DeepSeek-V3.
To measure success in multi-label scenarios, we introduced the Label Intersection Attack Success Rate (LI-ASR). This metric calculates the proportion of original labels successfully removed or altered in the adversarial output, providing a more granular view of attack effectiveness than binary success metrics.
Key Results
- Efficiency: TDOA is highly query-efficient. Against GPT-4o, it achieved a 50.81% success rate with only a single query. With five queries, success rates exceeded 80% on several datasets.
- Superiority in Multi-Label Tasks: TDOA outperformed existing hard-label attacks by an average of 16.81% on the LI-ASR metric.
- Generative Impact: In translation tasks, TDOA set new benchmarks, achieving a significant Relative Decrease in BLEU score (up to 0.64 RDBLEU), indicating a substantial degradation in translation quality.
- Defensive Resilience: The attack remained potent against common defenses like "Self-reminder" and "Paraphrasing," maintaining success rates between 30% and 45%.
Conclusion
The shift from static to dynamic outputs in AI necessitates a corresponding evolution in adversarial research. TDOA demonstrates that by leveraging semantic clustering and targeted farthest-label strategies, attackers can compromise even the most advanced LLMs with minimal queries. These findings highlight a critical vulnerability in current generative systems and underscore the need for more robust, adaptive training strategies to defend against semantic-shifting attacks.
Summary updated