Skip to content
InfoResearchPeer-reviewedLLM-specific

Jailbreak and Guard Aligned Language Models With Only Few In-Context Demonstrations

Published
Record updated
View JSON

Summary

This paper shows that a few harmful in-context demonstrations can override the safety alignment of LLMs, a technique it calls the In-Context Attack (ICA). It also proposes the In-Context Defense (ICD), which uses examples of refusing harmful requests to strengthen resilience. The authors report theoretical analysis and empirical validation across multiple models, datasets and attack baselines.

Mitigation

In-Context Defense (ICD): bolstering model resilience with in-context examples that demonstrate refusal to produce harmful responses.