How Few-shot Demonstrations Affect Prompt-based Defenses Against LLM Jailbreak Attacks Conference: arXiv Preprint; 2026;

Yanshu Wang, Shuaishuai Yang, Jingjing He, Tong Yang · 2026

Read How Few-shot Demonstrations Affect Prompt-based Defenses Against LLM Jailbreak Attacks Conference: arXiv Preprint; 2026; by Yanshu Wang, Shuaishuai Yang, Jingjing He, Tong Yang (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2602-04294.txt.

Description

Examples in the prompt can strengthen one jailbreak defense and sabotage another. Yanshu Wang and 3 co-authors tested few-shot effects on prompt-based defenses in a 2026 study. Role-oriented prompts and task-oriented prompts both guard language models, but examples interact with each in unlike ways.

Across mainstream models, four safety benchmarks, and six attack methods, few-shot examples helped role-oriented defense by strengthening identity. The same examples hurt task-oriented defense sharply by pulling focus from task instructions. Advice for deployment follows: match the example strategy to the defense type. A defense copied from a blog post, examples included, may quietly halve its own guard.

Catalog record

CREATORYanshu Wang, Shuaishuai Yang, Jingjing He, Tong Yang
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE51 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2602-04294

Browse the full library · About the Tower of Babel