Kaijing Ma

UCD: Unlearning in LLMs via Contrastive Decoding

Original note, sentence-aligned / 原创笔记逐句对照。Not a full-paper translation / 不是论文全文翻译。

English / 中文 · Source / 原文

Output-level unlearning

输出层面的遗忘

UCD changes the next-token distribution of a large model using two smaller auxiliary models.

UCD 利用两个较小的辅助模型改变大模型的下一词分布。

It leaves the reference model's weights intact, so the intervention is enforced by the serving procedure.

它保持参考模型权重不变,因此干预由推理服务流程实施。

Removing that procedure restores access to the original model; this is not permanent erasure from its parameters.

移除该流程就会恢复对原模型的访问;这不是从参数中永久删除信息。

The objective is to approach the behavior of a model trained without the forget set while preserving useful retained knowledge.

目标是在保留有用知识的同时,接近未使用遗忘集训练的模型行为。

The auxiliary contrast and its normalization

辅助对比信号及其归一化

The setup starts with a clean auxiliary base whose pretraining data exclude the forget set.

设置从一个干净的辅助基础模型开始,其预训练数据不包含遗忘集。

Section 3 fine-tunes one copy on the forget set and another on the retain set.

第 3 节分别在遗忘集和保留集上微调两个副本。

Their log-probability difference measures relative preference for tokens associated with the forget data.

两者的对数概率差衡量对遗忘数据相关词元的相对偏好。

Δ_A(y|x) = log A_corr(y|x) − log A_clean(y|x)
Q(y|x) = P_corr(y|x) [A_clean(y|x)/A_corr(y|x)]^α / Z(x)

The normalizer Z(x) makes this a valid categorical distribution; the paper's log update is understood up to that constant.

归一化常数 Z(x) 使其成为合法的分类分布;论文中的对数更新应理解为省略了这一常数。

Positive Δ_A suppresses a token's score, while negative Δ_A increases it.

正的 Δ_A 压低词元分数,负的 Δ_A 提高词元分数。

The same distributions must be evaluated on the same generated prefix and compatible token vocabulary.

各模型必须在相同生成前缀和兼容词表上计算分布。

Raw logits and log probabilities give equivalent normalized UCD distributions, because their offsets are token-independent.

对 UCD 而言,原始 logit 与对数概率产生相同的归一化分布,因为两者偏移与词元无关。

That equivalence requires more care for UCS, which clips the contrast at zero before subtracting it.

对 UCS 则需要额外小心,因为它先将对比信号的负值截为零再相减。

A token-independent offset can change which tokens are clipped, so a faithful UCS implementation should verify the score convention.

与词元无关的偏移可能改变哪些词元被截断,因此忠实实现 UCS 时必须核对分数约定。

The displayed UCS equation omits α although the following text mentions it; this is a source ambiguity to resolve against the implementation.

UCS 的展示公式省略了 α,但后文提及它;这是需要对照实现解决的原文歧义。

What the exact recovery proposition assumes

精确恢复命题的前提

If the auxiliary log-ratio equals m times the reference model's corrupted-to-clean log-ratio, α = 1/m cancels the unwanted component.

如果辅助对数比等于参考模型污染与干净版本对数比的 m 倍,则 α = 1/m 可抵消不希望保留的部分。

Δ_A(y|x) = m[log P_corr(y|x) − log P_clean(y|x)] ⇒ Q(·|x) = P_clean(·|x)

This is a sufficient assumption about the desired correction, not a proof that smaller trained models satisfy it.

这是关于目标修正的充分假设,不是证明训练得到的小模型满足它。

For one global α to recover every conditional distribution, the proportionality scale must also be compatible across prefixes.

若希望一个全局 α 恢复所有条件分布,比例尺度还必须在不同前缀间相容。

Approximate agreement in signs is weaker than calibrated agreement in magnitudes.

符号大致一致,比幅度校准后一致弱得多。

An independent error calculation makes the limitation explicit: if Δ_A = m log(P_corr/P_clean) + e, then Q is P_clean tilted by exp(−e/m).

一个独立误差计算可以明确这一局限:若 Δ_A = m log(P_corr/P_clean) + e,则 Q 是对 P_clean 乘以 exp(−e/m) 后归一化的分布。

Q(y|x) / P_clean(y|x) = exp[−e(y,x)/m] / E_{P_clean}[exp(−e/m)]

Only a token-independent residual cancels exactly; token-dependent residuals can distort the retained distribution.

只有与词元无关的残差会完全抵消;依赖词元的残差可能扭曲保留分布。

The proposition contains the phrase without the retain set, which conflicts with the defined clean target; the intended target throughout the paper excludes the forget set.

