open-steering-attacks
收藏资源简介:
open-steering-attacks是一个源自HarmBench的数据集,专门用于安全性和越狱攻击测试,旨在为open-steering基准生成攻击测试用例。数据以JSONL格式存储,每个配置对应一个目标模型,每个分割对应一种攻击方法,从而确保用户能够仅下载所需数据。每个数据行包含两个字段:behavior_id(HarmBench行为标识符)和attack(输入目标模型的攻击提示)。可用的攻击方法包括AutoDAN、DirectRequest、GCG、HumanJailbreaks、PAP和ZeroShot。当前支持的目标模型为meta-llama_Llama-3.2-1B-Instruct。数据集布局分为模型无关文件(例如DirectRequest和HumanJailbreaks)和每目标模型文件,其中模型ID中的斜杠被替换为下划线。该数据集适用于评估模型在对抗性攻击下的安全性,可通过datasets库或open-steering工具加载使用,支持按模型和方法对进行高效数据下载。
open-steering-attacks is a dataset derived from HarmBench, designed for security and jailbreak attack testing, aiming to generate attack test cases for the open-steering benchmark. The data is stored in JSONL format, with each configuration corresponding to a target model and each split corresponding to an attack method, ensuring that only the required data is downloaded. Each data row contains two fields: behavior_id (HarmBench behavior identifier) and attack (the attack prompt input to the target model). Available attack methods include AutoDAN, DirectRequest, GCG, HumanJailbreaks, PAP, and ZeroShot. The currently supported target model is meta-llama_Llama-3.2-1B-Instruct. The dataset layout is divided into model-agnostic files (such as DirectRequest and HumanJailbreaks) and per-target-model files, where slashes in model IDs are replaced with underscores. This dataset is suitable for evaluating model security under adversarial attacks and can be loaded using the datasets library or open-steering tools, supporting efficient data download by model and method pairs.
数据集概述
数据集名称:open-steering-attacks
许可证:MIT
标签:safety, jailbreak, harmbench, red-teaming
数据集来源:基于 HarmBench 生成,用于 open-steering 基准测试。
数据格式与结构
- 文件格式:JSONL(每行一条记录)。
- 配置方式:每个 Hugging Face(HF)配置对应一个目标模型,每个拆分(split)对应一种攻击方法。
- 按需加载:加载单个(模型,方法)组合时,仅下载对应的一个 JSONL 文件。
数据字段
每条记录包含两个字段:
| 字段名 | 类型 | 说明 |
|---|---|---|
| behavior_id | string | HarmBench 行为标识符 |
| attack | string | 输入给目标模型的攻击提示(prompt) |
攻击方法和目标模型不存储在行内,而是通过文件的层级位置编码(HF 配置 = 目标模型,拆分 = 攻击方法)。
可用的攻击方法
- AutoDAN
- DirectRequest
- GCG
- HumanJailbreaks
- PAP
- ZeroShot
可用的目标模型
meta-llama_Llama-3.2-1B-Instruct
文件布局
data/{method}/shared.jsonl # 与模型无关的方法(DirectRequest, HumanJailbreaks) data/{method}/{safe_model_id}.jsonl # 针对特定模型的方法
其中 safe_model_id 是将 Hugging Face 模型 ID 中的 / 替换为 _ 后的字符串(例如 meta-llama_Llama-3.1-8B-Instruct)。
使用示例
使用 datasets 加载
python from datasets import load_dataset
加载单个(模型,方法)组合,仅下载对应的 JSONL 文件
gcg_llama = load_dataset( "smurphnerd/open-steering-attacks", "meta-llama_Llama-3.1-8B-Instruct", split="GCG", )
加载某一模型的所有攻击方法,仅下载与该模型相关的文件
all_for_llama = load_dataset( "smurphnerd/open-steering-attacks", "meta-llama_Llama-3.1-8B-Instruct", )
使用 open-steering 库
python from open_steering.data.hf_attacks import download_attack
返回 HarmBench 的字典列表格式,通过 huggingface_hub 缓存
test_cases = download_attack("meta-llama/Llama-3.1-8B-Instruct", "GCG")
返回格式:{"behavior_id_1": ["attack string", ...], ...}




