Skip to content

BanglaShield: A Cross-Script Safety Classifier and Benchmark for Bengali Native, Romanized, and Code-Mixed PromptsBanglaShield: A Script-Robust Safety Classifier and Benchmark for Bangla Native, Romanized, and Code-Mixed Prompts

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2610.24288· Mohsinul Kabir, Md. Tariquzzaman, Mohammad Rashidujjaman Rifat, Tharindu Ranasinghe, Nishat RaihanUniversity of Manchester; Islamic University of Technology; University of Notre Dame; Lancaster UniversityIndexed by this site · 2026-10-20· Originally publishedSelected DefensesSelectedAttention40

Quick read

Evaluation and benchmarks

Based on the paper PDF (generated by Gemini); refer to the original

LLMs judged 47.0% of native-script and 63.4% of romanized unsafe Bengali prompts as Safe; the fine-tuned classifier reached above 84.4% macro-F1.

Questions
Low-resource languages such as Bengali often mix native script, Latin-script romanization, and multilingual code-mixing, while existing safety classifiers are mainly built for standard script. For the same harmful request, changes in writing form cause existing guardrails to miss detections; the paper aims to evaluate safety vulnerability across multiple writing forms and build a prompt classification model robust across forms.
Methods
Integrate 6 public datasets to construct a four-level safety corpus containing 10,245 prompts, and generate paired native, romanized, and code-mixed forms through transcription models and machine translation alignment; evaluate the performance of 6 LLMs and 3 guardrail models on classification and response, and fine-tune a MuRIL encoder on the joint training set of the three forms to build a classifier.
Experiments and results
The average safety miss rate of LLMs on native and romanized unsafe prompts reaches 47.0% and 63.4%, and model self-censorship reduces the harmful compliance rate by only about 5 percentage points; the fine-tuned BANGLASHIELD achieves macro-F1 of 84.4% to 88.3% on the three forms, with an unsafe miss rate of no more than 1.0%.
Limitations and future work
Romanized and code-mixed prompts were automatically generated by models without manual verification and may contain grammatical errors or deviate from natural usage; safety labels are based on deterministic rule mapping from source categories rather than per-item manual annotation, and benign control samples were also not manually reviewed; experiments cover only 6 LLMs and 3 guardrail models and do not test adaptive attacks against the classifier.
Experimental setupGemma 4 31B (google/gemma-4-31b-it)、Llama 4 Maverick (meta-llama/llama-4-maverick) et al. · BANGLASHIELD、LinguaSafe et al. · Acc、macro-F1 et al.
Evaluated models
Gemma 4 31B (google/gemma-4-31b-it)Llama 4 Maverick (meta-llama/llama-4-maverick)Command A+ (cohere/command-a-plus)GPT-4.1 mini (openai/gpt-4.1-mini)Claude Haiku 4.5 (anthropic/claude-haiku-4.5)TigerLLM (TigerLLM-9B-it)Llama Guard 3 (meta-llama/Llama-Guard-3-8B)PolyGuard-Qwen (ToxicityPrompts/PolyGuard-Qwen)IndicGuard (l3cube-pune/IndicGuard)BANGLASHIELD
Benchmarks
BANGLASHIELDLinguaSafeBanglaEcomReviewCorpusXSafetyBanglaSafeIndicSafeMultiJail
Metrics
Accmacro-F1USRUSARRHCROFRMAE
AI summaryand selection rationaleThe paper releases BanglaShield, a four-level safety classifier and paired benchmark for Bengali native-script, Romanized, and code-mixed prompts, integrating 10,245 prompts from 6 sources, labeled as Safe, Offensive, Harmful, and Severe, with each prompt rendered in three scripts sharing labels and splits. Evaluation of 6 LLMs and 3 multilingual guardrail models shows that LLM classifiers judge 47.0% of native-script unsafe prompts as Safe, rising to 63.4% after Romanization, and response-level safety accuracy drops by 10.3 percentage points; using the model's own classification for input filtering reduces the harmful compliance rate by only about 5 percentage points. The fine-tuned encoder BanglaShield (237M parameters) reaches 87.8 macro-F1 on native script and 84.4 on Romanized, 42.8–46.1 points higher than the best LLM across scripts, with about 1/130 the parameters of Gemma 4 31B. The corpus, splits, judgment outputs, and model are all released.

