vvsd-charan commited on
Commit
a7d1c5d
·
verified ·
1 Parent(s): 44ecafc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +105 -84
README.md CHANGED
@@ -1,48 +1,46 @@
1
  ---
2
- annotations_creators:
3
- - no-annotation
4
- language:
5
- - en
6
- language_creators:
7
- - machine-generated
8
- multilinguality:
9
- - monolingual
10
- size_categories:
11
- - 10K<n<100K
12
- source_datasets:
13
- - original
14
  task_categories:
15
- - text-generation
16
  task_ids:
17
- - text2text-generation
18
- license: cc-by-4.0
19
- pretty_name: Safety Aligned Datasets
20
- viewer: true
 
21
  configs:
22
- - config_name: beavertails
23
- data_files:
24
- - split: harmful
25
- path: beavertails_unsafe_vllm.csv
26
- - config_name: donot_answer
27
- data_files:
28
- - split: harmful
29
- path: donot_answer_vllm.csv
30
- - config_name: forbidden_questions
31
- data_files:
32
- - split: harmful
33
- path: forbidden_questions_vllm.csv
34
- - config_name: harmfulqa
35
- data_files:
36
- - split: harmful
37
- path: harmfulqa_vllm.csv
38
- - config_name: llm_redteaming
39
- data_files:
40
- - split: harmful
41
- path: llm_redteaming_vllm.csv
42
- - config_name: synthetic_harmful_prompts
43
- data_files:
44
- - split: harmful
45
- path: synthetic_harmful_prompts_vllm.csv
 
 
 
 
 
 
 
 
46
  ---
47
 
48
  # Safety Aligned Datasets
@@ -51,7 +49,7 @@ configs:
51
 
52
  *A high-fidelity adversarial corpus engineered for alignment research, refusal boundary modeling, and robustness evaluation of Small Language Models.*
53
 
