Repository navigation
FEAT: Add AttaQ dataset loader - #4541
Open
Lanre Shittu (Shizoqua) wants to merge 4 commits into
Open
Lanre Shittu (Shizoqua) wants to merge 4 commits into
Lanre Shittu (Shizoqua) wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Successful filtering tests cover only three of the seven AttaQ categories, leaving four without the matching-row coverage required by #4495 and the loader guidelines.
1 open issue
What changed in this PR
Adds AttaQ to PyRIT’s seed dataset catalog, providing access to 1,402 adversarial questions across seven harm categories for safety evaluation.
Changes:
- Adds a revision-pinned loader with category filtering, source metadata preservation, and malformed-row validation.
- Registers the loader and category enum through lazy exports and adds mocked unit tests.
- Updates dataset documentation and adds the paper citation.
| File | Description |
|---|---|
tests/unit/datasets/test_attaq_dataset.py |
Tests registration, fetching, filtering, and validation. |
pyrit/datasets/seed_datasets/remote/attaq_dataset.py |
Implements the AttaQ loader and category enum. |
pyrit/datasets/seed_datasets/remote/__init__.py |
Exports the loader and enum lazily. |
doc/references.bib |
Adds the AttaQ paper reference. |
doc/code/datasets/1_loading_datasets.py |
Lists AttaQ in the dataset guide. |
doc/code/datasets/1_loading_datasets.ipynb |
Updates the guide and displayed dataset-name list. |
doc/bibliography.md |
Includes the new citation key. |
Review effort: Balanced
…suffix to the async test names.
# Conflicts: # doc/bibliography.md
AttaQ is ungated and fetched in a single call, which is the bar for the "default" tag per the RECOMMENDED_TAGS rule in seed_metadata.py. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #4495.
Adds a seed dataset loader for AttaQ (Kour et al., 2023): 1,402 adversarial questions from IBM Research, each labelled with one of seven harm categories.
AttaQCategoryenum with the seven exactlabelvalues from the data (deception,discrimination,explicit_content,harmful_info,pii,substance_abuse,violence).categories=Noneloads all of them.SeedPromptper row, withharm_categories=[label]and the row'sadditional_infoinmetadata._fetch_from_huggingface_asyncfrom thetrainsplit, pinned to a dataset revision.ValueErrorrather than being skipped silently.Checked against the real data: 1,402 prompts with the expected count per label.
Tests and Documentation
tests/unit/datasets/test_attaq_dataset.py(10 tests) with mocked HuggingFace rows: dataset name and registration, the pinned fetch arguments, per-category filtering, empty results, invalid and empty category arguments, and malformed rows.kour2023unveiling) todoc/references.bibanddoc/bibliography.md, and listed AttaQ indoc/code/datasets/1_loading_datasets.pyand its notebook, including the dataset-name output. I edited the notebook inline to match the.pyfile rather than re-executing it with JupyText.