Attack on Prompt: Backdoor Attack in Prompt-Based Continual Learning

Trang Nguyen, Anh Tran, Nhat HoAAAI 2025

Introduction

Continual Learning (CL) represents a significant frontier in artificial intelligence, aiming to develop models capable of learning new tasks sequentially without suffering from "catastrophic forgetting." Recent advancements have established prompt-based CL as a leading paradigm. Instead of storing raw data from previous tasks—which often conflicts with privacy regulations—these models utilize a pool of learnable prompts to guide a pre-trained backbone, such as a Vision Transformer, through new data distributions.

However, recent research identifies a critical security vulnerability inherent in this architecture. The authors introduce Attack on Prompt (AOP), a framework demonstrating that the very mechanism enabling models to retain knowledge across tasks also facilitates the retention of malicious instructions. In decentralized data supply chains, a single compromised supplier can inject a backdoor trigger that remains effective throughout the model's entire lifecycle.

The AOP Framework

The AOP framework is designed to be transferable, resilient, and authentic. It operates on the premise that prompt selection is the "weak link" in the CL pipeline. By manipulating the model into selecting a specific "malicious" prompt, an attacker can hijack the final prediction.

The AOP framework: A malicious supplier poisons a single task, injecting a backdoor that persists through subsequent learning stages.

The framework relies on three technical pillars:

  1. Surrogate-Based Transferability: Attackers use surrogate datasets (e.g., TinyImageNet) to optimize triggers locally, exploiting the role of prompts as label mappers to ensure the attack transfers to the victim's unknown data.
  2. Static-Dynamic Trigger Optimization: A four-stage optimization process simulates the evolving state of a continual learner. This ensures the backdoor survives as the model's internal prompt pool is updated with new tasks.
  3. Authentic Triggering via BCE Loss: By replacing standard Cross-Entropy loss with Binary Cross-Entropy (BCE) during trigger optimization, the authors eliminate inter-class competition. This creates a more robust backdoor that avoids being treated as mere adversarial noise.

Key Insights: Prompts as Vulnerabilities

The core discovery is that the "plasticity" required for continual learning makes these models ironically more susceptible to learning hidden malicious tasks. The authors treat the backdoor not as a data error, but as an additional task the model is being trained to perform.

Prompt selection distribution across tasks, showing how a specific prompt is consistently activated by the trigger despite the model learning new tasks.

As shown in the figure above, the trigger successfully forces the model to select a specific prompt (Prompt ID 2) across multiple sequential tasks (Task IDs 0-4). This consistent selection mechanism is what allows the attack to maintain a high success rate even as the model continues to learn.

Experimental Results

The effectiveness of AOP was evaluated on major benchmarks including ImageNet-R (split into 5, 10, and 20 tasks) and CUB200. The results demonstrate:

  • High Success Rates: AOP achieved an Attack Success Rate (ASR) of nearly 100% against state-of-the-art methods like L2P and DualPrompt.
  • Stealthiness: The attack maintains the model's accuracy on clean samples (ACC), making it virtually undetectable through standard performance monitoring.
  • Resilience: Unlike previous backdoor attacks (e.g., Narcissus), which often fade as the model learns new tasks, AOP's success remains stable throughout the incremental learning process.

Conclusion and Future Work

AOP highlights a significant oversight in the security of prompt-based continual learners. While the study focuses on the attack's efficacy, it underscores the urgent need for specialized defenses. Future research should explore how these vulnerabilities scale to Large Language Models (LLMs) and develop robust prompt-tuning mechanisms that can resist such targeted poisoning.

Summary updated

BibTeX
@inproceedings{nguyen2025attack,
  author = {Trang Nguyen and Anh Tran and Nhat Ho},
  title = {{Attack on Prompt: Backdoor Attack in Prompt-Based Continual Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i18.34168},
}
Figure