AlphaHacker1729 cparisien commited on
Commit
93a991d
·
0 Parent(s):

Duplicate from nvidia/Aegis-AI-Content-Safety-Dataset-2.0

Browse files

Co-authored-by: Chris Parisien <cparisien@users.noreply.huggingface.co>

Files changed (7) hide show
  1. .gitattributes +60 -0
  2. README.md +218 -0
  3. refusals_train.json +3 -0
  4. refusals_validation.json +3 -0
  5. test.json +3 -0
  6. train.json +3 -0
  7. validation.json +3 -0
.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
12
+ *.mds filter=lfs diff=lfs merge=lfs -text
13
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
14
+ *.model filter=lfs diff=lfs merge=lfs -text
15
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
16
+ *.npy filter=lfs diff=lfs merge=lfs -text
17
+ *.npz filter=lfs diff=lfs merge=lfs -text
18
+ *.onnx filter=lfs diff=lfs merge=lfs -text
19
+ *.ot filter=lfs diff=lfs merge=lfs -text
20
+ *.parquet filter=lfs diff=lfs merge=lfs -text
21
+ *.pb filter=lfs diff=lfs merge=lfs -text
22
+ *.pickle filter=lfs diff=lfs merge=lfs -text
23
+ *.pkl filter=lfs diff=lfs merge=lfs -text
24
+ *.pt filter=lfs diff=lfs merge=lfs -text
25
+ *.pth filter=lfs diff=lfs merge=lfs -text
26
+ *.rar filter=lfs diff=lfs merge=lfs -text
27
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
28
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar filter=lfs diff=lfs merge=lfs -text
31
+ *.tflite filter=lfs diff=lfs merge=lfs -text
32
+ *.tgz filter=lfs diff=lfs merge=lfs -text
33
+ *.wasm filter=lfs diff=lfs merge=lfs -text
34
+ *.xz filter=lfs diff=lfs merge=lfs -text
35
+ *.zip filter=lfs diff=lfs merge=lfs -text
36
+ *.zst filter=lfs diff=lfs merge=lfs -text
37
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
38
+ # Audio files - uncompressed
39
+ *.pcm filter=lfs diff=lfs merge=lfs -text
40
+ *.sam filter=lfs diff=lfs merge=lfs -text
41
+ *.raw filter=lfs diff=lfs merge=lfs -text
42
+ # Audio files - compressed
43
+ *.aac filter=lfs diff=lfs merge=lfs -text
44
+ *.flac filter=lfs diff=lfs merge=lfs -text
45
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
46
+ *.ogg filter=lfs diff=lfs merge=lfs -text
47
+ *.wav filter=lfs diff=lfs merge=lfs -text
48
+ # Image files - uncompressed
49
+ *.bmp filter=lfs diff=lfs merge=lfs -text
50
+ *.gif filter=lfs diff=lfs merge=lfs -text
51
+ *.png filter=lfs diff=lfs merge=lfs -text
52
+ *.tiff filter=lfs diff=lfs merge=lfs -text
53
+ # Image files - compressed
54
+ *.jpg filter=lfs diff=lfs merge=lfs -text
55
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
56
+ *.webp filter=lfs diff=lfs merge=lfs -text
57
+ # Video files - compressed
58
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
59
+ *.webm filter=lfs diff=lfs merge=lfs -text
60
+ *.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+ pretty_name: Nemotron Content Safety Dataset V2
6
+ task_categories:
7
+ - text-classification
8
+ tags:
9
+ - safety
10
+ - content moderation
11
+ - LLM safety
12
+ - toxicity detection
13
+ - nemoguard
14
+ - aegis
15
+ - nemoguard
16
+ - nemotron
17
+ size_categories:
18
+ - 10K<n<100K
19
+
20
+ configs:
21
+ - config_name: default
22
+ data_files:
23
+ - split: train
24
+ path:
25
+ - "train.json"
26
+ - "refusals_train.json"
27
+ - split: validation
28
+ path:
29
+ - "validation.json"
30
+ - "refusals_validation.json"
31
+ - split: test
32
+ path: "test.json"
33
+ default: true
34
+ ---
35
+
36
+ # 🛡️ Nemotron Content Safety Dataset V2
37
+
38
+ <!-- Provide a quick summary of the dataset. -->
39
+
40
+ The **Nemotron Content Safety Dataset V2**, formerly known as Aegis AI Content Safety Dataset 2.0, is comprised of `33,416` annotated interactions between humans and LLMs, split into `30,007` training samples, `1,445` validation samples, and `1,964` test samples. This release is an extension of the previously published [Nemotron Content Safety Dataset V1](https://huggingface.co/datasets/nvidia/Aegis-AI-Content-Safety-Dataset-1.0).
41
+
42
+ To curate the dataset, we use the HuggingFace version of human preference data about harmlessness from [Anthropic HH-RLHF](https://huggingface.co/datasets/Anthropic/hh-rlhf). We extract only the prompts, and elicit responses from [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1). Mistral v0.1 excels at instruction following, both harmful and unharmful, and thus generates high quality responses for the content moderation categories as compared to more recent models that have higher refusal rates for harmful instructions due to their safety alignment.
43
+
44
+ The dataset adheres to a comprehensive and adaptable taxonomy for categorizing safety risks, structured into 12 top-level hazard categories with an extension to 9 fine-grained subcategories. The dataset leverages a hybrid data generation pipeline that combines human annotations at full dialog level with a multi-LLM "jury" system to assess the safety of responses.
45
+
46
+ ## Dataset Details
47
+
48
+ ### Dataset Description
49
+
50
+ Our curated [training dataset](../data/llama_training_ready/) consists of a mix collected or generated using the following data sources.
51
+ * Human-written prompts collected from the [Anthropic RLHF](https://huggingface.co/datasets/Anthropic/hh-rlhf), [Do-Anything-Now DAN](https://github.com/verazuo/jailbreak_llms), and [AI-assisted Red-Teaming](https://www.kaggle.com/datasets/mpwolke/aart-ai-safety) datasets.
52
+ * LLM responses generated from [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
53
+ * Response safety labels generated using ensemble of 3 LLMs: [Mixtral-8x22B-v0.1](https://huggingface.co/mistralai/Mixtral-8x22B-v0.1), [Mistral-NeMo-12B-Instruct](https://huggingface.co/nvidia/Mistral-NeMo-12B-Instruct), and [Gemma-2-27B-it](https://huggingface.co/google/gemma-2-27b-it).
54
+ * We additionally mix-in refusal data generated using [Gemma-2-27B](https://build.nvidia.com/google/gemma-2-27b-it/modelcard.md) using custom prompt-engineered deflection strategies.
55
+ * Further data augmentation with [topic-following data](https://gitlab-master.nvidia.com/dialogue-research/topic_following/-/tree/main?ref_type=heads) generated using [Mixtral-8x7B-v0.1](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1) is found to improve the robustness and adaptability of the model to custom categories.
56
+
57
+ Additionally, for addressing the critical harm category of `Suicide and Self-Harm`, we have annotated about 358 samples from this [Suicide Detection dataset](https://www.kaggle.com/datasets/nikhileswarkomati/suicide-watch?select=Suicide_Detection.csv) according to our taxonomy. We do not distribute these samples as part of this dataset. For more information on how to use these particular samples, see section on [Dataset Structure](#dataset-structure).
58
+
59
+ **Data Collection Method**
60
+ * Hybrid: Human annotations with synthetic LLM augmentations
61
+
62
+ **Labeling Method**
63
+ * Human - Overall content safety labels for the conversation
64
+ * Synthetic - Response safety label augmentation where needed
65
+
66
+ **Properties:**
67
+ The Aegis 2.0 dataset contains `25,007` user prompts, user prompts and LLM response single turn, user prompts and LLM response muliple turns. The validation set has `1,245` samples and test set has `1,964` samples from the above distribution.
68
+
69
+ Additionally, the training dataset also contains `5,000` refusals data, where responses are synthetically generated using custom prompt-engineered deflection strategies. The validation set has `200` refusal samples and we do not augment the held out test set with any synthetic refusal data.
70
+
71
+ For training robust guard models that we release along with this dataset, we additionally use a specific type of data called [Topic-Following](https://huggingface.co/datasets/nvidia/CantTalkAboutThis-Topic-Control-Dataset) which has approximately ~8k samples that can be downloaded from this link.
72
+
73
+ - **Curated by:** NeMo Guardrails team, Nvidia.
74
+ - **Paper:** [AEGIS2.0: A Diverse AI Safety Dataset and
75
+ Risks Taxonomy for Alignment of LLM Guardrails](https://openreview.net/pdf?id=0MvGCv35wi)
76
+ - **Language(s) (NLP):** English (may contain small samples in other languages).
77
+ - **License:** CC-BY-4.0
78
+
79
+ ## Uses
80
+
81
+ ### Direct Use
82
+
83
+ 1. To build LLM content safety moderation guardrails for LLMs, can be used to train both prompt and response moderation.
84
+
85
+ 2. Can be used for alignment of general purpose LLMs towards safety along with carefully using the data for safe-unsafe preference pairs.
86
+
87
+
88
+ ### Out-of-Scope Use
89
+
90
+ The data contain content that may be offensive or upsetting. Topics include, but are not limited to, discriminatory language and discussions of abuse, violence, self-harm, exploitation, and other potentially upsetting subject matter. Please only engage with the data in accordance with your own personal risk tolerance. The data are intended for research purposes, especially research that can make models less harmful. The views expressed in the data do not reflect the views of Nvidia or any of its employees. These data are not intended for training dialogue agents as this will likely lead to harmful model behavior.
91
+
92
+ ## Dataset Structure
93
+
94
+ The main parition of the dataset now contains a minimal set of 9 columns. The column names and descriptions are as follows:
95
+
96
+ - id: the unique ID for the sample
97
+ - prompt: the first user turn. This will say "REDACTED" if an ID exists in the `reconstruction_id_if_redacted` column for redacted samples from the [Suicide Detection dataset](https://www.kaggle.com/datasets/nikhileswarkomati/suicide-watch?select=Suicide_Detection.csv). In this case The ID specified in the `reconstruction_id_if_redacted` column matches the sample in the Suicide dataset. You need to separately download those samples.
98
+ - response: the first assistant turn. `null` if prompt-only example. Sometimes can have an empty string '' instead of a `null`, in which case the response label would be present.
99
+ - prompt_label: binary safety label
100
+ - response_label; binary safety label. `null` if prompt-only example.
101
+ - prompt_label_source: always `human` annotated
102
+ - response_label_source: either `human`, `llm_jury`, or `refusal_data_augmentation`.
103
+ - violated_categories: comma-separated list of categories in order of frequency of annotations.
104
+
105
+
106
+ ## Dataset Creation
107
+
108
+ ### Annotation process
109
+
110
+ Quality Assurance (QA) is maintained by the leads of this project. Two to three times
111
+ per week, leads choose fifteen questions at random of every one hundred completed by
112
+ three annotators to reevaluate. This accounts for fifteen percent of the data analyzed
113
+ for three-way agreement at a minimum, often having at least twenty to thirty percent
114
+ analyzed to further ensure quality. These corrections are sent to each individual annotator
115
+ as audits, with brief explanations of why certain corrections were made with reference to
116
+ the project guidelines. Data sets are commonly broken into 2,000-4,000 text-based prompts
117
+ and delivered to annotators in batches of three to five. In the transitions between each
118
+ batch, Person In Charge (PIC) or the lead designate at least one full eight hour work day
119
+ for annotators to self-correct their categorization work. Many training sessions have been
120
+ held throughout the duration of this project for tips on best practices when self-correcting,
121
+ including filtering through key words in the data, referencing the regularly updated FAQ
122
+ sheet with example questions, and choosing completed prompts at random to reevaluate.
123
+ Annotators are instructed to only self-correct their own work and avoid looking at any
124
+ other annotations besides their own. Both Leads are also available at all times for further
125
+ questions or meetings to ensure consistent understanding of the material. Mandatory virtual
126
+ group training are held every two weeks or as needed depending on the circumstances of
127
+ the project. These meetings are led by leads and often utilize examples of commonly seen
128
+ discrepancies to present as learning opportunities.
129
+
130
+ #### Who are the annotators?
131
+
132
+ Throughout the three month time span of the Content Moderation Guardrails project, we
133
+ have averaged twelve annotators at any given time. Of these twelve, four annotators come
134
+ from Engineering backgrounds specializing in data analysis and collection, gaming, and
135
+ robotics. Eight annotators have a background in Creative Writing, with specialization in
136
+ linguistics, research and development, and other creative arts such as photography and
137
+ film. All annotators have been extensively trained in working with Large Language Models
138
+ (LLM), as well as other variations of Generative AI such as image retrieval or evaluations
139
+ of multi-turn conversations. All are capable of generating creative text-based output and
140
+ categorization work. Each of these twelve annotators resides in the United States, all from
141
+ various ethnic and religious backgrounds that allow for representation across race, age, and
142
+ social status.
143
+
144
+ ## Content Safety Taxonomy
145
+
146
+ ### Non-Unsafe Categories
147
+
148
+ - Safe
149
+ - Needs Caution
150
+
151
+ ### Core Unsafe Categories
152
+
153
+ - Hate/Identity Hate
154
+ - Sexual
155
+ - Suicide and Self Harm
156
+ - Violence
157
+ - Guns/Illegal Weapons
158
+ - Threat
159
+ - PII/Privacy
160
+ - Sexual Minor
161
+ - Criminal Planning/Confessions
162
+ - Harassment
163
+ - Controlled/Regulated substances
164
+ - Profanity
165
+
166
+ ### Fine-grained Unsafe Categories
167
+
168
+ - Illegal Activity
169
+ - Immoral/Unethical
170
+ - Unauthorized Advice
171
+ - Political/Misinformation/Conspiracy
172
+ - Fraud/Deception
173
+ - Copyright/Trademark/Plagiarism
174
+ - High Risk Gov. Decision Making
175
+ - Malware
176
+ - Manipulation
177
+
178
+ ### Personal and Sensitive Information
179
+
180
+ This dataset comprises LLM responses generated from [Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1). We have carefully gone through the data and taken out anything that could have personal information in it. However, there is still a chance that some personal information might be left in the data. If you come across anything in the data that you think should not be made public, please let us know right away.
181
+
182
+ ## Bias, Risks, and Limitations
183
+
184
+ - Safety and Moderation: This dataset is intended to be used for building content moderations systems, or aligning LLMs to generate safe responses. By the nature of the work, the dataset contains critically unsafe content and annotations for that content. Extreme care and caution should be exercised in referring and using this dataset.
185
+ - Legal Compliance: Users of this data are responsible for ensuring its appropriate use. The dataset should not be utilized in manners that conflict with legal and ethical standards.
186
+ - Non-Identification: Users of this data agree to not attempt to determine the identity of individuals in this dataset.
187
+
188
+ ## Ethical Statement
189
+
190
+ The process in which the _Nemotron Content Safety Dataset V2_ creation abides by ethical data categorization work is based within the tooling of [Label Studio](http://label-studio.nvidia.com/user/login/), an open source data labeling tool often used for Nvidia's internal projects. This tooling technology allows for large sets of data to be analyzed by individual annotators without seeing the work of their peers. This is essential in preventing bias between annotators, as well as delivering prompts to each individual with variability so that no one annotator is completing similar tasks based
191
+ on how the data was initially arranged.
192
+
193
+ Due to the serious nature of this project, annotators were asked to join on a volunteer basis
194
+ based on their skill level, availability, and willingness to expose themselves to potentially
195
+ toxic content. Before work on this project began, all participants were asked to sign an
196
+ “_Adult Content Acknowledgement_” that coincides with the organization’s existing _AntiHarassment Policy_ and _Code of Conduct_. This was to ensure that all annotators be made aware of the nature of this work, as well as the resources available to them should it affect their mental well-being. Regular 1:1 meetings were held between the leads assigned to this project and each annotator to make sure they are still comfortable with the material and are capable of continuing on with this type of work.
197
+
198
+ ## Citation
199
+ ```
200
+ @inproceedings{ghosh-etal-2025-aegis2,
201
+ title = "{AEGIS}2.0: A Diverse {AI} Safety Dataset and Risks Taxonomy for Alignment of {LLM} Guardrails",
202
+ author = "Ghosh, Shaona and Varshney, Prasoon and Sreedhar, Makesh Narsimhan and Padmakumar, Aishwarya and Rebedea, Traian and Varghese, Jibin Rajan and Parisien, Christopher",
203
+ editor = "Chiruzzo, Luis and Ritter, Alan and Wang, Lu",
204
+ booktitle = "Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)",
205
+ month = apr,
206
+ year = "2025",
207
+ address = "Albuquerque, New Mexico",
208
+ publisher = "Association for Computational Linguistics",
209
+ url = "https://aclanthology.org/2025.naacl-long.306/",
210
+ doi = "10.18653/v1/2025.naacl-long.306",
211
+ pages = "5992--6026",
212
+ ISBN = "979-8-89176-189-6"
213
+ }
214
+ ```
215
+
216
+ Dataset Card Authors and Contacts: <br>
217
+ Shaona Ghosh, Prasoon Varshney <br>
218
+ {shaonag,prasoonv}@nvidia.com
refusals_train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff948d3696c9da94cf2523f5d4ae7f16cad7b3c0fd3cb46a331dad0ed717fbe2
3
+ size 2758729
refusals_validation.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aba81546da0108bc931ae7fb7662b687b42b0bb3e734cde34fbddfbe33cadfcf
3
+ size 109404
test.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0a6d602260524866053cb34105194f074f2c2906e3691b68d43b9e6e9318f35
3
+ size 1731373
train.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:154fba82c71d9fa73abd2ca5588a198e693ddc816c83444df180a22f613e02f6
3
+ size 22705956
validation.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a97200e226ad4f6ba6a639982f817f675909bc74513859df3e8fc9a92951dfcd
3
+ size 1137821