跳到主要导航 跳到搜索 跳到主要内容

ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attacks

  • Zhiyao Ren
  • , Siyuan Liang*
  • , Aishan Liu*
  • , Dacheng Tao*
  • *此作品的通讯作者
  • Nanyang Technological University

科研成果: 期刊稿件会议文章同行评审

摘要

In-context learning (ICL) has demonstrated remarkable success in large language models (LLMs) due to its adaptability and parameter-free nature. However, it also introduces a critical vulnerability to backdoor attacks, where adversaries can manipulate LLM behaviors by simply poisoning a few ICL demonstrations. In this paper, we propose, for the first time, the dual-learning hypothesis, which posits that LLMs simultaneously learn both the task-relevant latent concepts and backdoor latent concepts within poisoned demonstrations, jointly influencing the probability of model outputs. Through theoretical analysis, we derive an upper bound for ICL backdoor effects, revealing that the vulnerability is dominated by the concept preference ratio between the task and the backdoor. Motivated by these findings, we propose ICLShield, a defense mechanism that dynamically adjusts the concept preference ratio. Our method encourages LLMs to select clean demonstrations during the ICL phase by leveraging confidence and similarity scores, effectively mitigating susceptibility to backdoor attacks. Extensive experiments across multiple LLMs and tasks demonstrate that our method achieves state-of-the-art defense effectiveness, significantly outperforming existing approaches (+26.02% on average). Furthermore, our method exhibits exceptional adaptability and defensive performance even for closed-source models (e.g., GPT-4).

源语言英语
页(从-至)51436-51449
页数14
期刊Proceedings of Machine Learning Research
267
出版状态已出版 - 2025
活动42nd International Conference on Machine Learning, ICML 2025 - Vancouver, 加拿大
期限: 13 7月 202519 7月 2025

学术指纹

探究 'ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attacks' 的科研主题。它们共同构成独一无二的学术指纹。

引用此