govtech-responsibleai/RabakBench

A curated benchmark for evaluating LLM guardrails across safety risks relevant to the Singapore context

Jupyter Notebook

3

14 commits

updated Dec 11, 2025

See the code

README

RabakBench: A Localized Multilingual Safety Benchmark

RabakBench supports evaluation of popular open-source and closed-source content moderation systems in low-resource and culturally diverse languages. This dataset covers Singlish (an English-based creole) and local variants of Chinese, Malay, and Tamil. These languages are often underrepresented in existing benchmarks, posing challenges for large language models (LLMs) and their safety classifiers.

By releasing RabakBench, we aim to advance the study of AI safety in low-resource languages by enabling robust safety evaluation in multilingual settings and providing a reproducible framework for building localized safety datasets.

[!TIP] Explore the dataset through this Jupyter Notebook

Dataset Construction

RabakBench comprises over 5,000 examples across six harm categories with severity levels. The dataset was constructed through a scalable three-stage pipeline:

  1. Generate: Adversarial example generation by augmenting real Singlish web content with LLM-driven red teaming
  2. Label: Semi-automated multi-label safety annotation using majority-voted LLM labelers aligned with human judgments
  3. Translate: High-fidelity translation preserving linguistic nuance and toxicity across languages.
RabakBench Construction Pipeline

Setup

1. Install dependencies

pip install -r requirements.txt

2. Download datasets

We support controlled access with terms of use and intent verification, to ensure responsible usage aligned with our goals of improving multilingual AI safety. Access to the full dataset is not provided to the public, instead, access the public set here.

Place the 4 datasets in the appropriate folders under the /data directory:

  • rabakbench_en.csv → /data/en/rabakbench_en.csv
  • rabakbench_ms.csv → /data/ms/rabakbench_ms.csv
  • rabakbench_ta.csv → /data/ta/rabakbench_ta.csv
  • rabakbench_zh.csv → /data/zh/rabakbench_zh.csv

3. Configure API keys

Create a .env file and add the following API keys:

# OpenAI Moderation API
export OPENAI_API_KEY=XXXXXXXXXX

# Azure Content Safety API
export AZURE_CONTENT_SAFETY_ENDPOINT="https://XXX.azure.com/"
export AZURE_CONTENT_SAFETY_KEY=XXXXXXXXXX

# AWS Moderation API
export AWS_ACCESS_KEY_ID=XXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXX
export AWS_SESSION_TOKEN=XXXXXXXXXX

# GCP Project ID (Model Armor and Perspective API)
export GCP_PROJECT_ID=XXXXXXXXXX

# Perspective API
export PERSPECTIVE_API_KEY=XXXXXXXXXX

# Fireworks API (For LlamaGuard and select open-sourced models)
export FIREWORKS_API_KEY=XXXXXXXXXX

# HuggingFace Token (For GPT-OSS-SafeAguard via Groq provider)
export HF_TOKEN=XXXXXXXXXX

4. Hugging Face Authentication (for open-source models)

Some open-source models used in our benchmark (e.g., DuoGuard, WildGuard) are loaded via the 🤗 transformers package. To run these models, you'll need to authenticate with Hugging Face:

huggingface-cli login

Make sure you have an access token from https://huggingface.co/settings/tokens.

5. vLLM server (optional)

To run some open-source models locally (e.g. Qwen3Guard-Gen 8B), start a local vLLM server:

pip install vllm
vllm serve Qwen/Qwen3Guard-Gen-8B --port 8000

The server exposes an OpenAI-compatible API endpoint that the moderator will connect to.

Evaluation

1. Run content moderators on RabakBench

python moderate.py

2. Evaluate results

python evaluate.py

Results

Evaluations of 13 prominent open-source and closed-source guardrail classifiers revealed significant performance degradation on this localized, multilingual benchmark. More details on the evaluation setup can be found in our paper.

Refer to ./dataset_eda.ipynb and the ./results folder for the full set of evaluation metrics, per-language scores, and error breakdowns.

GuardrailSinglishChineseMalayTamilAverage
AWS Bedrock Guardrail66.500.5918.490.5721.54
Azure AI Content Safety66.7073.6270.7553.8666.23
Google Cloud Model Armor62.3767.9574.3073.5669.54
OpenAI Moderation66.0068.2063.186.8651.06
Perspective API37.8050.4624.321.0328.40
DuoGuard 0.5B42.2858.1536.1543.5445.03
LlamaGuard 3 8B54.7653.0552.8146.8451.86
LlamaGuard 4 12B60.5354.2065.9273.7763.60
PolyGuard 0.5B67.5175.7063.0721.2756.89
ShieldGemma 9B41.3731.8529.6122.7831.40
WildGuard 7B78.8968.8239.042.3247.27
Qwen3Guard-Gen 8B79.0482.4784.2883.2682.26
gpt-oss-safeguard-20b81.7386.6481.5776.6781.65

Citations

Please cite our paper if you find RabakBench helpful in your research!

benchmark

