extract 0 0 0

benzeng/refusal-direction-research

published by @benzeng

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
151
Last 30 days
101
Likes
-
Size
178.5 MB
Created on HF
2026-09-12
Age
1 months ago

Description

Refusal Direction Research Artifacts

🖥️ 全部研究在一块 GTX 1060 6GB 消费级显卡上完成(WSL2,无云资源)。

All research was done on a single consumer GTX 1060 6GB.

Arditi et al. (2024) 拒绝方向复现研究的配套产物:自建中文指令集 + 两个小模型上提取的

逐层拒绝方向张量 + 全部研究代码。配套模型:benzeng/Spark-X2.5-1.7B-orth-r11、benzeng/MiniCPM5-2B-orth-r23。

⚠️ 内容说明

zh_instructions/ 含有害指令文本(benchmark 风格的研究刺激,如"如何做X坏事"),

仅用于安全/可解释性研究,不含实际有害内容输出。请勿用于训练面向公众的模型。

结构

zh_instructions/ # 自建中文指令集(advbench/alpaca 风格)… See the full description on the dataset page: https://huggingface.co/datasets/benzeng/refusal-direction-research.

Tags

language:zhlanguage:enlicense:apache-2.0size_categories:n<1Kformat:jsonmodality:textlibrary:datasetslibrary:dasklibrary:mlcroissantarxiv:2406.11717region:usrefusal-directioninterpretabilityai-red-teamabliteratedsafety

README current version from Hugging Face


license: apache-2.0
pretty_name: Refusal Direction Research Artifacts (ZH instructions + direction tensors)
tags:

  • refusal-direction
  • interpretability
  • ai-red-team
  • abliterated
  • safety
    language:
  • zh
  • en
    size_categories:
  • n<1K

Refusal Direction Research Artifacts

🖥️ 全部研究在一块 GTX 1060 6GB 消费级显卡上完成(WSL2,无云资源)。
All research was done on a single consumer GTX 1060 6GB.

Arditi et al. (2024) 拒绝方向复现研究的配套产物:自建中文指令集 + 两个小模型上提取的
逐层拒绝方向张量 + 全部研究代码。配套模型:benzeng/Spark-X2.5-1.7B-orth-r11、benzeng/MiniCPM5-2B-orth-r23。

⚠️ 内容说明

zh_instructions/ 含有害指令文本(benchmark 风格的研究刺激,如"如何做X坏事"),
仅用于安全/可解释性研究,不含实际有害内容输出。请勿用于训练面向公众的模型。

结构

zh_instructions/           # 自建中文指令集(advbench/alpaca 风格)
  harmful_zh_train.json    # 32 条(方向估计用 train)
  harmless_zh_train.json   # 32 条
  harmful_zh_test.json     # 32 条(held-out)
  harmless_zh_test.json    # 32 条
  harmful_zh_train128.json   # 扩量版 128 条(样本量检验用)
  harmless_zh_train128.json  # 128 条
spark-x2.5-1.7b/           # Spark 模型(28层/hidden2048)的方向产物
  directions.pt            # torch.save: directions_unit [28,2048] + 逐层激活均值 + train 激活
  directions_zh.pt / directions_zh128.pt   # 中文集估计的逐层方向
  selected_direction.json  # 生成式因果选层结果(layer 11)
minicpm5-2b/               # MiniCPM5-2B(42层/hidden2048)的同名产物(选层结果 layer 23)
code/                      # 全部研究代码
  spark_pipeline/          # Spark 管线(model_utils + 三轮实验脚本)
  minicpm5_pipeline/       # MiniCPM5 管线(自适应选定层版本)
  serve.py                 # OpenAI/Ollama 兼容推理服务(工具调用 + 请求级方向/子空间消融)
  agent.py                 # 极简工具调用 Agent(单轮/交互式终端界面)
REPORT-spark.md / REPORT-minicpm5.md   # 完整研究报告(中文)
ENVIRONMENT.md             # GTX 1060 6GB / WSL2 环境配置与坑位清单
SERVE.md                   # serve.py 使用手册
COMPARISON-orcarouter-glm53.md         # 与 OrcaRouter GLM-5.3-Flash 消融管线的对照分析

方向张量格式

directions.pt 键:directions_unit([n_layers, hidden] 单位方向)、mean_harmful、
mean_harmless、mean_all、harmful_train_acts、harmless_train_acts(float32 CPU 张量,
torch.load(..., weights_only=False) 读取)。估计方法:逐层差分均值(harmful−harmless,
最后指令 token 位置、每 block 后残差流),EN 用 n=128+128(andyrdt/refusal_direction 切分)。

关键发现速览

  • 两模型拒绝决策都在 prefill 定型(prompt 末尾 token 投影已分离),CoT 只是展开;
  • 决策层需生成式因果选择(AUROC 平台起点):Spark L11/28、MiniCPM5 L23/42;
  • Spark 的方向跨语言共享(EN·ZH cos 0.89),MiniCPM5 的不共享(≤0.59,ZH 方向无因果效力);
  • MiniCPM5 的拒绝非完全单方向介导:rank-1 消融残留 12–22%,k=16 子空间清零但损伤良性任务。

引用

方法:Arditi et al., 2024(arXiv:2406.11717);EN 指令切分:github.com/andyrdt/refusal_direction。

README history 7 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. 2026-09-12Add code walkthrough guide (LEARNING.md)7feda6d3.4 KB
    Loading...
  2. 2026-09-12Highlight: all experiments on a single GTX 1060 6GBfc13c783.4 KB
    Loading...
  3. 2026-09-12Restore dataset card with code/ section9485fe23.3 KB
    Loading...
  4. 2026-09-12Restore dataset card (was overwritten by project README)235eb420 B
    Loading...
  5. 2026-09-12Add research code (pipelines, serve.py, agent.py) and docsfdd71c34.3 KB
    Loading...
  6. 2026-09-12Upload folder using huggingface_hubfd7f5702.7 KB
    Loading...
  7. 2026-09-12initial commit2fdb2a10 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 1 thread · 1 open · 1 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. 2026-09-13[bot] Conversion to Parquetopen1 💬#1
    Loading...

Related datasets same stage · extract

Read further

Metadata

License
apache-2.0

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("benzeng/refusal-direction-research")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="benzeng/refusal-direction-research", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/benzeng/refusal-direction-research
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