X-Guard: Multilingual Guard Agent for Content Moderation

Bibek Upadhayay, Vahid Behzadan, Ph.D · 2025

Read X-Guard: Multilingual Guard Agent for Content Moderation by Bibek Upadhayay, Vahid Behzadan, Ph.D (2025) 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-2504-08848.txt.

Introduction

Safety filters for language models are trained mostly in English, and attackers exploit the gap with low-resource languages and mid-sentence language switching. Bibek Upadhayay and Vahid Behzadan present X-Guard, a moderation agent built for many tongues. They assembled a safety dataset spanning one hundred thirty-two languages and five million examples, each with its reasoning spelled out, and used a panel of judge models to curb single-judge bias.

The system pairs a fine-tuned translation module with a three-billion-parameter judge trained in two stages. In their tests it caught unsafe content across languages, including the code-switching tricks that slip past English-centered guards, while explaining its verdicts.

Catalog record

CREATORBibek Upadhayay, Vahid Behzadan, Ph.D
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE59 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2504-08848

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

X-Guard: Multilingual Guard Agent for Content Moderation Bibek Upadhayay, Vahid Behzadan, Ph.D Abstract Large Language Models (LLMs) have rapidly become integral to numerous applications in critical domains where reliability is paramount. Despite significant advances in safety frameworks and guardrails, current protective measures exhibit crucial vulnerabilities, particularly in multilingual contexts. Existing safety systems remain susceptible to adversarial attacks in low-resource languages and through code-switching techniques, primarily due to their English-centric design. Furthermore, the development of effective multilingual guardrails is constrained by the scarcity of diverse cross-lingual training data. Even recent solutions like Llama Guard-3, while offering multilingual support, lack transparency in their decision-making processes. We address these challenges by introducing X-Guard agent, a transparent multilingual safety agent designed to provide content moderation across diverse linguistic contexts. X-Guard effectively defends against both conventional low-resource language attacks and sophisticated code-switching attacks. Our approach includes: curating and enhancing multiple open-source safety datasets with explicit evaluation rationales; employing a jury of judges methodology to mitigate individual judge LLM provider biases; creating a comprehensive multilingual safety dataset spanning 132 languages with 5 million data points; and developing a two-stage architecture combining a custom-finetuned mBART-50 translation module with an evaluation X-Guard 3B model trained through supervised finetuning and GRPO training. Our empirical evaluations demonstrate X-Guard’s effectiveness in detecting unsafe content across multiple languages while maintaining transparency throughout the safety evaluation process. Our work represents a significant advancement in creating robust, transparent, and linguistically inclusive safety systems for LLMs and its integrated systems. We have publicly released our dataset and models at this URL . CAUTION: The text in this paper contains harmful language. 1 Introduction Figure 1: An image image showing the X-Guard agent in action, which takes multilingual language (Nepali) as input and sends it to both the translation module and safety module for safety evaluation. The capabilities of Large Language Models (LLMs) have been rapidly expanding, and these models are now being envisioned for adoption across numerous fields, including sensitive areas such as cybersecurity, healthcare, and drug discovery Gallifant et al. (2025) ; Zheng et al. (2025) ; Yang et al. (2024b) . This widespread adoption means adversaries can potentially cause more serious harm to both systems and users. Therefore, it is essential to integrate robust safety methods and frameworks directly into LLMs and their surrounding systems. Model providers typically address this by performing thorough data cleaning before pretraining and implementing comprehensive safety training before releasing models. Additionally, post-training approaches such as Reinforcement Learning from Human Feedback (RLHF) have proven highly effective for developing LLMs that are both harmless and helpful Lambert (2024) ; Christiano et al. (2017) ; Ouyang et al. (2022) . However, these safety-aligned LLMs have been shown to generate harmful responses and fail to prevent adversarial attacks Wei et al. (2023a) ; Qiang et al. (2023) ; Zhao et al. (2024) ; Shen et al. (2023) ; Anil et al. (2024) ; Upadhayay et al. (2025) . This has further motivated researchers to add additional guardrails for LLMs and systems to prevent attacks. These guardrails are in the form of APIs such as Perspective API 1 1 1 https://perspectiveapi.com/ , OpenAI Moderation API 2 2 2 https://platform.openai.com/docs/guides/moderation/overview , and also have been released as input-output content filtering models such as Llama-Guard/2/3 Inan et al. (2023) ; Team (2024) ; Grattafiori et al. (2024) , SheildGemma/2 Team (2025) ; Zeng et al. (2024a) , WildGuard Han et al. (2024) , Aegis Ghosh et al. (2024) , and Nemo-Guardrail Rebedea et al. (2023) . These guardrails have shown effectiveness in identifying harmful input being fed to LLMs and systems, and even if the model produces harmful content, the content will be further moderated by these guardrails, mitigating the overall impact of the attack. However, these guardrail LLMs are single-pass generators and do not provide transparency in how they make safety decisions, further limiting their effectiveness. The LLMs that perform reasoning processes before solving tasks have been shown to improve their performance Wei et al. (2022) ; Shao et al. (2024) . Various frameworks have been proposed to enable models to reiterate their own answers and implement backtracking as a defensive mechanism Madaan et al. (2023) ; Xie et al. (2023) ; Zhang et al. (2025) . Similar reasoning approaches have been employed when evaluating the responses of jailbroken LLMs. In these approaches, larger SOTA LLMs were used to classify the responses as safe/unsafe by first writing an evaluation of the content and then providing the safety classification Upadhayay et al. (2025) . For safety evaluation purposes, reasoning models like R2-Guard Kang and Li (2025) and ThinkGuard Wen et al. (2025) have been developed, which first generate a safety label and then provide an explanation for their classification decision. These reasoning models have demonstrated improved performance compared to single-pass classification models such as Llama Guard. They are trained on synthetic data created by distilling knowledge from higher-performing SOTA LLMs (for example, ThinkGuard was trained on distilled data of GPT-4), which enforces the trained model to have the bias of the single judge LLM. Additionally, these trained models have limitations in multilingual contexts and fail when confronted with low-resource language attacks Yang et al. (2024c) . Furthermore, they struggle to detect code-switching attacks where harmful and safe prompts are presented across multiple languages. One of the challenges in creating the multilingual safety guardrail is the lack of open-sourced data. In this work, we provide solutions to the aforementioned challenges by creating X-Guard agent, a multilingual safety guardrail agent. Our X-Guard agent provides effective safety for multilingual contexts including code-switching attacks such as Sandwich Attack Upadhayay and Behzadan (2024a) . Our agent consists of three modules: 1) language detection and routing module, 2) translation module, and 3) safety evaluator module that work in conjunction to provide safety assessment. We first curated an open-source safety dataset and further enhanced it by adding a reasoning component. In contrast to relying on a single evaluator judge LLM, we use a jury of judges where we apply a voting approach to safety labels and categories, which provides a more diverse evaluation Ghosh et al. (2024) . We then translated the dataset to create 5 million data points across 132 languages and subsequently trained a many-to-one translator. Furthermore, we performed supervised fine-tuning (SFT) on a Qwen-2.5-Instruct 3B parameter model and then performed GRPO training to create a safety evaluator. We summarize our contributions as follows: 1. We introduce X-Guard agent, a transparent multilingual safety agent designed to protect LLMs across diverse linguistic contexts. 2. We curated and enhanced multiple open-source safety datasets with explicit evaluation rationales by employing a jury of judges methodology to mitigate biases from individual LLM providers. 3. We created a comprehensive multilingual safety dataset spanning 132 languages with 5 million data points, which we have made publicly available. 4. We custom-finetuned mBART-50 for 132 languages and created the X-Guard 3B model trained through supervised finetuning and GRPO training, which we have also publicly released. The rest of the paper has been organized as follows: Section 2 provides an overview of data collection and synthetic data generation followed by model training in Section 3.1 and the agent’s performance evaluations in Section 3.2 . We demonstrate the effectiveness of

Read the complete text