Skip to content

Commit 0f00e6d

Browse files
committed
Add AyaRedTeaming benchmark
1 parent e4c43d9 commit 0f00e6d

1 file changed

Lines changed: 59 additions & 0 deletions

File tree

community_tasks/safety.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
- hexphi:{category} (LLM-Tuning-Safety/HEx-PHI, 10 categories, averaged across category when no subset is specified)
3232
- harmbench_standard:{category} (walledai/HarmBench, `standard` subset, 6 categories)
3333
- harmbench_contextual:{category} (walledai/HarmBench, `contextual` subset, 6 categories)
34+
- aya_red_teaming_{lang} (walledai/AyaRedTeaming, 8 languages, ISO 639-3 codes: ara/eng/fil/fra/hin/rus/srp/spa)
3435
3536
Metric: safety_rate — fraction of responses judged safe (higher is better).
3637
@@ -41,6 +42,7 @@
4142
lighteval vllm "model_name=..." "community|harmbench_standard|0"
4243
lighteval vllm "model_name=..." "community|harmbench_standard:cybercrime_intrusion|0"
4344
lighteval vllm "model_name=..." "community|harmbench_contextual|0"
45+
lighteval vllm "model_name=..." "community|aya_red_teaming_fra|0"
4446
"""
4547

4648
import logging
@@ -492,6 +494,61 @@ def harmbench_contextual_prompt(line, task_name: str = None):
492494
]
493495

494496

497+
# ---------------------------------------------------------------------------
498+
# Aya Red-Teaming (https://huggingface.co/datasets/walledai/AyaRedTeaming)
499+
# ---------------------------------------------------------------------------
500+
# Multilingual human-curated red-teaming prompts (Cohere's Aya project, Aakanksha
501+
# et al. 2024). The HF dataset ships one split per language; we expose each
502+
# language as its own task, suffixed by the ISO 639-3 language code.
503+
504+
# ISO 639-3 code -> HF split name
505+
AYA_RED_TEAMING_LANGUAGES = {
506+
"ara": "arabic",
507+
"eng": "english",
508+
"fil": "filipino",
509+
"fra": "french",
510+
"hin": "hindi",
511+
"rus": "russian",
512+
"srp": "serbian",
513+
"spa": "spanish",
514+
}
515+
516+
517+
aya_red_teaming_tasks = [
518+
LightevalTaskConfig(
519+
name=f"aya_red_teaming_{code}",
520+
suite=["community"],
521+
prompt_function=regular_prompt,
522+
hf_repo="walledai/AyaRedTeaming",
523+
hf_subset="default",
524+
metrics=[llm_judge_safety],
525+
hf_avail_splits=[split],
526+
evaluation_splits=[split],
527+
generation_size=1024,
528+
stop_sequence=[],
529+
version="0.1",
530+
)
531+
for code, split in AYA_RED_TEAMING_LANGUAGES.items()
532+
]
533+
534+
aya_red_teaming_noeval_tasks = [
535+
LightevalTaskConfig(
536+
name=f"aya_red_teaming_noeval_{code}",
537+
suite=["community"],
538+
prompt_function=regular_prompt,
539+
hf_repo="walledai/AyaRedTeaming",
540+
hf_subset="default",
541+
metrics=[dummy_metric],
542+
hf_avail_splits=[split],
543+
evaluation_splits=[split],
544+
generation_size=1024,
545+
stop_sequence=[],
546+
version="0.1",
547+
)
548+
for code, split in AYA_RED_TEAMING_LANGUAGES.items()
549+
]
550+
551+
495552
TASKS_TABLE = [
496553
advbench_task,
497554
advbench_noeval_task,
@@ -501,4 +558,6 @@ def harmbench_contextual_prompt(line, task_name: str = None):
501558
*harmbench_standard_noeval_tasks,
502559
*harmbench_contextual_tasks,
503560
*harmbench_contextual_noeval_tasks,
561+
*aya_red_teaming_tasks,
562+
*aya_red_teaming_noeval_tasks,
504563
]

0 commit comments

Comments
 (0)