Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
csv
Sub-tasks:
text2text-generation
Languages:
English
Size:
10K - 100K
License:
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,3 +5,70 @@ configs:
|
|
| 5 |
- config_name: safe
|
| 6 |
data_files: harmful/beavertails_unsafe_cot.json
|
| 7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- config_name: safe
|
| 6 |
data_files: harmful/beavertails_unsafe_cot.json
|
| 7 |
---
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
# BeaverTails Safety Fine-tuning Dataset
|
| 11 |
+
|
| 12 |
+
## Dataset Overview
|
| 13 |
+
This dataset extends the BeaverTails harmful QA evaluation benchmark by providing **paired safe responses** for harmful prompts alongside safe prompts.
|
| 14 |
+
|
| 15 |
+
- **Harmful subset** (`config_name: "harmful"`): Unique harmful prompts extracted from BeaverTails + generated safe refusal responses categorized into 14 safety violation types.
|
| 16 |
+
- **Safe subset** (`config_name: "safe"`): Safe prompts + ambiguous prompts that appear harmful but are safe, all paired with appropriate safe responses.
|
| 17 |
+
|
| 18 |
+
## Safety Categories (Harmful Refusals)
|
| 19 |
+
Safe refusals for harmful prompts are organized by these 14 categories:
|
| 20 |
+
- animal_abuse
|
| 21 |
+
- child_abuse
|
| 22 |
+
- controversial_topics,politics
|
| 23 |
+
- discrimination,stereotype,injustice
|
| 24 |
+
- drug_abuse,weapons,banned_substance
|
| 25 |
+
- financial_crime,property_crime,theft
|
| 26 |
+
- hate_speech,offensive_language
|
| 27 |
+
- misinformation_regarding_ethics,laws_and_safety
|
| 28 |
+
- non_violent_unethical_behavior
|
| 29 |
+
- privacy_violation
|
| 30 |
+
- self_harm
|
| 31 |
+
- sexually_explicit,adult_content
|
| 32 |
+
- terrorism,organized_crime
|
| 33 |
+
- violence,aiding_and_abetting,incitement
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
## Usage
|
| 37 |
+
Load specific subsets:
|
| 38 |
+
```python
|
| 39 |
+
from datasets import load_dataset
|
| 40 |
+
|
| 41 |
+
# Harmful prompts + safe refusals
|
| 42 |
+
ds_harmful = load_dataset("yourusername/yourrepo", "harmful")
|
| 43 |
+
|
| 44 |
+
# Safe prompts + safe responses
|
| 45 |
+
ds_safe = load_dataset("yourusername/yourrepo", "safe")
|
| 46 |
+
|
| 47 |
+
# Full dataset (both configs)
|
| 48 |
+
ds = load_dataset("yourusername/yourrepo")
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Intended Use
|
| 52 |
+
**Primary**: Supervised fine-tuning (SFT) of small language models (SLMs) to improve safe text generation.
|
| 53 |
+
|
| 54 |
+
**Benefits**:
|
| 55 |
+
- Teaches models to recognize harmful intent and respond with safe refusals
|
| 56 |
+
- Provides safe alternatives for ambiguous prompts
|
| 57 |
+
- Critical for SLM deployment in user-facing applications
|
| 58 |
+
- Addresses rising need for model safety in production environments
|
| 59 |
+
|
| 60 |
+
## Dataset Structure
|
| 61 |
+
Each example contains:
|
| 62 |
+
- `prompt`: Harmful/safe prompt text
|
| 63 |
+
- `response`: Corresponding safe response (refusal for harmful, completion for safe)
|
| 64 |
+
- `category`: Safety violation type (harmful subset only)
|
| 65 |
+
|
| 66 |
+
## Responsible Use
|
| 67 |
+
⚠️ **Harmful prompts are included for safety training only.** Do not use raw harmful prompts for generation. Always validate model outputs before production deployment.
|
| 68 |
+
|
| 69 |
+
## Creation Process
|
| 70 |
+
- Extracted all unique harmful prompts from the original BeaverTails dataset
|
| 71 |
+
- Generated safe refusal responses for harmful prompts (14 categories)
|
| 72 |
+
- Curated safe prompts including ambiguous-but-safe examples
|
| 73 |
+
- Formatted as instruction-response pairs for SFT
|
| 74 |
+
|