ACL 2025finding0 citations

QueryAttack: Jailbreaking Aligned Large Language Models Using Structured Non-natural Query Language

Qingsong Zou, Jingyu Xiao, Qing Li, Zhi Yan, Yuhang Wang, Li Xu, Wenxuan Wang, Kuofeng Gao

Abstract

Recent advances in large language models (LLMs) have demonstrated remarkable potential in the field of natural language processing. Unfortunately, LLMs face significant security and ethical risks. Although techniques such as safety alignment are developed for defense, prior researches reveal the possibility of bypassing such defenses through well-designed jailbreak attacks. In this paper, we propose QueryAttack, a novel framework to examine the generalizability of safety alignment. By treating LLMs as knowledge databases, we translate malicious queries in natural language into structured non-natural query language to bypass the safety alignment mechanisms of LLMs. We conduct extensive experiments on mainstream LLMs, and the results show that QueryAttack not only can achieve high attack success rates (ASRs), but also can jailbreak various defense methods. Furthermore, we tailor a defense method against QueryAttack, which can reduce ASR by up to 64% on GPT-4-1106. Our code is available at https://anonymous.4open.science/r/QueryAttack-334B.

BibTeX
@inproceedings{zou-etal-2025-queryattack,
    title = "{Q}uery{A}ttack: Jailbreaking Aligned Large Language Models Using Structured Non-natural Query Language",
    author = "Zou, Qingsong  and
      Xiao, Jingyu  and
      Li, Qing  and
      Yan, Zhi  and
      Wang, Yuhang  and
      Xu, Li  and
      Wang, Wenxuan  and
      Gao, Kuofeng  and
      Li, Ruoyu  and
      Jiang, Yong",
    editor = "Che, Wanxiang  and
      Nabende, Joyce  and
      Shutova, Ekaterina  and
      Pilehvar, Mohammad Taher",
    booktitle = "Findings of the Association for Computational Linguistics: ACL 2025",
    month = jul,
    year = "2025",
    address = "Vienna, Austria",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.findings-acl.298/",
    doi = "10.18653/v1/2025.findings-acl.298",
    pages = "5725--5741",
    ISBN = "979-8-89176-256-5"
}
QueryAttack: Jailbreaking Aligned Large Language Models Using Structured Non-natural Query Language · ACL 2025