The paper releases BanglaShield, a four-level safety classifier and paired benchmark for Bengali native-script, Romanized, and code-mixed prompts, integrating 10,245 prompts from 6 sources, labeled as Safe, Offensive, Harmful, and Severe, with each prompt rendered in three scripts sharing labels and splits. Evaluation of 6 LLMs and 3 multilingual guardrail models shows that LLM classifiers judge 47.0% of native-script unsafe prompts as Safe, rising to 63.4% after Romanization, and response-level safety accuracy drops by 10.3 percentage points; using the model's own classification for input filtering reduces the harmful compliance rate by only about 5 percentage points. The fine-tuned encoder BanglaShield (237M parameters) reaches 87.8 macro-F1 on native script and 84.4 on Romanized, 42.8–46.1 points higher than the best LLM across scripts, with about 1/130 the parameters of Gemma 4 31B. The corpus, splits, judgment outputs, and model are all released.

Why it was selectedThe paper conducts paired evaluations using native, romanized, and code-mixed renderings of the same set of requests, providing a reproducible comparison benchmark for safety guardrails in multilingual-script languages.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that the romanized and code-mixed writing forms commonly used in daily Bengali bypass existing large-model safety classifiers, necessitating the construction of a cross-writing-form safety benchmark and defense.

    The paper attempts to address the problem that, for Bengali across different writing forms such as native script, romanized Latin letters, and cross-lingual code mixing, the classification performance of large language models and safety guardrails deteriorates severely and is easily bypassed.

    • Real-world scenario and importance of the problem: Bengali has about 250 million speakers; in online interaction, besides native Bengali script, users widely use romanized Latin-letter spelling in daily life, as well as code mixing with English, Hindi, or Urdu; the authors state that transforming the writing form of the same harmful request can bypass existing safety filters.
    • Insufficiency of existing guardrail resources: The authors state that existing Bengali safety resources have three major limitations: missing romanized forms, using only binary or three-class labels, or being biased toward offensive language rather than harmful requests (Table 1).
    • Core observation and hypothesis: The authors observed that current safety classifiers are mostly trained on standard script, and that the same severely harmful request is blocked under native script but is often misjudged as Safe under code-mixed or romanized forms (Figure 1); the authors hypothesize that training a compact encoder on paired multi-writing-form data can achieve cross-form robust judgment.
    • Solution proposed by the paper: Build the BANGLASHIELD benchmark containing 10,245 prompts aligned across three writing forms with four-level risk labels, and fine-tune a compact MuRIL encoder to achieve cross-form guardrailing.
  2. What related research exists?

    Existing research has explored multilingual and code-mixed safety degradation in large models, but Bengali resources are mostly limited to offensive language detection or a single writing form, lacking paired four-level graded guardrails.
    • Multilingual safety evaluation and jailbreak research: XSafety (Wang et al., 2024) and RTP-LX (de Wynter et al., 2025) compared toxicity across languages; MultiJail (Deng et al., 2024) and code-mixing red teaming (Yoo et al., 2025) found that language conversion can bypass safety mechanisms; IndicJR (Pattnayak and Chowdhuri, 2026a) found that romanized or mixed input had a lower jailbreak success rate under JSON constraints. The authors note that these studies compare across different languages, rather than different writing forms of a single language.
    • Safety guardrails and moderation models: Llama Guard (Inan et al., 2023; Grattafiori et al., 2024) performs input-output moderation based on a predefined taxonomy; WildGuard (Han et al., 2024) separately models prompt harmfulness, response harmfulness, and refusal; PolyGuard (Kumar et al., 2025) covers 17 languages; IndicGuard (Bramhecha et al., 2026) covers 10 Indian languages; X-Guard (Upadhayay and Behzadan, 2025) covers low-resource and code-mixed input.
    • Bengali safety and variant resources: Das et al. (2022) covers Bengali script and romanized hate speech; TB-OLID (Raihan et al., 2023) and OffMix-3L (Goswami et al., 2023) study transliterated and mixed offensive language, respectively; BanglaSafe (Islam et al., 2026) provides localized harmful prompts and notes that register variation weakens LLM safety; BanglaVeilGuard (Hassan and Hossain, 2026) evaluated a three-class guardrail on six forms; TigerLLM (Raihan and Zampieri, 2025) is a Bengali-specific large model.
    • Baseline methods and benchmarks used: The experiments compared three guardrail models, Llama Guard 3 8B, PolyGuard-Qwen 7B, and IndicGuard 4B, and conducted zero-shot prompt classification and response generation evaluation on 6 mainstream LLMs; the benchmark data was integrated from 6 sources in total: LinguaSafe, BanglaEcomReviewCorpus, XSafety, BanglaSafe, IndicSafe, and MultiJail.
    • Positioning and distinction of this paper: The authors note that previous Bengali safety resources did not simultaneously combine four-level risk annotation, strictly paired three writing forms, model response-level evaluation, and a publicly released guardrail model (Table 1).
  3. How does the paper address this problem?

    Integrate 6 sources to construct a four-level safety corpus of 10,245 items aligned across three writing forms, and fine-tune a 237M-parameter MuRIL encoder on the joint training set of the three forms.

    The paper proposes the BANGLASHIELD framework, which builds a strictly aligned three-writing-form safety benchmark by integrating multi-source data, and on this basis jointly fine-tunes a compact encoder to achieve cross-form robust prompt safety classification.

    Corpus integration and four-level risk taxonomy

    • Multi-source data integration and cleaning: Bengali instances were collected from 6 public resources and converted into a unified format, excluding multiple-choice questions and bias benchmarks, yielding 10,245 prompts in total.
    • Four-level risk system division: All samples were mapped to a four-level risk system: 0-Safe (harmless requests), 1-Offensive (insulting/provocative/discriminatory language without a request for assistance), 2-Harmful (low-to-moderate-risk harmful assistance requests), 3-Severe (high-risk severely harmful requests, such as suicide, jailbreak).
    • Deterministic rule mapping: Mapping was completed via deterministic rule functions based on each dataset's own label definitions: yi = gsi(oi) ∈ 𝒴 = {0, 1, 2, 3} where gs is the rule set of source s, arranged in ascending order of risk.
    • Benign control sample construction: Because safety datasets lack benign requests, 2,881 negative reviews were selected from the e-commerce review corpus BanglaEcomReviewCorpus and filled into deterministic customer-service inquiry templates via a 10-category keyword decision tree, converting them into Safe samples that carry negative sentiment but are harmless.

    Paired three writing forms construction

    • Aligned generation protocol: For each input, three strictly aligned forms were derived, sharing the same label and data split.
    • Native script processing: The original Bengali script normalized via NFC was used.
    • Romanized transliteration: A Gemma-based instruct model bodhan-ai/indic-translate was used for transliteration, requiring only changing letters to Latin letters while preserving vocabulary and word order, containing no Bengali letters, with average word length maintained at 23.6 words.
    • Lexical-level code mixing: An embedding language was assigned to each sample according to a stratified ratio (English 60%, Hindi 25%, Urdu 15%). The full sentence was first translated via NLLB-200, then non-punctuation words were aligned using SimAlign; a subset of aligned positions Si was randomly sampled according to a uniform distribution pi ∼ 𝒰(0.35, 0.50), and the original words were replaced with target-language translations: w_j^{cm} = \begin{cases} a(j) & j \in S_i \\ w_j & \text{otherwise} \end{cases} The actual replacement rate in the test set was 0.40 ± 0.07.

    Data split and leakage prevention strategy

    • Stratified and leakage-preventing split: All 10,245 instances were split 70:10:20 into a training set (7,172), a validation set (1,024), and a test set (2,049).
    • Group-aware mechanism: A group-aware stratified split was used; all records sharing the same group identifier (parallel translations, register variants, duplicate reviews) were strictly assigned to the same partition to prevent data leakage; the three writing forms inherited the same partition.

    BANGLASHIELD model fine-tuning and deployment design

    • Pre-generation defense architecture: The defense was placed in a prompt-level guard layer prior to model generation.
    • Backbone selection: google/muril-base-cased (237M parameters) pretrained on Indian-language translation and transliteration pairs was used.
    • Training optimization details: Joint fine-tuning was performed on the merged dataset of the three forms—native script, romanized, and code-mixed (21,516 training samples in total); class-weighted cross-entropy loss was used, with a maximum sequence length of 256, the AdamW optimizer, a learning rate of 3e-5 (linear decay, 10% warmup), a batch size of 32, and 10 training epochs; the best checkpoint was selected based on the macro-F1 aggregated over the three forms on the validation set; the hardware was 2 A100 GPUs. Adaptive attacks against this classifier were not tested.
  4. What experiments did the paper conduct?

    Evaluation shows that the miss detection rate of LLMs under romanization rises to 63.4%, and self-censorship reduces compliance by only 5 points; BANGLASHIELD achieves macro-F1 of 84.4% or above on each form.

    Experimental Setup

    • Models tested: 6 large language models in total (Gemma 4 31B, Llama 4 Maverick 400B, Command A+, GPT-4.1 mini, Claude Haiku 4.5, and the Bangladesh-specific TigerLLM 9B), 3 guardrail models (Llama Guard 3 8B, PolyGuard-Qwen 7B, IndicGuard 4B), and a fine-tuned BANGLASHIELD 237M.
    • Dataset and scale: The BANGLASHIELD test set contains 2,049 benchmark samples in total, with 6,147 prompts across three forms (Safe 698, Offensive 314, Harmful 538, Severe 499).
    • Task setup: Includes four-class prompt classification (LLMs made 36,882 calls) and response safety generation (1,351 non-Safe prompts generated 24,318 responses across three forms); baselines include direct LLM classification, zero-shot guardrail classification, and unfiltered generation.
    • Metric definitions: Classification metrics are accuracy (Acc), macro-F1 (M-F1), unsafe-misclassified-as-safe rate (USR), degradation rate (US), and over-flagging rate (OFR); response metrics are appropriate response rate (ARR, Offensive expects an answer, Harmful/Severe expect refusal) and harmful compliance rate (HCR).
    • Evaluation method: Each response is independently judged by GPT-5.6 Luna and Gemini 3.1 Flash-Lite for whether it complies, degree of compliance (levels 0-3), and behavioral correctness; if the judges disagree, Claude Sonnet 5.5 arbitrates.
    • Statistical testing: Confidence intervals are computed via 1,000 paired bootstrap resamples of test sample indices; significance of correctness flips between forms is tested with McNemar's test.

    Main Results

    Swipe horizontally to read the table

    ModelParametersNative M-F1Native USRRomanized M-F1Romanized USR
    Gemma 4 31B31B42.9%47.4%41.6%49.1%
    Llama 4 Maverick400B37.5%50.2%31.7%60.7%
    Command A+not reported37.0%49.2%17.1%87.8%
    GPT-4.1 mininot reported36.4%51.8%32.7%61.2%
    Claude Haiku 4.5not reported43.9%35.8%34.4%54.4%
    TigerLLM9B33.0%47.6%26.6%67.4%
    BANGLASHIELD237M87.8%0.7%84.4%0.4%

    (According to Table 4; the three guardrail models in the table are omitted, as they output only binary USR: 30.3%–57.3% under native script and 51.8%–62.9% under romanization)

    • LLMs underestimate risk under native script and romanization worsens the decline: The authors state that LLMs classify 47.0% of unsafe prompts as Safe under native Bengali script, and this proportion rises to 63.4% after romanization, with average macro-F1 dropping 7.8 percentage points; Command A+ is most affected, classifying 87.8% of unsafe inputs as Safe under romanization.
    • Losses concentrate in the severe harm category: The authors state that the vast majority of errors are risk underestimation, with the average F1 for the Severe category dropping from 20.4% under native script to 11.1% under romanization, a decline of 46% (Figure 5), while under native script only 12.3% of Severe prompts are correctly classified (Figure 4).
    • BANGLASHIELD performs robustly across forms: The authors state that BANGLASHIELD achieves macro-F1 of 84.4% to 88.3% across the three forms, with USR staying at 1.0% or below, outperforming the best-performing LLM by 42.8 to 46.1 percentage points on each writing form (Table 4).

    Response Safety and Self-Censorship Filtering Evaluation

    • Experimental design: Evaluate the appropriate response rate (ARR) of 6 LLMs across three writing forms, and simulate harmful compliance rate (HCR) after LLM self-censorship filtering (refusing when it itself predicts Harmful/Severe) and after external guardrail filtering (Table 5, Table 6, Table 17).
    • Experimental values: Average LLM ARR drops from 78.3% under native script to 68.0% under romanization (Table 5), and classification macro-F1 is highly correlated with ARR (r = 0.84, Figure 6); self-censorship reduces average HCR by only about 5 percentage points (from 35.8% to 30.2%), with models still complying with about 30% of harmful and severe requests, and falsely blocking 5%–29% of Offensive requests (Table 6); PolyGuard and IndicGuard push HCR down to 16.5%–22.6%, but falsely block over 62% of Offensive requests under native script (Table 17).
    • Authors' interpretation: The authors state that the writing forms that can evade classifier censorship also weaken the model's generation safeguards; self-censorship is weak in effect, and the model's own choice has a much greater impact on compliance rate than self-protection mechanisms.

    Localized Data and Multi-Source Comparison

    • Experimental design: Classification accuracy of LLMs and BANGLASHIELD and LLM response ARR are tallied separately by 6 data sources (Table 7).
    • Experimental values: BanglaSafe, derived from Bangladeshi local judicial and news records, is the hardest, with LLMs achieving an average classification accuracy of only 9.0% and ARR of 53.9% under native script; whereas BANGLASHIELD reaches 84.3% accuracy on BanglaSafe (Table 7).
    • Authors' interpretation: The authors state that although datasets translated from English are also affected by romanization, LLMs are weakest at understanding localized culturally harmful content, and BANGLASHIELD can effectively identify local risks commonly missed by LLMs.

    Other Ablations and Analyses

    • Cross-form training ablation: BANGLASHIELD trained only on native script or code-mixed data achieves macro-F1 of only 39.4% and 42.9% on the romanized test set, and training only on romanized data achieves only 44.7% and 34.6% on the native and mixed test sets, and only joint training reaches above 84.4% on all forms (Table 13).
    • Code-mixed languages and substitution rate: Inserting English, Hindi, and Urdu reduces average LLM macro-F1 by 2.6, 2.2, and 1.8 points respectively (Table 11), and the accuracy gap versus native across substitution rate intervals is between 1.5 and 2.0 points (Figure 10).
    • Cross-form prediction consistency: The proportion of samples that LLMs predict correctly across all three forms is only 34.5%–45.9%, whereas BANGLASHIELD reaches 81.7% (Table 8).
    • Over-flagging and absolute error: The over-flagging rate (OFR) on Safe samples for LLMs is at most 4.3%, and mean absolute error (MAE) generally rises under romanization, reaching up to 1.28 (Table 14).
    • Judge agreement: The two primary judges agree on behavioral correctness at 81.9% (Cohen's κ = 0.56), agreement on binary compliance is only 48.2%, and the conflict rule causes 70.6% of responses to go to arbitration (Appendix I).
  5. What are some points that can be further explored?

    The authors point out that corpus conversion lacks manual verification and labels are rule-mapped; the experiments do not include human evaluation or adaptive attacks, and the number of models and guardrails tested is limited.

    Limitations and future directions noted by the authors

    • Transliteration and code mixing lack human verification: The authors note that the romanized and code-mixed prompts were automatically generated by a program without human verification, may not fully reflect natural romanization and code-switching patterns, and that some samples may contain grammatical errors (Limitations section).
    • Label mapping relies on source category rules rather than independent annotation: The authors note that the safety labels were obtained via deterministic rule mapping based on the original dataset categories, rather than re-annotating individual prompts, and that the benign review samples were also not manually reviewed (Limitations section).
    • The guardrail model needs to be combined with other measures and human oversight: The authors state in the ethics statement that guardrail models can reduce but not eliminate risk, and that BANGLASHIELD should be deployed in conjunction with other safety defenses and human oversight (Ethics Statement section).

    Scope of experimental coverage

    • Number and types of models tested: The evaluation covers 6 large language models (1 of which is the Bengali-specific model TigerLLM) and 3 multilingual open-source guardrail models; closed-source models were tested via OpenRouter.
    • Data scale and task limitations: The test set is 6,147 three-form inputs corresponding to 2,049 benchmark prompts; the response generation task excluded the 698 Safe samples and tested only 1,351 non-Safe prompts.
    • Review method: Response safety relies entirely on LLM reviewer models (GPT-5.6 Luna, Gemini 3.1 Flash-Lite, and Claude Sonnet 5.5); the paper does not report human evaluation results or the agreement between the reviewer models and human judgment.
    • Boundaries of attack and defense testing: The paper did not test adversarial or adaptive attacks against the BANGLASHIELD classifier, and code mixing used a lexical replacement setup without simulating syntactic code-switching.
    • Training conditions: The BANGLASHIELD model was fine-tuned based on a single random seed (seed 42), and only google/muril-base-cased (237M parameters) was tested as the backbone.
  6. Summarize the main content of the paper

    The paper built a Bengali safety benchmark aligned across three writing forms, reported that the miss rate of large models rises substantially under romanization, and proposed a 237M robust guardrail model.
    1. Positioning and core objective: Addressing the phenomena of native script, romanized spelling, and code mixing that are widespread in low-resource languages such as Bengali, the paper systematically studies the impact of writing-form variation on large-model prompt classification and response safety, and develops a guardrail robust across writing forms.
    2. Benchmark corpus construction: Integrating 6 public resources to build the BANGLASHIELD dataset containing 10,245 prompts, uniformly mapping to a four-level risk taxonomy (Safe, Offensive, Harmful, Severe), and converting each prompt strictly into paired aligned native-script, romanized, and trilingual mixed forms via an instruct transliteration model and machine-translation word-alignment replacement.
    3. Large-model safety vulnerabilities: Extensive evaluation of 6 mainstream LLMs and 3 multilingual guardrails shows that the average unsafe-misjudged-as-safe rate (USR) of LLMs under native Bengali script is as high as 47.0%, rising further to 63.4% under romanized form, with recognition F1 for the severe harm category particularly damaged; and the dataset derived from local judicial records has a classification accuracy as low as only 9.0%.
    4. Failure of self-censorship mechanisms: Response generation experiments show that romanization causes the appropriate response rate (ARR) to drop by 10.3 percentage points; simulated LLM self-censorship filtering can only reduce the harmful compliance rate by about 5 percentage points, and causes 5%–29% of offensive-but-not-harmful requests to be incorrectly refused.
    5. BANGLASHIELD classifier: Fine-tuning a 237M-parameter MuRIL encoder on the joint data of the three forms, BANGLASHIELD achieves macro-F1 of 87.8%, 88.3%, and 84.4% on the native, code-mixed, and romanized test sets, respectively, with USR at or below 1.0%, surpassing all tested LLMs and existing guardrail models despite having about 130 times fewer parameters.
    6. Authors' conclusion: The authors state that writing-form variation constitutes a major blind spot in safety alignment for low-resource languages, that single-writing-form training cannot generalize to romanized input, and recommend deploying a compact pre-generation guardrail trained jointly across forms to fill the gap in multilingual safety defenses.
Read originalarxiv.org