arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.12232cs.CRcs.AIcs.SE
收藏

TEMPLATEFUZZ:细粒度聊天模板模糊测试用于突破和红队测试大语言模型

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

School of Computer Software(计算机软件学院);Tianjin University(天津大学);Monash University(墨尔本大学)

Qingchao Shen, Zibo Xiao, Lili Huang, Enwei Hu, Yongqiang Tian, Junjie Chen

AI总结:

本文提出TEMPLATEFUZZ框架,通过细粒度模糊测试揭示大语言模型聊天模板的漏洞,实现高攻击成功率的同时保持模型准确性,优于现有方法。

摘要:

大型语言模型(LLMs)在多个领域得到广泛应用,但其对劫持攻击的脆弱性带来了重大安全风险。尽管先前研究主要关注提示注入攻击,但这些方法通常需要资源密集的提示工程,并忽视了其他关键组件,如聊天模板。本文提出TEMPLATEFUZZ,一种细粒度模糊测试框架,系统地暴露聊天模板的漏洞,这是LLMs中关键但未被充分研究的攻击面。具体而言,TEMPLATEFUZZ(1)设计了一系列元素级突变规则以生成多样的聊天模板变体,(2)提出启发式搜索策略以引导聊天模板生成朝着提高攻击成功率(ASR)的方向发展,同时保持模型准确性,(3)集成了基于主动学习的策略以推导一个轻量级的规则基 oracle 用于准确且高效的劫持评估。在十二个开源LLMs上评估多个攻击场景,TEMPLATEFUZZ实现了平均ASR为98.2%,仅1.1%的准确性下降,优于现有方法9.1%-47.9%的ASR和8.4%的准确性下降。此外,即使在五个行业领先的商业LLMs上,聊天模板无法指定的情况下,TEMPLATEFUZZ通过基于聊天模板的提示注入攻击也实现了90%的平均ASR。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