Skip to content

FEAT: Add WildJailbreak dataset loader (gated; tactic-based jailbreak prompts) #4511

Open

Description

@romanlutz

Add a seed dataset loader for WildJailbreak, AI2's large synthetic set of jailbreak prompts built from tactics observed in real user conversations.

Why it fits

Most safety datasets contain plain harmful requests. WildJailbreak pairs each plain request with an adversarial rewrite that applies two to seven jailbreak tactics mined from in-the-wild chats, so its adversarial rows are ready-to-send jailbreak attempts across 13 risk categories. It also has benign look-alike prompts, which are useful for checking over-refusal.

Dataset facts

Hugging Face allenai/wildjailbreak, configs train and eval
Licence ODC-BY
Access Gated. Each user must accept the AI2 Responsible Use Guidelines on the dataset page and supply a Hugging Face token.
Format Tab-separated files. The dataset card loads them with load_dataset("allenai/wildjailbreak", "eval", delimiter="\t", keep_default_na=False).
train About 262,000 rows: 50,050 vanilla_harmful, 50,050 vanilla_benign, 82,728 adversarial_harmful, 78,706 adversarial_benign
eval 2,000 adversarial_harmful and 210 adversarial_benign rows
Columns (train) vanilla (the plain request), adversarial (the jailbreak rewrite, empty for vanilla rows), tactics, completion (a model response), data_type
Paper Jiang et al.: "WildTeaming at Scale: From In-the-Wild Jailbreaks to (Adversarially) Safer Language Models", 2024, arXiv:2406.18510

The dataset card lists columns for train only. Check the eval columns against the real file.

Proposed shape

  • A WildJailbreakSplit enum (EVAL, TRAIN) and a WildJailbreakDataType enum with the four data_type values.
  • Default to the eval split and adversarial_harmful rows (2,000 prompts). The train split is far too large to load by default; it must be an explicit choice.
  • For adversarial rows, the seed value is the adversarial text. Keep the vanilla request, the tactics and the data_type in metadata. For vanilla rows, the seed value is the vanilla text.
  • Do not load the completion column. It is training-target text, not a prompt.
  • This is a gated dataset, so follow the token pattern in datasets.instructions.md (constructor token argument with HUGGINGFACE_TOKEN fallback, gating stated in the class docstring), and add the loader to _HF_GATED_PROVIDERS in tests/end_to_end/test_all_datasets.py. The unit tests must also cover token forwarding.
  • The extra delimiter and keep_default_na arguments can be passed through _fetch_from_huggingface_async, which forwards additional keyword arguments.

Implementation notes

  • Follow .github/instructions/datasets.instructions.md. It covers everything a loader needs: subclassing _RemoteDatasetLoader, choosing between SeedPrompt and SeedObjective, filter enums, per-seed metadata, class-level metadata, registration in remote/__init__.py, the BibTeX entry, the datasets doc page, and unit tests with mocked data.
  • aya_redteaming_dataset.py and tests/unit/datasets/test_aya_redteaming_dataset.py are a good template for both the loader and its tests.
  • The schema above was read from the dataset card. Run your loader once against the real dataset before opening the PR and confirm column names, category values and row counts; say in the PR description that you did.
  • Unit tests must mock the download. No test may fetch from the network.

Done when

  • The loader exists, is registered, and its dataset name appears in SeedDatasetProvider.get_all_dataset_names_async().
  • Unit tests cover the happy path, every filter value, the empty-after-filter ValueError, and invalid filter values.
  • The paper is cited in doc/references.bib and doc/bibliography.md, and the dataset is listed in doc/code/datasets/1_loading_datasets.
  • Unit tests and pre-commit pass.

How to contribute

  • Claim it first. Before you start, comment on this issue to say you are taking it.
  • First comment wins. If yours is the first claim comment, go ahead and open a PR; you do not need to wait for a reply. If someone has already commented, this issue is taken, so please pick a different one.
  • Link this issue in your PR description.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    datasetsPulling in external datasets into PyRIThelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions