Abstract
Machine learning has progressed significantly in various applications ranging from face recognition to text generation. However, its success has been accompanied by different attacks. Recently, a new attack has been proposed which raises both accountability and parasitic computing risks: the model hijacking attack. Previously, this attack focused exclusively on image classification tasks. In this work, we broaden the scope to include text generation and classification models, demonstrating its broader applicability. We propose Ditto, a new model hijacking attack that can hijack different text classification tasks into multiple generation ones, such as language translation, text summarization, and language modeling. Using a range of benchmarks (SST-2, TweetEval, AGnews, QNLI, and IMDB), our results show that an adversary can successfully hijack text generation models without jeopardizing their utility.
Introduction
Training state-of-the-art Natural Language Processing (NLP) models is prohibitively expensive, often requiring massive computational resources and vast datasets. Consequently, many organizations outsource their training processes or rely on datasets crawled from the open web. This reliance creates a significant security loophole: training-time attacks.
While previous research has focused on backdoors (causing a model to fail on specific inputs) or poisoning (degrading overall accuracy), this paper explores model hijacking. In a hijacking attack, the goal is "parasitic computing"—forcing a victim’s model to execute a secret "hijacking task" (e.g., sentiment analysis) while it appears to be performing its intended "original task" (e.g., document summarization).
Until now, hijacking attacks were limited to the image domain. Text presents a unique challenge because it is discrete; unlike images, where "invisible noise" can be added to pixels, modifying text often changes its meaning or makes it appear nonsensical to human auditors. This paper introduces Ditto, the first hijacking framework tailored for NLP.
The Ditto Attack Framework
Ditto is a task-agnostic framework that operates in two distinct phases to achieve stealthy, triggerless hijacking.
1. The Preparatory Phase
The attacker first creates a "transformed dataset." They take a dataset for their secret hijacking task (e.g., movie reviews for sentiment classification) and pass the text through a public model to generate a "pseudo-output" (e.g., a German translation).
To embed the secret signal, the attacker uses a Masked Language Model (MLM) to subtly alter this pseudo-output. They replace or insert specific "indicator" tokens—typically common stopwords like "the," "of," or "and"—that correspond to a specific label. For instance, a "Positive" sentiment label might be encoded by a specific distribution or presence of these stopwords. Because these words appear naturally in almost every sentence, their presence does not raise suspicion.
2. The Deployment Phase
The victim trains their model on a mixture of clean data and this poisoned, camouflaged data. Once the model is deployed, the attacker can send a standard query. The model generates a response that appears perfectly natural to the victim but contains the secret indicator tokens. The attacker simply counts or identifies these indicators in the output to retrieve the classification result. Crucially, Ditto is triggerless; it does not require a specific keyword to activate, making it significantly harder to detect than traditional backdoors.
Experimental Evaluation
The researchers evaluated Ditto across a wide array of standard NLP benchmarks to demonstrate its versatility:
- Hijacking Tasks (Classification): SST-2, TweetEval, AGnews, QNLI, and IMDB.
- Original Tasks (Generation): WMT16 (English-to-German translation), CNN/DailyMail (summarization), and CC-News (language modeling via GPT-2).
Key Results
- High Success, Low Impact: On a translation model (WMT16), Ditto achieved an Attack Success Rate (ASR) of up to 93.3% for topic classification. Meanwhile, the original translation quality—measured by the BLEU score—dropped by less than 1.2%, ensuring the victim remains unaware of the performance degradation.
- Stealthiness: Using t-SNE visualizations, the authors demonstrated that the poisoned "transformed" data is mathematically indistinguishable from legitimate data. This makes automated detection via outlier analysis extremely difficult.
- Resilience to Defenses: Ditto was tested against ONION, a state-of-the-art outlier detection defense. The results showed that while ONION could identify some indicators, it required a detection threshold so high that it destroyed the utility of the original model, rendering the defense impractical for real-world use.
Security and Accountability Risks
Hijacking represents more than just "free" computing for the attacker; it introduces severe accountability risks. If an attacker hijacks a company's translation API to run a toxic-content classifier, the company becomes legally and ethically responsible for the hijacked model's behavior. Furthermore, the company bears the full computational cost of the attacker's queries, effectively subsidizing the adversary's infrastructure.
Limitations and Future Work
While Ditto is highly effective, the authors noted areas for improvement. Currently, the insertion of indicator tokens can occasionally cause minor semantic shifts in the generated text. Future iterations could utilize Beam Search instead of greedy search for optimization to produce higher-quality camouflage. Additionally, the researchers suggest exploring syntactic alternatives—modifying the structure of sentences rather than just replacing words—to hide the hijacking signal even deeper within the linguistic patterns.
Conclusion
Ditto demonstrates that text generation models are highly vulnerable to hijacking attacks. By leveraging the natural frequency of stopwords and the flexibility of Masked Language Models, attackers can turn sophisticated generators into secret classifiers with minimal impact on performance. This work highlights a critical need for new defense mechanisms in the era of outsourced model training.
Summary updated