govtech-responsibleai/RabakBench

A curated benchmark for evaluating LLM guardrails across safety risks relevant to the Singapore context

Jupyter Notebook

3

14 commits

updated Dec 11, 2025

See the code

README

RabakBench: A Localized Multilingual Safety Benchmark

RabakBench supports evaluation of popular open-source and closed-source content moderation systems in low-resource and culturally diverse languages. This dataset covers Singlish (an English-based creole) and local variants of Chinese, Malay, and Tamil. These languages are often underrepresented in existing benchmarks, posing challenges for large language models (LLMs) and their safety classifiers.

By releasing RabakBench, we aim to advance the study of AI safety in low-resource languages by enabling robust safety evaluation in multilingual settings and providing a reproducible framework for building localized safety datasets.

[!TIP] Explore the dataset through this Jupyter Notebook

Dataset Construction

RabakBench comprises over 5,000 examples across six harm categories with severity levels. The dataset was constructed through a scalable three-stage pipeline:

  1. Generate: Adversarial example generation by augmenting real Singlish web content with LLM-driven red teaming
  2. Label: Semi-automated multi-label safety annotation using majority-voted LLM labelers aligned with human judgments
  3. Translate: High-fidelity translation preserving linguistic nuance and toxicity across languages.
RabakBench Construction Pipeline

Setup

1. Install dependencies

pip install -r requirements.txt

2. Download datasets

We support controlled access with terms of use and intent verification, to ensure responsible usage aligned with our goals of improving multilingual AI safety. Access to the full dataset is not provided to the public, instead, access the public set here.

Place the 4 datasets in the appropriate folders under the /data directory:

  • rabakbench_en.csv → /data/en/rabakbench_en.csv
  • rabakbench_ms.csv → /data/ms/rabakbench_ms.csv
  • rabakbench_ta.csv → /data/ta/rabakbench_ta.csv
  • rabakbench_zh.csv → /data/zh/rabakbench_zh.csv

3. Configure API keys

Create a .env file and add the following API keys:

# OpenAI Moderation API
export OPENAI_API_KEY=XXXXXXXXXX

# Azure Content Safety API
export AZURE_CONTENT_SAFETY_ENDPOINT="https://XXX.azure.com/"
export AZURE_CONTENT_SAFETY_KEY=XXXXXXXXXX

# AWS Moderation API
export AWS_ACCESS_KEY_ID=XXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXX
export AWS_SESSION_TOKEN=XXXXXXXXXX

# GCP Project ID (Model Armor and Perspective API)
export GCP_PROJECT_ID=XXXXXXXXXX

# Perspective API
export PERSPECTIVE_API_KEY=XXXXXXXXXX

# Fireworks API (For LlamaGuard and select open-sourced models)
export FIREWORKS_API_KEY=XXXXXXXXXX

# HuggingFace Token (For GPT-OSS-SafeAguard via Groq provider)
export HF_TOKEN=XXXXXXXXXX

4. Hugging Face Authentication (for open-source models)

Some open-source models used in our benchmark (e.g., DuoGuard, WildGuard) are loaded via the 🤗 transformers package. To run these models, you'll need to authenticate with Hugging Face:

huggingface-cli login

Make sure you have an access token from https://huggingface.co/settings/tokens.

5. vLLM server (optional)

To run some open-source models locally (e.g. Qwen3Guard-Gen 8B), start a local vLLM server:

pip install vllm
vllm serve Qwen/Qwen3Guard-Gen-8B --port 8000

The server exposes an OpenAI-compatible API endpoint that the moderator will connect to.

Evaluation

1. Run content moderators on RabakBench

python moderate.py

2. Evaluate results

python evaluate.py

Results

Evaluations of 13 prominent open-source and closed-source guardrail classifiers revealed significant performance degradation on this localized, multilingual benchmark. More details on the evaluation setup can be found in our paper.

Refer to ./dataset_eda.ipynb and the ./results folder for the full set of evaluation metrics, per-language scores, and error breakdowns.

GuardrailSinglishChineseMalayTamilAverage
AWS Bedrock Guardrail66.500.5918.490.5721.54
Azure AI Content Safety66.7073.6270.7553.8666.23
Google Cloud Model Armor62.3767.9574.3073.5669.54
OpenAI Moderation66.0068.2063.186.8651.06
Perspective API37.8050.4624.321.0328.40
DuoGuard 0.5B42.2858.1536.1543.5445.03
LlamaGuard 3 8B54.7653.0552.8146.8451.86
LlamaGuard 4 12B60.5354.2065.9273.7763.60
PolyGuard 0.5B67.5175.7063.0721.2756.89
ShieldGemma 9B41.3731.8529.6122.7831.40
WildGuard 7B78.8968.8239.042.3247.27
Qwen3Guard-Gen 8B79.0482.4784.2883.2682.26
gpt-oss-safeguard-20b81.7386.6481.5776.6781.65

Citations

Please cite our paper if you find RabakBench helpful in your research!

benchmark