Jailbreaking LLMs with Arabic Transliteration and Arabizi

Mansour Al Ghanim, Saleh Almohaimeed, Mengxin Zheng, Yan Solihin, Qian Lou

TL;DR

Researchers have discovered a significant safety gap in state-of-the-art Large Language Models (LLMs) like GPT-4 and Claude 3: while they robustly refuse harmful prompts in standard Arabic, they are surprisingly vulnerable when those same prompts are written in transliterated Arabic or Arabizi (chatspeak using Latin characters and numbers). By simply changing the script, attackers can bypass safety filters to generate unsafe content, highlighting a critical deficiency in cross-lingual adversarial training.

What Problem Does This Paper Address?

Most research into "jailbreaking"—tricking an LLM into bypassing its safety guardrails—has focused on English. While safety alignment (like RLHF) has made models quite robust in high-resource languages, the same cannot always be said for multilingual contexts.

The authors identify a specific "blind spot": non-conventional forms of Arabic. This includes formal transliteration (used by students to learn pronunciation) and Arabizi (a popular informal chatspeak used by young native speakers that replaces certain Arabic sounds with numbers, like using '3' for the letter 'ayn'). Because these variants are less common in standard safety training datasets, the models may fail to recognize the harmful intent behind the prompt, even if they are perfectly capable of understanding the underlying language.

Methods

The researchers conducted a systematic evaluation using the following steps:

  1. Prompt Translation: They took 520 harmful prompts from the AdvBench benchmark and translated them into Standardized Arabic using GPT-3.5, followed by human proofreading.
  2. Script Conversion: They converted these standard Arabic prompts into two non-conventional forms: formal transliteration and Arabizi (with and without numbers), using a consistent one-to-one mapping methodology.
  3. Model Testing: They queried OpenAI’s GPT-4 and Anthropic’s Claude 3 Sonnet with these variants.
  4. Manual Evaluation: Because automated safety classifiers often struggle with non-standard scripts, the authors manually categorized model outputs into five groups: Direct Refusal, Advice Refusal, Translation, Misunderstanding, and Unsafe.
  5. Adversarial Perturbations: They further tested "prefix injection" (forcing the model to start with "Sure, here is...") and word-level modifications to see if they could further increase the attack success rate.
Figure 1: Arabic prompt is used to ask OpenAI GPT-4 about creating and distributing malware. GPT-4 refuses to answer in Arabic. When the same prompt is translit- erated, GPT-4 provides an unsafe response.

Datasets

  • AdvBench: A standard benchmark containing 520 prompts designed to trigger harmful behaviors (e.g., profanity, cybercrime, dangerous suggestions).
  • Custom Arabic Variants: The authors created a new set of these 520 prompts translated into Standard Arabic, Arabizi, and formal transliteration.

Key Insights and Ideas

  • The "Shortcut Learning" Trap: Models seem to have learned to recognize "danger words" in standard scripts but haven't generalized that safety logic to phonetic equivalents in Latin script.
  • Identity Confusion: In a bizarre finding, when GPT-4 was prompted in certain Arabic forms, it occasionally misidentified itself as "Google AI Assistant," suggesting that its training data for these specific language variants might be heavily skewed toward specific web-scraped sources.
  • Misfiring Filters: Claude 3 often gave "copyright refusal" statements for transliterated prompts, even when the prompt had nothing to do with copyrighted material. This suggests the model's internal safety filters are getting "confused" by the unfamiliar input format.
  • Script Mixing as a Bypass: Mixing a few Arabic characters into a transliterated prompt was particularly effective at bypassing filters in Claude 3, likely because it disrupts the model's standard pattern-matching for harmful content.

Key Results

The results show a stark contrast between standard and non-standard scripts:

  • GPT-4 Vulnerability: While GPT-4 refused nearly all harmful prompts in English and Standard Arabic, its Unsafe (Attack Success) rate jumped to 12.12% when using transliteration. Its direct refusal rate plummeted from 92.12% in standard Arabic to just 13.27% in transliteration.
  • Claude 3 Vulnerability: Claude 3 was generally more robust but still saw its unsafe rate increase from 0.19% (Standard Arabic) to 4.62% for Arabizi without numbers.
  • Mitigation Success: The authors proposed a simple but effective defense: a system prompt that instructs the model to first convert any input into a standardized form and translate it to English before deciding whether to answer. This reduced GPT-4’s unsafe rate for transliterated prompts from 12.12% down to 0.77%.
Figure 2: Evaluation of Advbench on GPT-4 and Claude-3-Sonnet. We report the error of two runs with different temperature and top_p values indicated by the vertical black bar.

Limitations and Future Work

  • Scope: The study focused exclusively on Arabic. Similar vulnerabilities likely exist for other languages with multiple writing systems (e.g., Hindi/Hinglish, Persian).
  • Manual Effort: The evaluation required significant manual annotation, which is difficult to scale for larger benchmarks.
  • Open-Source Models: The authors noted that older open-source models like Llama-2 were largely "immune" to these attacks simply because they didn't understand Arabic well enough to respond at all.
  • Future Direction: The authors advocate for more comprehensive multilingual adversarial training that includes non-conventional scripts and informal chatspeak to close these safety gaps.

Summary updated

BibTeX
@inproceedings{ghanim2024jailbreaking,
  author = {Mansour Al Ghanim and Saleh Almohaimeed and Mengxin Zheng and Yan Solihin and Qian Lou},
  title = {{Jailbreaking LLMs with Arabic Transliteration and Arabizi}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=Jcj6dB8Ux7},
}
Figure