BAM-ICL: Causal Hijacking In-Context Learning with Budgeted Adversarial Manipulation

Rui-Kai Chu, Bingyin Zhao, Han Jiang, Shuchin Aeron, Ying-Jie Lao
1/1/2025

No confident code implementation found for this paper.

Abstract

Recent research shows that large language models (LLMs) are vulnerable to hijacking attacks under the scenario of in-context learning (ICL) where LLMs demonstrate impressive capabilities in performing tasks by conditioning on a sequence of in-context examples (ICEs) (i.e., prompts with task-specific input-output pairs). Adversaries can manipulate the provided ICEs to steer the model toward attacker-specified outputs, effectively “hijacking” the model’s decision-making process.

Show full abstract

Unlike traditional adversarial attacks targeting single inputs, hijacking attacks in LLMs aim to subtly manipulate the initial few examples to influence the model’s behavior across a range of subsequent inputs, which requires distributed and stealthy perturbations. However, existing approaches overlook how to effectively allocate the perturbation budget across ICEs. We argue that fixed budgets miss the potential of dynamic reallocation to improve attack success while maintaining high stealthiness and text quality. In this paper, we propose BAM-ICL, a novel budgeted adversarial manipulation hijacking attack framework for in-context learning. We also consider a more practical yet stringent scenario where ICEs arrive sequentially and only the current ICE can be perturbed. BAM-ICL mainly consists of two stages: In the offline stage, where we assume the adversary has access to data drawn from the same distribution as the target task, we develop a global gradient-based attack to learn optimal budget allocations across ICEs. In the online stage, where ICEs arrive sequentially, perturbations are generated progressively according to the learned budget profile. We evaluate BAM-ICL on diverse LLMs and datasets, the experimental results demonstrate that it achieves superior attack success rates and stealthiness and the adversarial

DOISemantic Scholar

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chu2025bamicl,
  title  = {BAM-ICL: Causal Hijacking In-Context Learning with Budgeted Adversarial Manipulation},
  author = {Rui-Kai Chu and Bingyin Zhao and Han Jiang and Shuchin Aeron and Ying-Jie Lao},
  year   = {2025},
  doi    = {10.52202/085713-0476},
  url    = {https://doi.org/10.52202/085713-0476},
  journal = {Neural Information Processing Systems}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/4a5adcbcbcff5970a53e2410df243842cc03e881.svg)](https://codeofpaper.com/paper/4a5adcbcbcff5970a53e2410df243842cc03e881)

Discussion