mlsanityData to 7 Oct 2026

TEMPLATEFUZZ: Fine-Grained Chat Template Fuzzing for Jailbreaking and Red Teaming LLMs

arXiv 2604.12232 ↗First posted 14 Apr 2026cs.CR cs.AI cs.SEcited by 0

On the map: LLM safety and security → Jailbreaking

Abstract (arXiv)

Large Language Models (LLMs) are increasingly deployed across diverse domains, yet their vulnerability to jailbreak attacks, where adversarial inputs bypass safety mechanisms to elicit harmful outputs, poses significant security risks. While prior work has primarily focused on prompt injection attacks, these approaches often require resource-intensive prompt engineering and overlook other critical components, such as chat templates. This paper introduces TEMPLATEFUZZ, a fine-grained fuzzing framework that systematically exposes vulnerabilities in chat templates, a critical yet underexplored attack surface in LLMs. Specifically, TEMPLATEFUZZ (1) designs a series of element-level mutation rules to generate diverse chat template variants, (2) proposes a heuristic search strategy to guide the chat template generation toward the direction of amplifying the attack success rate (ASR) while preserving model accuracy, and (3) integrates an active learning-based strategy to derive a lightweight rule-based oracle for accurate and efficient jailbreak evaluation. Evaluated on twelve open-source LLMs across multiple attack scenarios, TEMPLATEFUZZ achieves an average ASR of 98.2% with only 1.1% accuracy degradation, outperforming state-of-the-art methods by 9.1%-47.9% in ASR and 8.4% in accuracy degradation. Moreover, even on five industry-leading commercial LLMs where chat templates cannot be specified, TEMPLATEFUZZ attains a 90% average ASR via chat template-based prompt injection attacks.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 34 of its 57 references that are in the map. First posted on arXiv 14 Apr 2026.

Builds on

34 of 57 references.

Closest ancestors · 14

Same direction, newest first

  1. 2025TurboFuzzLLM: Turbocharging Mutation-based Fuzzing for Effectively Jailbreaking Large Language Models in Practice21 Feb
  2. 2024AutoDAN-Turbo: A Lifelong Agent for Strategy Self-Exploration to Jailbreak LLMs3 Oct
  3. 2024ChatBug: A Common Vulnerability of Aligned LLMs Induced by Chat Templates17 Jun
  4. 2024AutoJailbreak: Exploring Jailbreak Attacks and Defenses through a Dependency Lens6 Jun
  5. 2024AdvPrompter: Fast Adaptive Adversarial Prompting for LLMs21 Apr
  6. 2024Jailbreaking Leading Safety-Aligned LLMs with Simple Adaptive Attacks2 Apr
  7. 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability13 Feb
  8. 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automatically4 Dec
  9. 2023Jailbreaking Black Box Large Language Models in Twenty Queries12 Oct
  10. 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrations10 Oct
  11. 2023Low-Resource Languages Jailbreak GPT-43 Oct
  12. 2023GPTFUZZER: Red Teaming Large Language Models with Auto-Generated Jailbreak Prompts19 Sep
2 more
  1. 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
  2. 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study23 May

Other references · 20

  1. 2017Attention Is All You Needcited by 59,932
  2. 2022Training language models to follow instructions with human feedbackcited by 15,712
  3. 2024The Llama 3 Herd of Modelscited by 14,192
  4. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  5. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  6. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
  7. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,634
  8. 2025Gemma 3 Technical Reportcited by 1,686
  9. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  10. 2024Qwen2.5-Coder Technical Reportcited by 1,151
  11. 2023Prompt Injection attack against LLM-integrated Applicationscited by 568
  12. 2020Reflection Backdoor: A Natural Backdoor Attack on Deep Neural Networkscited by 341
8 more
  1. 2020Invisible Backdoor Attack with Sample-Specific Triggerscited by 338
  2. 2017Certified Defenses for Data Poisoning Attackscited by 288
  3. 2020Data Poisoning Attacks Against Federated Learning Systemscited by 266
  4. 2024ArtPrompt: ASCII Art-based Jailbreak Attacks against Aligned LLMscited by 197
  5. 2021Process for Adapting Language Models to Society (PALMS) with Values-Targeted Datasetscited by 179
  6. 2020Backdoor Attacks and Countermeasures on Deep Learning: A Comprehensive Reviewcited by 120
  7. 2020Semantic Robustness of Models of Source Codecited by 43
  8. 2017FairFuzz: Targeting Rare Branches to Rapidly Increase Greybox Fuzz Testing Coveragecited by 20

Built on by

Not cited yet.