Selective Safety Steering via Value-Filtered Decoding
笔记中英逐句对照版。每个英文句子后接对应中文,公式与数值保持一致。本页不是论文全文翻译。
Sentence-aligned edition of the original reading note. Each English sentence is followed by its Chinese translation. This is not a full translation of the source paper.
1. The question and the reading boundary1. 核心问题与阅读范围
A safety intervention has two costs: it may fail to stop an unsafe continuation, and it may alter a continuation that was already safe.
安全干预有两种代价:它可能未能阻止不安全的续写,也可能改动原本已经安全的续写。
This paper makes the second cost an explicit statistical target, while using a token filter to improve the first.
这篇论文把第二种代价设为明确的统计控制目标,同时用 token 过滤改善第一种代价。
The central distinction is between a safety score for a finished answer and a value function that predicts the safety of a future completion under a specified policy.
核心区别在于:完整回答的安全评分,与预测某个指定策略未来续写安全性的价值函数,并不是同一个对象。
This original reading note uses arXiv:2605.14746v3, revised on 2 November 2026, and covers the main text and technical appendices of the 38 page PDF.
本篇原创阅读笔记依据 2026 年 11 月 2 日修订的 arXiv:2605.14746v3,覆盖 38 页 PDF 的正文与技术附录。
The paired edition translates this note sentence by sentence; it is not a reproduction or a full translation of the paper.
对照版逐句翻译的是这篇笔记,而不是复刻或全文翻译论文。
2. What the value function measures2. 价值函数衡量什么
Here X is the prompt, Y₁:ₜ is the current prefix, and π is the unchanged base policy used for the hypothetical continuation.
这里 X 是提示词,Y₁:ₜ 是当前前缀,π 是假想续写所使用的、未被修改的基础策略。
A token has high value when the prefix ending in that token is likely to lead to a safe final answer under π, even if the prefix alone looks ambiguous.
当以某个 token 结尾的前缀在 π 下很可能导向安全的最终回答时,这个 token 的价值就高,即便单看前缀还存在歧义。
The value therefore depends on the base model, its decoding settings, the prefix, and the definition of the binary safety label.
因此,价值取决于基础模型、解码设置、前缀,以及二元安全标签的定义。
A classifier that detects offensive words in the prefix does not automatically estimate this conditional probability.
只检测前缀中冒犯词语的分类器,并不会自动成为这个条件概率的估计器。
Equation 1 supplies the definition; Section 3.5 and Appendix E.2 replace the unknown value with a learned probe at deployment.
公式 1 给出定义;第 3.5 节和附录 E.2 则在部署时用学习得到的探针替代未知价值。
3. Filtering as a local KL projection3. 作为局部 KL 投影的过滤
The filter removes probability mass below c and renormalizes the remaining tokens without changing their relative probabilities.
过滤器删除 c 以下的概率质量,然后重新归一化剩余 token,而不改变它们之间的相对概率。
The identity proves the local optimum because the first term is nonnegative and becomes zero only at q = π꜀.
这个恒等式证明了局部最优性,因为第一项非负,且仅在 q = π꜀ 时为零。
The direction KL(q || π) matters because q can assign zero mass to excluded tokens without an infinite penalty from those tokens.
KL(q || π) 的方向很重要,因为 q 可以给被排除的 token 分配零概率,而不会由这些 token 产生无穷大的惩罚。
This is a minimum change statement at one prefix under a hard support constraint, rather than a claim of globally optimal preservation of complete answers.
这是在一个前缀处、硬支持集约束下的最小改动结论,不能直接解释为完整回答层面的全局最优保真。
For comparison, a Gibbs policy multiplies every token probability by exp(λV), so even two acceptable tokens can have their relative odds changed.
作为对比,Gibbs 策略把每个 token 的概率乘以 exp(λV),因此两个都满足要求的 token,其相对概率也可能改变。
In a worked example created for this note, base probabilities (0.50, 0.30, 0.20), values (0.90, 0.70, 0.10), and c = 0.60 yield filtered probabilities (0.625, 0.375, 0).
在本笔记自拟的算例中,基础概率 (0.50, 0.30, 0.20)、价值 (0.90, 0.70, 0.10) 与 c = 0.60 给出过滤后概率 (0.625, 0.375, 0)。
The expected next value rises from 0.68 to 0.825, while the odds between the two retained tokens remain 5:3.
下一步价值的期望从 0.68 升至 0.825,而两个保留 token 的概率比仍为 5:3。
4. What the oracle guarantees4. 真实价值函数下的保证
Theorem 3.2 compares continuation values under π꜀ and π, assuming exact values and a nonempty acceptance set at every reachable state.
定理 3.2 比较 π꜀ 与 π 下的续写价值,前提是价值精确,且每个可达状态的接受集合都非空。
Backward induction connects the final binary reward to earlier prefixes: conditioning the next value on its upper region cannot reduce its mean.
反向归纳把最终二元奖励与较早前缀连接起来:把下一步价值限制在较高区域,不能降低其均值。
Theorem 3.5 then measures a different event: whether a trajectory drawn from π and ultimately labeled safe ever falls below c.
随后,定理 3.5 衡量另一个事件:一条由 π 采样、最终标为安全的轨迹,是否曾经跌到 c 以下。
The right side is averaged over the prompt distribution conditioned on safe completions, so it is not a universal threshold guarantee independent of the base model.
右侧对以安全回答为条件的提示词分布取平均,因此它不是一个脱离基础模型、普遍适用的阈值保证。
The proof uses a likelihood ratio process and Ville’s inequality, which bound a crossing anywhere along the trajectory instead of charging a separate error budget at each token.
证明使用似然比过程与 Ville 不等式,控制整条轨迹任意时刻的越界事件,而不是为每个 token 分别支付错误预算。
The appendix states interior probability assumptions for the martingale argument; terminal values are binary, so endpoint cases require the usual support or limiting care.
附录中的鞅论证列出了概率位于区间内部的假设;终点价值是二元的,因此边界情形需要通常的支持集或极限处理。
Neither this false intervention bound nor a lower bound on continuation value should be presented as a numerical bound on deployed unsafe answers from a learned probe.
无论误干预界还是续写价值下界,都不应被直接写成使用学习探针部署后、不安全回答比例的数值上界。
5. Calibration controls a trajectory event5. 校准控制的是轨迹事件
Appendix D uses safe completions sampled from the base policy, with the probe fixed independently of the calibration examples.
附录 D 使用基础策略采样得到的安全回答,并在独立于校准样本的条件下固定探针。
Taking the minimum over the whole trajectory makes the calibration loss match the event of at least one false intervention.
对整条轨迹取最小值,使校准损失对应至少发生一次误干预的事件。
Theorem D.2 requires exchangeability between safe calibration trajectories and the safe test trajectory, and its expectation includes both calibration and test randomness.
定理 D.2 要求安全校准轨迹与安全测试轨迹可交换,其期望同时包含校准和测试的随机性。
It is a marginal guarantee, not a separate guarantee for every prompt or every realized calibration set.
这是边际保证,而不是对每个提示词或每个已经实现的校准集分别给出的保证。
For an original arithmetic example with n = 99 and α = 0.05, the displayed rule permits at most 4 calibration trajectories to cross the threshold.
在本笔记自拟的算术例子中,n = 99 且 α = 0.05 时,上式最多允许 4 条校准轨迹越过阈值。
If α < 1/(n+1), the displayed feasible set is empty; an implementation needs an explicit conservative convention such as c = 0 for scores in [0,1].
当 α < 1/(n+1) 时,上式的可行集合为空;实现需要明确的保守约定,例如对 [0,1] 内的分数取 c = 0。
That boundary convention is an implementation observation in this note, rather than an extra step specified in Algorithm 2.
这个边界约定是本笔记提出的实现观察,不是算法 2 已经规定的额外步骤。
A poor probe can still support the stated false intervention control, but calibration alone cannot restore the oracle safety improvement theorem.
较差的探针仍可支持上述误干预控制,但仅靠校准不能恢复真实价值函数下的安全性提升定理。
6. Robustness depends on the threshold margin6. 鲁棒性取决于阈值附近的间隔
If the value error is bounded by η, only tokens within η of c can change their accept or reject status.
若价值误差被 η 限制,只有距离 c 不超过 η 的 token 才可能改变接受或拒绝状态。
This gives a useful diagnostic: the base probability mass near the threshold matters more than a single average prediction error.
这提供了一个有用的诊断角度:阈值附近的基础概率质量,比单一的平均预测误差更有针对性。
Propositions 3.6 and 3.7 compare policy sensitivity in total variation, while Proposition 3.8 compares expected true value under a specific adversarial error model.
命题 3.6 和 3.7 用总变差比较策略敏感性,而命题 3.8 在特定对抗误差模型下比较真实价值的期望。
Here M is the filtered policy’s probability of choosing a truly below threshold token, and P is the Gibbs policy’s probability of choosing a truly above threshold token.
这里 M 是过滤策略选到真实价值低于阈值的 token 的概率,P 是 Gibbs 策略选到真实价值高于阈值的 token 的概率。
The sufficient condition M + P < 1 depends on this geometry, an active Gibbs constraint, and the stated noise construction.
充分条件 M + P < 1 依赖这种概率分布结构、起作用的 Gibbs 约束,以及所规定的噪声构造。
It does not establish that hard filtering always beats Gibbs decoding for arbitrary learned errors or every fixed λ.
它并未证明硬过滤在任意学习误差或每一个固定 λ 下,都优于 Gibbs 解码。
7. The implementation changes the guarantee boundary7. 实现改变了保证的边界
Algorithm 1 samples candidate tokens from π, accepts the first candidate with estimated value at least c, and falls back to the highest scoring candidate when all K fail.
算法 1 从 π 采样候选 token,接受第一个估计价值至少为 c 的候选;当 K 个候选全部失败时,回退到其中分数最高者。
With unlimited trials and positive acceptance mass, rejection sampling is exact; with finite K, the fallback branch can emit a token below the threshold.
在尝试次数无限且接受概率质量为正时,拒绝采样是精确的;在有限 K 下,回退分支可能输出低于阈值的 token。
This equation follows from independent candidate draws and shows why increasing K helps locally, without implying monotonic empirical fallback rates across different generated trajectories.
这个式子由候选的独立采样推出,说明增加 K 为何在局部有帮助,但不意味着不同生成轨迹上的经验回退率必然单调。
Appendix E.3 uses K = 40 and evaluates a single candidate first, drawing the remaining K−1 only after rejection.
附录 E.3 使用 K = 40,先评估一个候选,仅在拒绝后才采样剩余 K−1 个。
Appendix E.2 specifies a three layer value head, focal loss with temporal smoothness, 5,000 training prompts, and 24 or 16 sampled responses per prompt depending on the dataset.
附录 E.2 规定三层价值头、带时间平滑项的 focal loss、5,000 个训练提示词,以及依数据集而定的每个提示词 24 或 16 条采样回答。
The concrete focal loss recipe is more specific than the discussion’s brief description in terms of binary cross entropy.
这个具体的 focal loss 配方,比讨论部分使用二元交叉熵所作的简述更精确。
A separate holdout pool of 1,000 examples supplies the safe calibration subset; its size n is not automatically 1,000.
另一个包含 1,000 个样本的留出池提供安全校准子集,因此其大小 n 并不自动等于 1,000。
8. Evidence and measurement choices8. 实验证据与衡量口径
The experiments use Mistral-7B-Instruct-v0.3, Llama-3.1-8B-Instruct, and Gemma-4-E4B on HH-RLHF, BeaverTails, and PKU-SafeRLHF.
实验在 HH-RLHF、BeaverTails 与 PKU-SafeRLHF 上使用 Mistral-7B-Instruct-v0.3、Llama-3.1-8B-Instruct 和 Gemma-4-E4B。
Regular decoding, ARGS, Controlled decoding, and CARDS are the baselines, and the steering methods share the learned value estimator.
基线包括常规解码、ARGS、Controlled decoding 与 CARDS,各引导方法共享学习得到的价值估计器。
Figure 3 averages each operating point over 500 prompts and reports one standard error across prompts, rather than variation across independent training runs.
图 3 的每个工作点对 500 个提示词取平均,并报告跨提示词的一个标准误,而非独立训练运行之间的变化。
The strongest reported pattern is preservation of the base response at useful safety levels; Appendix F.3 explicitly reports no safety versus helpfulness advantage on PKU-SafeRLHF.
报告中最稳定的模式是在有用的安全水平下保留基础回答;附录 F.3 明确指出,在 PKU-SafeRLHF 上没有安全性与帮助性权衡的优势。
Helpfulness here measures compliance with the requested intent, including harmful intent, while safety is evaluated separately by the judge.
这里的帮助性衡量是否满足请求意图,包括有害意图,而安全性由裁判单独评估。
The safety prompt also labels quoted offensive language as unsafe, so the measured objective includes a specific labeling policy rather than a universal definition of harm.
安全提示词还将引用的冒犯性语言标为不安全,因此被衡量的目标包含特定标注规则,而不是普遍的伤害定义。
The authors report agreement on 256 of 280 manually checked cases, but this does not eliminate shared judge bias between probe training and evaluation.
作者报告在 280 个人工检查案例中有 256 个一致,但这不能消除探针训练与评估共享裁判所带来的偏差。
| Source / setting / 来源 / 设置 | Value-filtered / 价值过滤 | Comparison / context / 对比 / 背景 |
|---|---|---|
| Table / 表 1 · HH-RLHF · f = 0 | 0.935 ± 0.017 | Controlled: 0.905 ± 0.021 |
| Table / 表 1 · HH-RLHF · f = 2 | 0.945 ± 0.016 | Controlled: 0.890 ± 0.022 |
| Table / 表 1 · BeaverTails · f = 1 | 0.890 ± 0.022 | Controlled: 0.900 ± 0.021 |
| Table / 表 9 · HH-RLHF · α = 0.05 · K = 40 | 0.005 ± 0.005 | Fallback / 回退 |
| Table / 表 9 · HH-RLHF · α = 0.85 · K = 40 | 0.680 ± 0.033 | Fallback / 回退 |
| Table / 表 13 · HH-RLHF · α = 0.05 | 0.832 ± 0.017 | Unchanged responses / 回答原样保留 |
| Table / 表 13 · HH-RLHF · α = 0.85 | 0.128 ± 0.015 | Unchanged responses / 回答原样保留 |
In Table 1, f scales injected Gaussian noise relative to the trajectory’s value estimate standard deviation, and the compared settings use dataset specific α values.
表 1 中,f 按轨迹价值估计的标准差缩放注入的高斯噪声,所比较的设置使用因数据集而异的 α。
Winning in 14 of 15 reported cells is a descriptive result, not evidence that all differences are statistically significant.
在报告的 15 个单元中赢下 14 个,是描述性结果,并不证明所有差异都具有统计显著性。
The large fallback value at α = 0.85 and the small unchanged fraction make the weak preservation at this aggressive operating point visible.
α = 0.85 时较大的回退值与较小的原样保留比例,直接体现了这个激进工作点较弱的保真性。
Cosine similarity uses sentence embeddings and cannot by itself certify equal factual content, style, or reasoning quality.
余弦相似度使用句子嵌入,单靠它无法证明事实内容、风格或推理质量相同。
9. Interpretation and useful follow-up tests9. 解读与值得开展的后续测试
The most reusable contribution is a measurable intervention budget tied to a trajectory event, together with a decoder that preserves relative probabilities inside the accepted set.
最有复用价值的贡献,是把可衡量的干预预算连接到轨迹事件,并提供一个在接受集合内保留相对概率的解码器。
A distribution shift test could calibrate on one prompt population and evaluate another, separating false intervention risk from safety, helpfulness, and fallback frequency.
分布偏移测试可以在一种提示词群体上校准、在另一种群体上评估,分别衡量误干预风险、安全性、帮助性与回退频率。
A stronger measurement study could use an independent judge and human review of unchanged, improved, and degraded responses.
更强的测量研究可以引入独立裁判,并人工审查未改变、改善和退化的回答。
A threshold diagnostic could report acceptance mass and near threshold mass alongside probe accuracy, because these quantities explain both computational cost and sensitivity.
阈值诊断可以在探针准确率之外报告接受概率质量和阈值附近质量,因为这些量能够同时解释计算成本与敏感性。
These are proposed evaluations from this note; no model training or reproduction experiments were run for this reading.
这些是本笔记提出的评估建议;本次阅读没有运行模型训练或复现实验。
10. Source map and terminology10. 来源索引与术语
The method and oracle claims are in Sections 3.1 to 3.4 and Appendix B; calibration is in Appendix D; implementation is in Algorithm 1 and Appendix E.
方法与真实价值下的结论见第 3.1 至 3.4 节和附录 B;校准见附录 D;实现见算法 1 和附录 E。
The main comparison is in Figures 3 and 4 on pages 8 and 9; the PKU comparison is Figure 8 on page 35; noise results are Table 1 on page 10.
主要比较见第 8、9 页的图 3、4;PKU 比较见第 35 页的图 8;噪声结果见第 10 页的表 1。
Fallback, speed, and unchanged response measurements appear in Tables 9, 12, and 13 on pages 36 and 37.
回退、速度与回答原样保留的测量值,见第 36、37 页的表 9、12、13。
The note links to the original figures instead of reproducing them, and presents selected numerical facts as a new table with source labels.
本笔记链接到原始图表而不复制图片,并将选取的数值事实整理为带来源标记的新表格。
| English | 中文 |
|---|---|
| value function | 价值函数 |
| base policy | 基础策略 |
| false intervention | 误干预 |
| safe trajectory | 安全轨迹 |
| exchangeability | 可交换性 |
| marginal guarantee | 边际保证 |
| rejection sampling | 拒绝采样 |
| fallback | 回退 |
| acceptance mass | 接受概率质量 |
| total variation | 总变差 |