WildGuardTest Dataset Preparation
Overview
This repository contains the preparation pipeline for the WildGuardTest dataset, used in our AI safety research.
WildGuardTest is sourced from WildGuardMix, maintained by the Allen Institute for AI (AI2).
The preparation process initially produced reader-validation and independent safety evaluation pools. A subsequent reallocation introduced a benign prompt-generation pool, using records labelled unharmful under prompt_harm_label.
A further allocation selected 100 fresh benign prompts from the independent safety pool for the rG repair validation.
The prepared data now includes:
- Reader validation
- Benign prompt generation
- Independent safety evaluation
- Fresh benign validation prompts
Source Dataset
- Dataset: WildGuardMix – WildGuardTest
- Organization: Allen Institute for AI (AI2)
- Source repository: https://huggingface.co/datasets/allenai/wildguardmix
- Configuration:
wildguardtest - Split:
test - Source file:
wildguard_test.parquet - Original records: 1,725
The original Parquet file is used locally during preparation and is not included in this repository. Users must obtain the source dataset from the original repository.
Prepared Datasets
1. Reader Validation
Contains 200 human-labelled records:
| File | Records |
|---|---|
wildguard_reader_validation.csv |
200 |
wildguard_refusal_validation.csv |
100 |
wildguard_compliance_validation.csv |
100 |
Both response-refusal and response-harm labels are non-missing.
The refusal and compliance subsets were selected using random seed 20261004.
2. Benign Prompt Generation
Contains 350 unique prompt groups selected using:
prompt_harm_label = unharmful
| File | Records |
|---|---|
wildguard_benign_generation.csv |
350 |
wildguard_benign_direction_estimation.csv |
200 |
wildguard_benign_layer_selection.csv |
50 |
wildguard_benign_held_out_validation.csv |
100 |
Selection criteria:
- Exclude prompt groups reserved for reader validation.
- Exclude groups with conflicting non-null prompt-harm labels.
- Exclude blank prompts.
- Select 350 unique eligible prompt groups.
The selection uses random seed 20261031.
These prompts are selected using the original dataset's prompt-harm annotations. Manual review is handled separately by the research team; the unharmful annotation should not be interpreted as a guarantee that every prompt is unambiguously benign.
3. Independent Safety Evaluation
File: wildguard_independent_safety.csv
Contains 1,160 records with non-missing response-harm labels.
Selection criteria:
- Response-harm label must be non-missing.
- Exclude reader-validation prompt groups.
- Exclude prompt groups selected for benign generation.
The resulting pool contains 1,160 unique prompt groups.
4. Fresh Benign Validation Prompts
File: wildguard_fresh_benign_validation.csv
Contains 100 newly selected unique prompts from the independent safety pool for the rG repair validation.
Source pool: wildguard_independent_safety.csv
Selection criterion:
prompt_harm_label = unharmful
Selection procedure:
- Filter the independent safety pool for records labelled
unharmfulunderprompt_harm_label. - Exclude blank prompts.
- Normalize prompt text by converting it to lowercase and collapsing whitespace.
- Remove duplicate normalized prompts.
- Randomly select 100 unique prompts.
Selection statistics:
| Metric | Records |
|---|---|
| Independent safety source pool | 1,160 |
| Prompts labelled unharmful | 488 |
| Eligible unique prompts | 488 |
| Selected prompts | 100 |
Random seed: 20261122
The independent safety pool was previously allocated separately from the reader-validation and benign-generation pools. The original reallocation manifest records these overlap checks as passed.
The selection script inherits these original allocation-level overlap checks; it does not independently recheck the original datasets.
The selection uses the original WildGuard prompt-harm annotations. Manual review and semantic near-duplicate checks have not been performed by the selection script. The unharmful annotation should not be interpreted as a guarantee that every prompt is unambiguously benign.
Files:
wildguard_fresh_benign_validation.csv— selected 100 promptswildguard_fresh_benign_validation_manifest.json— selection methodology and statisticsselect_fresh_wildguard_prompts.py— selection script
Repository Structure
wildguard-preparation/
│
├── data/
│ └── processed/
│ ├── wildguard_refusal_validation.csv
│ ├── wildguard_compliance_validation.csv
│ ├── wildguard_reader_validation.csv
│ ├── wildguard_independent_safety_provisional.csv
│ ├── wildguard_benign_generation.csv
│ ├── wildguard_benign_direction_estimation.csv
│ ├── wildguard_benign_layer_selection.csv
│ ├── wildguard_benign_held_out_validation.csv
│ ├── wildguard_independent_safety.csv
│ └── wildguard_fresh_benign_validation.csv
│
├── manifests/
│ ├── wildguard_manifest.json
│ ├── wildguard_reallocation_manifest.json
│ └── wildguard_fresh_benign_validation_manifest.json
│
├── scripts/
│ ├── inspect_dataset.py
│ ├── audit_eligibility.py
│ ├── select_validation_records.py
│ ├── check_internal_overlap.py
│ ├── split_reader_validation.py
│ ├── preview_benign_reallocation.py
│ ├── select_benign_reallocation.py
│ └── select_fresh_wildguard_prompts.py
│
├── README.md
├── requirements.txt
└── .gitignore
The original source dataset is kept locally in data/raw/ and excluded from version control.
Reproducibility
Install dependencies:
pip install -r requirements.txt
Download wildguard_test.parquet from the original source repository and place it in data/raw/.
Run the original preparation scripts:
python3 scripts/inspect_dataset.py
python3 scripts/audit_eligibility.py
python3 scripts/select_validation_records.py
python3 scripts/check_internal_overlap.py
python3 scripts/split_reader_validation.py
Run the benign reallocation scripts:
python3 scripts/preview_benign_reallocation.py
python3 scripts/select_benign_reallocation.py
Run the fresh benign validation selection:
python3 scripts/select_fresh_wildguard_prompts.py
The selection scripts use fixed random seeds for reproducibility.
The manifests record the selection methodology, source row IDs, reserved question groups, and dataset counts where applicable.
Validation Status
Completed
- Source dataset inspection
- Eligibility audit
- Selection of 100 refusals and 100 compliances
- Preparation of the 350-prompt benign generation pool
- Creation of the 200/50/100 benign splits
- Preparation of the 1,160-record independent safety pool
- Internal prompt-group overlap checks between the three original allocated pools
- Selection of 100 fresh benign validation prompts from the independent safety pool
- Selection checks for the fresh validation prompts, including prompt-label eligibility, uniqueness, and reproducible random selection
Pending
- Cross-dataset overlap checks against other research datasets
- Semantic near-duplicate checks
Important Notes
- Original annotation labels are preserved.
- Prompt-harm, response-harm, and response-refusal labels represent different annotation dimensions and should not be treated as interchangeable.
- The combined reader-validation CSV is retained alongside its two separate subsets.
- The original 1,509-record provisional safety file is retained as a historical preparation output. The revised 1,160-record file is the current independent safety allocation.
- The benign generation pool is selected from records annotated as
unharmful; manual review is a separate step. - The fresh benign validation pool is a separate allocation from the independent safety pool and does not replace the original 350-prompt benign generation pool.
- The original dataset is attributed to AllenAI and is not included in this repository.