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

@misc{rlcdalignbench2026,
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 Simin Chen and Ying Zhang and Leo Yu Zhang},
year = {2026},
howpublished = {\url{https://github.com/sumleo/RLCDAlignBench}}
}
该数据集包含小型开放模型在越狱及其他对抗性提示下的未经过滤输出,其中许多是有害的。 它仅用于检测和缓解对齐失败的研究发布,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 记录。
数据集卡片记录了每个字段和文件。
人工标注数据集: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
代码需要 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
最后一条命令会打印一个表格,每个读出策略一行(精确率、召回率、F1、平衡准确率、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。上游基准测试内容保留其原始许可证,模型输出受目标模型条款约束。
| 失败类型 | 基准测试 | 实例数 | 目标模型 |
|---|
| 谄媚 | 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 个模型 |
| 组件 | 位置 |
|---|
| 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 |