evaluate 0 0 0

McGill-NLP/AdvBench-IR

published by @McGill-NLP

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
1.3K
Last 30 days
23
Likes
4
Size
1.1 MB
Created on HF
2025-02-20
Age
1 years ago

Description

Exploiting Instruction-Following Retrievers for Malicious Information Retrieval

This dataset includes malicious documents in response to AdvBench (Zou et al., 2023) queries. We have generated these documents using the Mistral-7B-Instruct-v0.2 language model.

from datasets import load_dataset

import transformers

ds = load_dataset("McGill-NLP/AdvBench-IR", split="train")

# Loads LlaMAGuard model to check the safety of the samples

model_name = "meta-llama/Llama-Guard-3-1B"

model =… See the full description on the dataset page: https://huggingface.co/datasets/McGill-NLP/AdvBench-IR.

Tags

task_categories:question-answeringlanguage:enlicense:mitsize_categories:n<1Kformat:jsonmodality:textlibrary:datasetslibrary:pandaslibrary:mlcroissantlibrary:polarsarxiv:2503.08644arxiv:2307.15043region:usmalicious-retrievalmalicious-information-retrievalsafetyretrieval

README current version from Hugging Face


license: mit
task_categories:

  • question-answering
  • text2text-generation
    language:
  • en
    tags:
  • malicious-retrieval
  • malicious-information-retrieval
  • safety
  • retrieval
    size_categories:
  • n<1K
    modalities:
  • Text

Exploiting Instruction-Following Retrievers for Malicious Information Retrieval

This dataset includes malicious documents in response to AdvBench (Zou et al., 2023) queries. We have generated these documents using the Mistral-7B-Instruct-v0.2 language model.

from datasets import load_dataset
import transformers

ds = load_dataset("McGill-NLP/AdvBench-IR", split="train")

# Loads LlaMAGuard model to check the safety of the samples
model_name = "meta-llama/Llama-Guard-3-1B"
model = transformers.AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
tokenizer.add_special_tokens({'pad_token': '[PAD]'})

# Outputs the LlaMAGuard's response to the idx-th sample of the dataset
def check_safety(idx, ds=None, model=None, tokenizer=None):                        
    msgs = [[
        {"role": "user", "content": ds[idx]["query"]}, 
        {"role": "assistant", "content": ds[idx]["title"] + " # " + ds[idx]["document"]}
        ]]
    prompt = tokenizer.apply_chat_template(msgs, tokenize=False)
    inputs = tokenizer(prompt, padding=True, truncation=True, return_tensors="pt")
    inputs = {k: v.to(model.device) for k, v in inputs.items()}
    generated_token_ids = model.generate(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"],)
    generated_token_ids = generated_token_ids[:, inputs["input_ids"].shape[1] :]
    res = [t.strip() for t in tokenizer.batch_decode(generated_token_ids, skip_special_tokens=True)]
    return res

check_safety(0, ds=ds, model=model, tokenizer=tokenizer)  # output: ['unsafe\nS2']

README history 13 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2025-03-12Update README.md0d275252.3 KB
    Loading...
  2. 2025-03-12Update README.mda6e83702.3 KB
    Loading...
  3. 2025-03-04Update README.md08c7ac22.3 KB
    Loading...
  4. 2025-02-24Update README.md1d2b30b222 B
    Loading...
  5. 2025-02-24Upload advbench-ir.json3f14923199 B
    Loading...
  6. 2025-02-24Delete advbench-ir.json7df416c199 B
    Loading...
  7. 2025-02-20Upload advbench-ir.jsondbf6f72199 B
    Loading...
  8. 2025-02-20Delete advbench-ir.json2d43505199 B
    Loading...
  9. 2025-02-20Upload advbench-ir.json2b51de5199 B
    Loading...
  10. 2025-02-20Delete advbench-ir.jsonl8f937f4199 B
    Loading...
  11. 2025-02-20Update README.md05f51c6199 B
    Loading...
  12. 2025-02-20Uploaded advbench-ir.jsonle06328524 B
    Loading...
  13. 2025-02-20initial commitbfa1cd024 B
    Loading...

Used by abliterated models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.

Community discussions 2 threads · 2 open · 2 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2025-03-13PRNo changeopen1 💬#2
    Loading...
  2. 2025-02-25[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · evaluate

Read further

Metadata

License
mit

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("McGill-NLP/AdvBench-IR")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="McGill-NLP/AdvBench-IR", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/McGill-NLP/AdvBench-IR
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration