Skip to main content
LLM Security Database
Skip to research details
Back to research findings
LMVD-ID: 082f5d49
Paper published November 1, 2023
Entry analyzed December 28, 2024
Paper-reported evidence
Confidence: Source-linked

The LMVD-ID is an internal research identifier, not an official CVE identifier.

Adversarial In-Context Hijacking

A vulnerability exists in large language models (LLMs) utilizing in-context learning (ICL). Malicious actors can inject imperceptible adversarial suffixes into in-context demonstrations, causing the LLM to generate…

BibTeX citation

Paper-evaluated models(6)

Llama 13B, Llama 3.1 8B, Llama 3.1 8B Instruct +3 more
  • Llama 13B
  • Llama 3.1 8B
  • Llama 3.1 8B Instruct
  • Mistral 7B Instruct
  • OPT 6.7B
  • Vicuna 7B v1.5

Description

A vulnerability exists in large language models (LLMs) utilizing in-context learning (ICL). Malicious actors can inject imperceptible adversarial suffixes into in-context demonstrations, causing the LLM to generate targeted, unintended outputs, even when the user query is benign. The attack manipulates the LLM's attention mechanism, diverting it towards the adversarial tokens.

Examples

The attack appends adversarial suffixes (e.g., "NULL", "Remove", "For", "Location") to individual in-context demonstrations. These suffixes are semantically incongruous but are not easily identified as errors. The specific suffixes and their effectiveness vary depending on the target LLM and task. See the paper for detailed examples and experimental results.

Impact

Successful exploitation can lead to:

  • Misinformation generation: LLMs can produce inaccurate or misleading information.
  • Jailbreaking/bypass of safety mechanisms: LLMs can generate harmful or offensive content, circumventing built-in safeguards.
  • Data poisoning: The attack can manipulate the LLM's output in a specific task, leading to incorrect conclusions based on the LLM's response.

Affected Systems

Large language models employing in-context learning, including but not limited to:

  • Llama 13B and Llama 3.1 8B/8B Instruct
  • Mistral 7B Instruct
  • OPT 6.7B
  • Vicuna 7B v1.5

Mitigation Steps

  • Enhanced input sanitization: Implement more robust methods to detect and filter out potentially adversarial suffixes. Simple perplexity-based filters may be insufficient.
  • Defensive in-context demonstrations: Append or insert additional clean demonstrations during test-time evaluation to counteract the effect of adversarial demonstrations. The placement of these clean demonstrations (before or after adversarial ones) impacts effectiveness. More advanced methods beyond simply adding clean examples may be necessary.
  • Improved attention mechanisms: Investigate and enhance model architecture to reduce susceptibility to attention manipulation by adversarial tokens.

Research context and confidence

Evidence and verification
Paper-reported; independent reproduction is not documented.
Primary research source linked.
Severity
Not rated by this catalog.
Source and publication type
arXiv · Research preprint.
Peer-review status is not provided by this source.
Author and publication status
Author metadata is not stored; see the primary paper.
Threat model and attacker access
Black-box model, service, or application access.
Related deployment categories
No related deployment category is classified.
Taxonomy labels only; paper-specific deployment prerequisites are not inferred.
Affected systems
Large language models employing in-context learning, including but not limited to: Llama 13B and Llama 3.1 8B/8B Instruct Mistral 7B Instruct OPT 6.7B Vicuna 7B v1.5

Research Paper

Hijacking large language models via adversarial in-context learning

Primary source: arXiv. Findings are reported by the cited research and have not been independently verified.

View Paper

Evidence

This entry is based on a primary research source. Its findings are paper-reported; independent reproduction and verification are not claimed.

https://arxiv.org/abs/2311.09948