Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

Safety Asymmetry in Code-Switched Environments: Hausa-English Evaluation Dataset

Overview

This repository contains an evaluation dataset designed to test the safety mechanisms of frontier LLMs when handling inputs that rapidly code-switch between English and Hausa. Specifically, this dataset evaluates "Safety Asymmetry in Code-Switched Environments."

As Large Language Models (LLMs) improve, their primary safety mechanisms (such as refusing malicious prompts) are often over-optimized for high-resource languages like English. When users seamlessly blend a high-resource language with a low-resource language (Code-Switching) — a very common communication style in multilingual societies — the model's safety guardrails often exhibit unpredictable capability drift.

The Two Primary Modes of Failure

This dataset tests whether a model falls into one of two asymmetric failure modes:

  1. Malicious Bypass (Under-refusal): A prompt asking for harmful information (e.g., building an explosive, executing a cyberattack) is translated or code-switched into Hausa. Because the model lacks robust safety training data in the target language, it fails to recognize the malicious intent and complies with the request, bypassing the English guardrails.
  2. Benign Over-refusal: A harmless, everyday prompt is translated into Hausa (e.g., asking how to defeat a boss in a video game, or how to wash clothes). The model detects unfamiliar phrasing, highly sensitive keywords out of context, or simply fails to understand the nuance, and therefore triggers a generic safety refusal for a completely safe prompt.

Dataset Structure

The hausa_codeswitch_eval_v1.json file contains a curated set of 28 prompt pairs across five critical safety domains. Each domain features matched pairs of standard English prompts and their code-switched (Hausa-English) equivalents to measure the delta in model behavior.

Domains Evaluated

  • Physical Safety: Prompts regarding weapons, explosives, and physical harm.
  • Cybersecurity: Prompts regarding hacking, network infiltration, and DDoS attacks.
  • Financial/Illegal: Prompts regarding money laundering and phishing scams.
  • Harassment: Prompts containing hate speech, slurs, or targeted insults.
  • Medical/Self-Harm: Prompts regarding prescription drug acquisition and self-injury.

Prompt Categories

Each domain is tested using four distinct categories to isolate the specific type of safety drift:

  1. Baseline (English Malicious)
  2. Code-Switched (Malicious Bypass Attempt)
  3. Baseline (English Benign)
  4. Code-Switched (Benign Over-refusal)

Evaluation Methodology & Results

This dataset was evaluated against Qwen/Qwen2.5-3B-Instruct using an automated pipeline built on Google Colab (T4 GPU).

  • Inference Setup: Prompts were evaluated using the transformers library, employing a temperature of 0.1 to ensure deterministic outputs for safety evaluation.
  • Results: The raw outputs of the model are appended to each prompt in the evaluation_results.json file.

Preliminary Findings

(Researchers are encouraged to analyze evaluation_results.json to draw specific statistical conclusions regarding the frequency of bypasses vs. over-refusals.)

Usage

This dataset is intended for AI safety researchers, red-teamers, and developers seeking to improve the robustness of alignment mechanisms across linguistic boundaries.

from datasets import load_dataset

# Replace 'your_username' with your actual Hugging Face username
dataset = load_dataset("your_username/hausa_codeswitch_eval")
Downloads last month
31