54
- [![License: CC-BY-4.0](https://img.shields.io/badge/License-CC--BY--4.0-blue.svg)]() [![Split: harmful](https://img.shields.io/badge/Split-harmful-red)]() [![Configs: 6](https://img.shields.io/badge/Configurations-6-orange)]() [![Engine: vLLM](https://img.shields.io/badge/Engine-vLLM-green)]()
55
 
56
  </div>
57
 
@@ -59,91 +57,117 @@ configs:
59
 
60
  ## The Problem This Solves
61
 
62
- - Fine-tuning a Small Language Model to be safe is not the same as fine-tuning it to *understand* safety.
63
 
64
- - Most safety datasets give models clean refusal examples on obvious prompts — and those models fail the moment an adversary wraps a harmful request in a hypothetical, a role-play, or a chain of plausible reasoning. The failure is not in the refusal mechanism. It's in the **coverage gap**: the model has never been exposed to the attack surface it will face in the wild.
65
 
66
- - This dataset was built to close that gap.
67
 
68
  ---
69
 
70
- ## What Makes It Technically Valuable
 
 
71
 
72
- ### 🎯 Multi-Vector Adversarial Coverage
73
 
74
- Unlike single-source safety datasets that skew toward one threat category, this corpus spans **six distinct adversarial configurations** — each targeting a different failure mode in model alignment:
75
 
76
- - **`beavertails`** covers the canonical safety meta-categories (violence, hate speech, self-harm) drawn from one of the most widely cited safety benchmarks in the field. It gives your model a principled baseline across well-defined harm taxonomies.
 
77
 
78
- - **`donot_answer`** maps prompts to a structured AI safety evaluation framework, making it ideal for benchmarking against established refusal rubrics and comparing alignment progress across model versions.
 
79
 
80
- - **`forbidden_questions`** is the most adversarially complex configuration — prompts are designed with fictional framing, nested hypotheticals, and philosophical edge cases. This is where naive keyword-based safety mechanisms consistently break down.
 
81
 
82
- - **`harmfulqa`** focuses on query-style harmful inputs that mimic real user behavior. The risk vectors span multiple domains, making this subset critical for models deployed in open-ended conversational settings.
 
83
 
84
- - **`llm_redteaming`** contains empirical jailbreaks documented during public and academic red-teaming exercises. These are prompts that have *already succeeded* in the wild — your model needs to have seen them.
 
85
 
86
- - **`synthetic_harmful_prompts`** is forward-looking: adversarially generated expansions that simulate novel, unseen attack patterns. This is your zero-day stress test — it pushes models to generalize safe behavior rather than memorize safe responses.
 
87
 
88
- Together, these configurations give a model exposure to the **full adversarial stack**: known attacks, structured taxonomies, behavioral mimicry, fictional obfuscation, and generative novelty.
 
89
 
90
  ---
91
 
92
- ### 🧠 Built for SLM Alignment Specifically
93
 
94
- Large models can absorb safety training with relatively few examples. Small Language Models cannot afford that luxury — they are data-efficient learners with sharper trade-offs between helpfulness and safety.
 
95
 
96
- This dataset is optimized for that constraint:
97
 
98
- **Supervised Fine-Tuning (SFT) with contrastive pairing** — Each adversarial prompt and its generated response can be paired with a curated safe response to create preference pairs. The model learns not just *what* to refuse, but *how* to refuse in a way that is polite, reasoned, and non-dismissive.
99
 
100
- **Direct Preference Optimization (DPO)** — The `(prompt, safety_res, model)` triplet structure maps naturally onto DPO's chosen/rejected framework. The `safety_res` field provides baseline behavior; researchers can use that as the rejected sample against a human-curated or GPT-4-verified chosen response, enabling efficient preference learning without a reward model.
101
 
102
- **False-Refusal Calibration** — Over-refusal is an alignment failure too. Several configurations — particularly `forbidden_questions` and `harmfulqa` — include borderline inputs that use sensitive keywords in genuinely benign contexts. Training on these teaches a model to reason about *intent*, not just surface-level patterns.
103
 
104
- ---
105
 
106
- ### ⚙️ Generation Pipeline
107
 
108
- The dataset was generated using a principled, high-throughput pipeline designed for reproducibility and inference efficiency:
109
 
110
- ```
111
- Base Model → TheBloke/Mistral-7B-Instruct-v0.2-AWQ
112
- Engine → vLLM (Vectorized LLM inference framework)
113
- Hardware → NVIDIA T4 GPU · 16GB VRAM · Google Colab
114
- ```
115
 
116
- **Why Mistral-7B-Instruct-v0.2-AWQ?** It sits at the intersection of strong instruction-following and accessible compute — making it representative of the exact model class this dataset is designed to align. Responses generated by a model *in the same capability tier* as the target are more realistic training signal than outputs from a frontier model.
117
 
118
- **Why vLLM?** Batch processing at scale across six heterogeneous prompt distributions requires a framework that can handle dynamic context lengths without throughput collapse. vLLM's PagedAttention mechanism makes this practical on constrained hardware.
119
 
120
  ---
121
 
122
- ### 🗂️ Jailbreak Taxonomy: What Your Model Will Learn to Handle
123
 
124
- The adversarial techniques present across configurations cover the full spectrum of known attack classes:
125
 
126
- **Role-Play Frameworks** — Instructions that force the model into an alternate persona (developer mode, uncensored assistant, fictional AI with no restrictions). These exploit the model's instruction-following strength against its safety constraints.
 
127
 
128
- **Hypothetical Contextualization** — Harmful requests buried inside academic thought experiments, historical framing, or fictional narratives. The surface text appears benign; the extracted information is not.
 
129
 
130
- **Linguistic Obfuscation** — Multi-turn logical chains, domain jargon, and structural misdirection designed to bypass keyword filters and confuse intent classifiers. These require the model to reason about the *trajectory* of a conversation, not just the final message.
 
131
 
132
- Exposure to all three classes — individually and in combination — is what separates a model that has learned to refuse from a model that has learned to *stay safe*.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
  ---
135
 
136
  ## Data Schema
137
 
138
- Each record contains three fields:
139
 
140
  - **`prompt`** — The raw adversarial or harmful input instruction, unmodified from its source
141
- - **`safety_res`** — The response generated by the inference model during the generation pipeline
142
  - **`model`** — The specific model variant used, enabling controlled ablation studies across response sources
143
 
144
  ---
145
 
146
- ## Licensing & Attribution
147
 
148
  Upstream data portions — drawn from `BeaverTails`, `DoNotAnswer`, `HarmfulQA`, and associated red-teaming sets — retain their original licenses (CC-BY-SA 4.0, MIT, Apache 2.0). Users are responsible for compliance with each upstream source's terms.
149
 
@@ -151,7 +175,4 @@ The unified compilation framework and all synthetic responses are released under
151
 
152
  ---
153
 
154
- > ⚠️ **Disclaimer:** This dataset contains explicit, toxic, and adversarial content. It exists to advance the science of AI safety, alignment, and defensive model training. The maintainers do not condone or encourage the execution of any harmful behaviors described within these prompts. Deploy responsibly, in controlled research environments only.
155
-
156
-
157
-
 
1
  ---
2
+ license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
3
  task_categories:
4
+ - text-generation
5
  task_ids:
6
+ - text2text-generation
7
+ language:
8
+ - en
9
+ size_categories:
10
+ - 10K<n<100K
11
  configs:
12
+ - config_name: beavertails
13
+ data_files:
14
+ - split: harmful
15
+ path: beavertails_unsafe_vllm.csv
16
+ - config_name: donot_answer
17
+ data_files:
18
+ - split: harmful
19
+ path: donot_answer_vllm.csv
20
+ - config_name: forbidden_questions
21
+ data_files:
22
+ - split: harmful
23
+ path: forbidden_questions_vllm.csv
24
+ - config_name: harmfulqa
25
+ data_files:
26
+ - split: harmful
27
+ path: harmfulqa_vllm.csv
28
+ - config_name: llm_redteaming
29
+ data_files:
30
+ - split: harmful
31
+ path: llm_redteaming_vllm.csv
32
+ - config_name: synthetic_harmful_prompts
33
+ data_files:
34
+ - split: harmful
35
+ path: synthetic_harmful_prompts_vllm.csv
36
+ - config_name: prompt_injection_unsafe_vllm
37
+ data_files:
38
+ - split: harmful
39
+ path: prompt_injection_unsafe_vllm.csv
40
+ - config_name: prompt_injection_safe_vllm
41
+ data_files:
42
+ - split: safe
43
+ path: prompt_injection_safe_vllm.csv
44
  ---
45
 
46
  # Safety Aligned Datasets
 
49
 
50
  *A high-fidelity adversarial corpus engineered for alignment research, refusal boundary modeling, and robustness evaluation of Small Language Models.*
51
 
52
+ [![License: CC-BY-4.0](https://img.shields.io/badge/License-CC--BY--4.0-blue.svg)]() [![Harmful Split](https://img.shields.io/badge/Split-harmful-red)]() [![Safe Split](https://img.shields.io/badge/Split-safe-brightgreen)]() [![Configs: 8](https://img.shields.io/badge/Configurations-8-orange)]() [![Engine: vLLM](https://img.shields.io/badge/Engine-vLLM-green)]()
53
 
54
  </div>
55
 
 
57
 
58
  ## The Problem This Solves
59
 
60
+ Fine-tuning a Small Language Model to be safe is not the same as fine-tuning it to *understand* safety.
61
 
62
+ Most safety datasets give models clean refusal examples on obvious prompts — and those models fail the moment an adversary wraps a harmful request in a hypothetical, a role-play, or a chain of plausible reasoning. The failure is not in the refusal mechanism. It is in the **coverage gap**: the model has never been exposed to the attack surface it will actually face in deployment.
63
 
64
+ This dataset was built to close that gap — and to go further. Because alignment is not just about refusal. It is about teaching a model to handle adversarial manipulation at the system level, including direct attacks on its own instruction context.
65
 
66
  ---
67
 
68
+ ## Dataset Overview
69
+
70
+ This corpus spans **eight configurations** across **two splits**, each targeting a distinct failure mode in model alignment.
71
 
72
+ ### The `harmful` Split
73
 
74
+ This split contains adversarial prompts and model-generated responses representing unsafe behavior across seven configurations. Each configuration covers a different attack class or harm domain.
75
 
76
+ **`beavertails`**
77
+ Covers the canonical safety meta-categories — violence, hate speech, self-harm — drawn from one of the most widely cited safety benchmarks in the field. A principled baseline across well-defined harm taxonomies.
78
 
79
+ **`donot_answer`**
80
+ Prompts mapped to a structured AI safety evaluation framework. Best suited for benchmarking against established refusal rubrics and tracking alignment progress across model versions.
81
 
82
+ **`forbidden_questions`**
83
+ The most adversarially complex configuration. Prompts rely on fictional framing, nested hypotheticals, and philosophical edge cases — exactly where naive keyword-based safety mechanisms consistently break down.
84
 
85
+ **`harmfulqa`**
86
+ Query-style harmful inputs that closely mimic real user behavior. Risk vectors span multiple domains, making this subset particularly important for models deployed in open-ended conversational settings.
87
 
88
+ **`llm_redteaming`**
89
+ Empirical jailbreaks documented during public and academic red-teaming exercises. These are prompts that have already succeeded in the wild — your model needs to have seen them before deployment.
90
 
91
+ **`synthetic_harmful_prompts`**
92
+ Adversarially generated expansions that simulate novel, unseen attack patterns. A zero-day stress test designed to push models toward generalizing safe behavior rather than memorizing safe responses.
93
 
94
+ **`prompt_injection_unsafe_vllm`**
95
+ Targets a distinct and increasingly critical threat class: prompt injection attacks. These prompts attempt to override or hijack the model's system-level instructions through crafted user inputs — a common real-world attack vector in agentic and tool-augmented LLM deployments. Exposure to this subset is essential for any model operating in a pipeline where user input reaches the inference context alongside a system prompt.
96
 
97
  ---
98
 
99
+ ### The `safe` Split
100
 
101
+ **`prompt_injection_safe_vllm`**
102
+ The structural counterpart to the unsafe injection configuration above. These records show the model correctly maintaining its intended behavior under injection pressure — ignoring override instructions and staying within its sanctioned boundaries. When paired with the unsafe configuration in a DPO or contrastive SFT setup, these serve as the *chosen* side of the preference pair.
103
 
104
+ ---
105
 
106
+ ## How to Use This Dataset
107
 
108
+ ### Supervised Fine-Tuning (SFT)
109
 
110
+ Each adversarial prompt and its generated response can be paired with a curated safe response to create contrastive training examples. The model learns not just what to refuse, but how to refuse in a way that is polite, reasoned, and non-dismissive.
111
 
112
+ ### Direct Preference Optimization (DPO)
113
 
114
+ The `(prompt, safety_res, model)` triplet structure maps naturally onto DPO's chosen/rejected framework. The `safety_res` field provides the baseline behavior to use as the rejected sample, paired against a human-curated or verified chosen response. For the prompt injection configurations specifically, `prompt_injection_unsafe_vllm` and `prompt_injection_safe_vllm` form a ready-made contrastive pair without any additional annotation overhead.
115
 
116
+ ### False-Refusal Calibration
117
 
118
+ Over-refusal is an alignment failure too. Several configurations — particularly `forbidden_questions` and `harmfulqa` — include borderline inputs that use sensitive keywords in genuinely benign contexts. Training on these teaches a model to reason about intent, not just surface-level patterns.
 
 
 
 
119
 
120
+ ### Prompt Injection Robustness
121
 
122
+ With LLMs increasingly deployed in agentic workflows, RAG pipelines, and tool-use environments, resistance to instruction hijacking is no longer optional. The injection split pair directly addresses this training gap, which most general-purpose safety datasets ignore entirely.
123
 
124
  ---
125
 
126
+ ## Adversarial Technique Reference
127
 
128
+ The prompts across all configurations cover four primary attack classes:
129
 
130
+ **Role-Play Frameworks**
131
+ Instructions that force the model into an alternate persona — developer mode, uncensored assistant, fictional AI with no restrictions. These exploit the model's instruction-following strength directly against its safety constraints.
132
 
133
+ **Hypothetical Contextualization**
134
+ Harmful requests buried inside academic thought experiments, historical framing, or fictional narratives. The surface text appears benign; the extracted information is not.
135
 
136
+ **Linguistic Obfuscation**
137
+ Multi-turn logical chains, domain jargon, and structural misdirection designed to bypass keyword filters and confuse intent classifiers. These require the model to reason about the trajectory of a conversation, not just the final message in isolation.
138
 
139
+ **Prompt Injection**
140
+ Direct attempts to override system-level instructions through adversarially crafted user inputs. Variants include goal hijacking (redirecting the model to a different task), prompt leakage (extracting the system prompt), and jailbreak injection (embedding role-play attacks inside what appears to be ordinary user data). Particularly relevant for RAG systems, tool-augmented agents, and any deployment where user input coexists with a privileged system context.
141
+
142
+ ---
143
+
144
+ ## Generation Pipeline
145
+
146
+ ```
147
+ Base Model → TheBloke/Mistral-7B-Instruct-v0.2-AWQ
148
+ Engine → vLLM (Vectorized LLM inference framework)
149
+ Hardware → NVIDIA T4 GPU · 16GB VRAM · Google Colab
150
+ ```
151
+
152
+ **Why Mistral-7B-Instruct-v0.2-AWQ?**
153
+ It sits at the intersection of strong instruction-following capability and accessible compute — representative of the exact model class this dataset is designed to align. Responses generated by a model in the same capability tier as the training target produce more realistic and transferable training signal than outputs from a frontier model.
154
+
155
+ **Why vLLM?**
156
+ Batch processing across eight heterogeneous prompt distributions requires a framework that handles dynamic context lengths without throughput collapse. vLLM's PagedAttention mechanism makes this practical on constrained hardware.
157
 
158
  ---
159
 
160
  ## Data Schema
161
 
162
+ Each record across all configurations contains three fields:
163
 
164
  - **`prompt`** — The raw adversarial or harmful input instruction, unmodified from its source
165
+ - **`safety_res`** — The response generated by the inference model during the pipeline run
166
  - **`model`** — The specific model variant used, enabling controlled ablation studies across response sources
167
 
168
  ---
169
 
170
+ ## Licensing and Attribution
171
 
172
  Upstream data portions — drawn from `BeaverTails`, `DoNotAnswer`, `HarmfulQA`, and associated red-teaming sets — retain their original licenses (CC-BY-SA 4.0, MIT, Apache 2.0). Users are responsible for compliance with each upstream source's terms.
173
 
 
175
 
176
  ---
177
 
178
+ > **Disclaimer:** This dataset contains explicit, toxic, and adversarial content. It is hosted exclusively to advance the science of AI safety, alignment, and defensive model training. The maintainers do not condone or encourage the execution of any harmful behaviors described within these prompts. Use only in controlled research environments.