命题中出现 without the retain set,与前文定义的干净目标冲突;论文整体所指目标应排除遗忘集。

Benchmarks and the meaning of forgetting

基准与遗忘指标的含义

The principal tasks are TOFU Forget 5%, TOFU Forget 10%, and MUSE News, with three random seeds.

主要任务是 TOFU Forget 5%、TOFU Forget 10% 和 MUSE News,使用三个随机种子。

TOFU uses synthetic author profiles and compares forget-set behavior with a retrained baseline.

TOFU 使用合成作者资料,并将遗忘集行为与重新训练基线比较。

A Kolmogorov–Smirnov p-value above 0.05 is treated as passing the benchmark's forget-quality criterion.

Kolmogorov–Smirnov 检验的 p 值高于 0.05,被视为达到基准的遗忘质量标准。

Failure to reject that test is not a proof that the full generative distributions are identical.

该检验未拒绝原假设,并不证明完整生成分布相同。

MUSE Books is excluded because the authors could not obtain a clean auxiliary model for the Harry Potter corpus.

作者无法为 Harry Potter 语料获得干净辅助模型,因此未评估 MUSE Books。

News provides a cleaner temporal separation relative to Llama2 pretraining.

相对于 Llama2 预训练,News 提供了更清晰的时间分隔。

In Table 1, UCD's retain KnowMem is 43.87 ± 1.37 versus 46.15 ± 1.49 for retraining and 34.27 ± 2.16 for NPO + RT.

表 1 中,UCD 的保留集 KnowMem 为 43.87 ± 1.37,重新训练为 46.15 ± 1.49,NPO + RT 为 34.27 ± 2.16。

Its forget VerbMem is 20.50 ± 0.56 versus 20.99 ± 0.42 for retraining.

其遗忘集 VerbMem 为 20.50 ± 0.56,重新训练为 20.99 ± 0.42。

The retraining baseline need not score zero on forget content, so maximum suppression is not the same objective as matching retraining.

重新训练基线在遗忘内容上的得分不一定为零,因此最大抑制并不等于匹配重新训练。

Gradient ascent reaches zero on these knowledge metrics but also collapses retained utility in the reported setting.

在所报告设置下,梯度上升将这些知识指标降至零,但保留效用也崩溃了。

Approximate auxiliaries and scaling

近似辅助模型与扩展

When clean auxiliaries are unavailable, the paper substitutes models produced by existing approximate unlearning methods.

无法获得干净辅助模型时,论文用已有近似遗忘方法产生的模型替代。

This helps only when the underlying method supplies a useful signal; poor gradient-ascent baselines are not reliably rescued.

只有底层方法提供有用信号时才有帮助;表现差的梯度上升基线并不能被可靠挽救。

Appendix Table 11 shows that bootstrapped UCD on MUSE can reduce retained KnowMem from 34.27 to 28.09 even while changing forget metrics.

附录表 11 显示,在 MUSE 上叠加 UCD 可能在改变遗忘指标的同时,将保留 KnowMem 从 34.27 降至 28.09。

Therefore the broad claim of improved tradeoffs must be read alongside the individual metrics.

因此,关于权衡改善的总体表述必须结合各项指标阅读。

UCS can be preferable with approximate clean models because it avoids directly promoting tokens on a potentially unreliable negative contrast.

使用近似干净模型时,UCS 可能更合适,因为它避免基于可能不可靠的负对比信号直接提升词元。

The paper also evaluates a 70B reference model with 13B auxiliaries when some weight-update baselines run out of memory.

论文还用 13B 辅助模型评估 70B 参考模型,此时部分权重更新基线发生内存不足。

This demonstrates a feasible compute regime, not zero overhead: every decoding step needs three model evaluations.

这展示了一个可行计算配置,而非零开销:每次解码需要三个模型的评估。

Reproduction and limits

复现与局限

A reproduction should verify the clean pretraining assumption, tokenizer alignment, auxiliary training sets, and the α selection procedure.

复现应核对干净预训练假设、分词器对齐、辅助训练集以及 α 的选择过程。

Privacy leakage, retained utility, and forget accuracy should be reported together rather than collapsed into one success label.

隐私泄漏、保留效用和遗忘准确率应一起报告,而不是合并成一个成功标签。

The method supplies output-level control while the original weights remain accessible to an adversary who can bypass the decoder.

该方法提供输出层面控制,而能绕过解码器的攻击者仍可访问原始权重。

Its most persuasive use is scalable behavioral correction under a controlled inference interface, with limited exact-recovery theory.

它最有说服力的用途,是在受控推理接口下实现可扩展的行为修正,而精确恢复理论仍很有限。