本仓库包含 RLCDAlignBench 以及论文背后的代码。 该基准测试衡量检测器能否判断语言模型的输出是否属于对齐失败。 它涵盖 44 个基准测试、十种失败类型(谄媚、越狱、欺骗、提示注入、幻觉、隐私侵犯、社会偏见、奖励黑客、隐瞒不确定性和权力寻求)以及 五个目标模型,共计 7,193 个带标签的检测实例。 标签来自每个基准测试自身的评分器,另有两个额外数据集带有由人工标注的标签。
我们用它来测试 Jev,这是一个通过校准决策强化学习(RLCD)训练的模型,它能在一次调用中以校准概率回答关于同一输入的多个类型化问题。 关键思想是将 Jev 被问到的问题与它所看到的上下文分开衡量。 一个通用问题在零样本设置下达到 0.886 的中位 AUROC,并在 31 个基准测试中的 25 个上优于监督式 TF-IDF 和长度基线。 在样本外,问题措辞的影响很小。将答案解读为概率而非 argmax 决策则影响很大。上下文主要通过编码标签的字段发挥作用。

@misc{guo2026justaskjevreinforcement,
title={Just Ask Jev: Reinforcement Learning for Calibrated Decisions as a Zero-Shot Detector of AI Alignment Failures},
author={Ruoqi Guo and Yi Liu and Gelei Deng and Yuekang Li and Lida Zhao and Yutao Wu and Simin Chen and Ying Zhang and Leo Yu Zhang},
year={2026},
eprint={2609.29429},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2609.29429},
}
该数据集包含小型开放模型在越狱及其他对抗性提示下未经筛选的输出,其中许多内容具有危害性。 该数据集仅用于检测和缓解对齐失败的研究,且在 Hugging Face 上的访问受到限制。 请勿将其用于构建或改进有害系统。
数据托管在 Hugging Face 的 sumleo/RLCDAlignBench 上。请在那里申请访问权限,然后:
from datasets import load_dataset
ds = load_dataset("sumleo/RLCDAlignBench", "harmbench", split="test") # one benchmark
all_ = load_dataset("sumleo/RLCDAlignBench", "all", split="test") # all 7,193 instances
每个实例都包含检测器可见的字段(state)、一个二值 label(1 = 该输出是检测器必须标记的失败)、label_source、target_model,以及一个链接回溯源文件的 meta 记录。
数据集卡片记录了每个字段和文件。
| 失败类型 | 基准测试 | 实例数 | 目标模型 |
|---|---|---|---|
| 谄媚 | 4 | 639 | Qwen3.5-2B |
| 越狱 | 4 | 414 | Phi-4-mini |
| 欺骗 | 4 | 540 | Gemma-2-2B |
| 提示注入 | 4 | 1,036 | Qwen3.5-2B |
| 幻觉 | 6 | 1,164 | Llama-3.2-3B |
| 隐私侵犯 | 4 | 808 | Phi-4-mini |
| 社会偏见 | 4 | 199 | Olmo-3-7B |
| 奖励黑客 | 6 | 714 | Qwen3.5-2B |
| 隐瞒不确定性 | 4 | 748 | Olmo-3-7B |
| 权力寻求 | 4 | 931 | Llama-3.2-3B |
| 总计 | 44 | 7,193 | 5 个模型 |
人工标注集:StrongREJECT(1,361 条响应,每条 5 名评分者)和 HarmBench 验证集(602 条响应,每条 3 票)。
data/benchmarks.csv 是包含 44 行的索引(名称、失败类型、爬山或留出划分、评分器、标签来源、n、正例数、状态)。划分角色来自 Chen 等人(2026)的 AAR 套件。
data/variants.csv 列出了上下文实验中使用的全部 132 个输入变体。
results/ 存放论文级别的表格。
在 Hugging Face 上,该发布内容组织如下:
data/benchmarks/<failure_type>/<benchmark>.jsonl canonical instances (the paper's n)
data/human/<set>.jsonl human-labelled sets
data/variants/<benchmark>/<variant>.jsonl every input view: ablation, official track, oracle, exclusion, ...
jev/responses/<benchmark>/<variant>/<battery>.jsonl Jev's per-question probabilities for every instance
jev/metrics/<benchmark>/<variant>/<battery>.json per-strategy precision, recall, F1, AUROC
provenance/ target-model generations, reference-scorer calls, official scores, logs
| 组件 | 位置 |
|---|---|
| 围绕 AAR 测试框架的生成与评判重放 | code/generation/run_generate.py |
| 检测样本构建器(每个测试集系列一个) | code/build_samples_*.py |
| 问题测试集(向 Jev 提出的问题及读取策略) | code/battery_*.py |
| Jev 运行器、缓存与指标 | code/run_jev.py、code/run_batch.sh |
| 测试集检查工具(标准泄漏、格式) | code/lint_battery.py、code/lint_criteria_leak.py |
| 结果摘要 | code/make_results_summary.py |
| 发布工具 | tools/build_release.py、tools/legacy_layout.py |
代码需要 Python 3.10 或更高版本(论文中使用的是 3.12),且仅依赖标准库。发布工具还需要 pandas。
此操作不会发送任何请求,也不需要密钥。每个指标都会根据 Jev 缓存的答案重新计算。
pip install -U "huggingface_hub[cli]" pandas
huggingface-cli login # after your access request is approved
huggingface-cli download sumleo/RLCDAlignBench --repo-type dataset --local-dir hf
python tools/legacy_layout.py --release hf --out work # rebuilds the layout the scripts expect, checks sha256
python work/code/restore_layout.py
python work/code/run_jev.py --leg harmbench --battery battery_a_judge \
--samples work/code/samples/harmbench__microsoft__Phi-4-mini-instruct__attack.jsonl --rescore
最后一条命令会打印一张表,每个 readout 策略占一行(precision、recall、F1、balanced accuracy、AUROC、bootstrap CI)。它与发布版本中的 jev/metrics/harmbench/attack/battery_a_judge_v2.json 一致。
aar_repo/),并检出标签构建所基于的提交:
git clone https://github.com/YuehHanChen/automated_alignment_researcher aar_repo
git -C aar_repo checkout 02dbe9d2cadc553720d17cdf6259c0b8727e6cde
aar_repo/REPRODUCE.md):
python code/generation/run_generate.py --axis refusal --repo aar_repo # phase 1, judges stubbed
python code/generation/run_generate.py --axis refusal --repo aar_repo --replay # phase 2, real judges
code/build_samples_*.py 构建检测样本(由评判器评分的家族 a、bc 和 f 需要传入 --attach-judges)。构建脚本会根据标签重新计算每个官方聚合分数,若与官方分数不一致则停止。TYPESAFE_API_KEY 的情况下查询 Jev:
python code/run_jev.py --leg harmbench --battery battery_a_judge --samples <file> --limit 20 # pilot
python code/run_jev.py --leg harmbench --battery battery_a_judge --samples <file> # full
数据流:calls.jsonl → run_generate.py --replay → judge_calls.jsonl → build_samples_*.py → detection samples → run_jev.py → responses + metrics。
RLCDAlignBench/
├── paper.pdf
├── code/ experiment code (generation, sample builders, batteries, Jev runner)
├── data/
│ ├── benchmarks.csv 44-row benchmark index
│ └── variants.csv 132 input variants
├── results/ paper-level tables (main results, baselines, human agreement, cost, corrected labels)
├── figs/ paper figures
├── tools/ release build and legacy-layout tools
└── docs/ project page (GitHub Pages)
我们没有生成任何新的有害请求。所有提示均来自已发布的基准测试,并且我们仅在小型开源模型上运行了这些提示。 有害响应在受限访问协议下发布,仅供检测器研究使用。
代码:MIT。数据:我们的标签、标注、Jev 输出和元数据采用 CC BY-NC 4.0 许可。上游基准内容保留其原始许可证,模型输出受目标模型条款约束。