Kaijing Ma

Explaining and Improving Contrastive Decoding by Extrapolating the Probabilities of a Huge and Hypothetical LM

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

English / 中文 · Source / 原文

What is being extrapolated?

外推的对象是什么?

APD asks whether several models from one size-controlled family can improve the next-token distribution of the largest available model.

APD 问的是:同一家族内不同规模的模型,能否共同改善当前可用最大模型的下一词分布。

The target is a hypothetical asymptotic distribution, not the output of an actually trained infinite model.

目标是一个假想的渐近分布,而不是实际训练出的无限大模型的输出。

The paper first interprets contrastive decoding as linear extrapolation in logit space, then replaces that inductive bias with saturating curves in probability space.

论文先把对比解码解释为 logit 空间的线性外推,再用概率空间中逐渐饱和的曲线替换这一归纳偏置。

An important failure case is an easy answer that both the small and large models already prefer.

一个重要失败情形是:大小模型都已经偏好的简单答案。

Subtracting the small model can suppress this answer and promote a less appropriate token whose probability grew more sharply with scale.

减去小模型可能压低这个答案,转而提升一个概率随规模增长更快、却不够恰当的词。

The authors call this obvious blindness, illustrated by Bees versus Invertebrates in Figure 1.

作者将其称为 obvious blindness,并在图 1 中用 Bees 与 Invertebrates 的对比说明。

The conditional theorem

带条件的理论解释

With expert logits E and amateur logits A, the paper uses z = E − A/T.

用 E 表示专家 logit、A 表示业余模型 logit,论文采用 z = E − A/T。

For T > 1, rewrite this as (1 − 1/T)[E + (E − A)/(T − 1)].

当 T > 1 时,可以将它改写为 (1 − 1/T)[E + (E − A)/(T − 1)]。

z_CD = E − A/T = (1 − 1/T) z_H; log s_H = (T log s_E − log s_A)/(T − 1)

If each token logit is affine in log model size, the bracketed expression is the logit at the extrapolated size s_H.

如果每个词的 logit 都是模型规模对数的仿射函数,方括号中的表达式就是外推规模 s_H 处的 logit。

The multiplicative factor means that CD samples this hypothetical model at temperature T/(T − 1).

前面的乘法因子意味着,CD 相当于以温度 T/(T − 1) 对这一假想模型采样。

This algebra does not establish that real token logits follow a linear scaling law.

这一代数关系并未证明真实模型的逐词 logit 遵循线性缩放规律。

Nor does extrapolation beyond observed sizes certify better factuality.

超出已观察规模的外推也不能保证事实性更好。

As an independent illustration, T = 2 places the hypothetical model at s_E²/s_A and gives temperature 2.

作为独立说明,当 T = 2 时,假想模型规模为 s_E²/s_A,温度为 2。

Taking T toward 1 makes the inferred size diverge, so the formula should not be read as a stable prediction in that limit.

当 T 趋近 1 时,推算出的规模发散,因此不能将这一极限附近的公式理解为稳定预测。

Section 8 says the theory does not cover T larger than 1, which conflicts with Theorem 1 and its own following discussion of smaller T.

第 8 节称理论未覆盖 T 大于 1 的情形,这与定理 1 及紧随其后对较小 T 的讨论冲突。

The theorem explicitly assumes T > 1; this note follows that statement and flags the apparent textual error.

定理明确假设 T > 1;本笔记按定理表述解释,并标出这一疑似文字错误。

How the learned correction is trained

学习得到的修正如何训练

APD collects candidate-token probabilities from several model sizes on one million lines of Wikipedia 2021.

APD 在 Wikipedia 2021 的一百万行文本上收集多个规模模型对候选词的概率。

The candidates include the expert's top 20 tokens and sampled lower-ranked tokens; each model is normalized over this candidate set.

候选集合包括专家概率最高的 20 个词及抽样的较低排名词;各模型概率都在这个集合内归一化。

These are conditional probabilities on a selected vocabulary subset, not untouched full-vocabulary probabilities.

因而它们是在选定词表子集上的条件概率,而非未经处理的完整词表概率。

Increasing curves are flipped by p ↦ 1 − p so that one decreasing parameterization can represent both directions.

对上升曲线进行 p ↦ 1 − p 的翻转,使同一种下降参数化可以表示两种趋势。

p_hat(s) = P'_AP + a exp[−max(0, b(s − d))], a,b,d > 0; s = log(model size)

The proposed asymptote comes from softmax(E − A′), where A′ is a trainable copy of the amateur.

待估计的渐近值来自 softmax(E − A′),其中 A′ 是业余模型的可训练副本。

A four-layer MLP receives the proposed asymptote and observed probabilities and predicts a, b, and d.

一个四层 MLP 接收待估计渐近值及观测概率,并预测 a、b、d。

The MLP checks whether that asymptote can explain the observed curve; it is not supervised by an infinite model.

MLP 检验这一渐近值能否解释观测曲线;它没有来自无限大模型的监督。

The first loss is a root-mean-square fit to all sizes except the largest.

第一项损失对除最大模型外的各规模计算均方根拟合误差。

The second penalizes the positive excess of the fitted curve above the largest model's flipped probability.

第二项惩罚拟合曲线高于最大模型翻转后概率的正向超出量。

Equation 10 takes the square root of the mean positive excess; it does not square that excess.

式 10 对平均正向超出量开平方,并没有先将超出量平方。

The third loss limits the drift of A′ from the original amateur logits.

第三项损失限制 A′ 相对于原业余模型 logit 的偏移。

L = L₁ + 10L₂ + λ₃L₃; λ₃ = 0.8 (Pythia), 0.4 (OPT), 1.0 (Qwen1.5)

Only the amateur and curve network are optimized; the expert stays fixed.

只优化业余模型和曲线网络,专家模型保持固定。

At inference the curve network and intermediate models disappear, leaving the expert plus the updated amateur.

推理时不再使用曲线网络及中间规模模型,只保留专家与更新后的业余模型。

Thus the similar inference cost is relative to two-model CD, not to a single-model decoder, and it excludes offline training.

因此,相近推理成本是相对于双模型 CD 而言,不是相对于单模型解码器,也不包括离线训练。

What the experiments actually measure

实验究竟测量了什么

Figure 4 compares factuality and diversity together rather than reporting one isolated winning score.

图 4 同时比较事实性和多样性,而不是只展示一个获胜分数。

NEER measures named entities absent from retrieved Wikipedia evidence, while Dist-2 measures distinct bigrams.

NEER 衡量未出现在检索所得 Wikipedia 证据中的命名实体,Dist-2 衡量不同二元词组的比例。

Both retrieval errors and the sampling threshold can influence the apparent factuality gain.

检索错误和采样阈值都可能影响观察到的事实性提升。

In Table 1, OPT with top-p k20 at p = 0.8 changes NEER from 38.20 for CD to 34.06 for APD.

表 1 中,OPT 在 p = 0.8 的 top-p k20 设置下,NEER 从 CD 的 38.20 降至 APD 的 34.06。

Dist-2 changes from 44.13 to 45.72, but severe repetition rises from 0.78 to 3.39; all four numbers are percentages.

Dist-2 从 44.13 升至 45.72,但严重重复率从 0.78 升至 3.39;这四个数均为百分数。

This is evidence of a useful tradeoff, with a repetition cost that should remain visible.

这说明存在有用的权衡,同时也应保留对重复代价的说明。

For Pythia in Table 2, LAMBADA perplexity is 2.237 for CD, 2.132 for APD, and 2.188 for the 12B model.

表 2 中 Pythia 的 LAMBADA 困惑度分别为 CD 2.237、APD 2.132、12B 模型 2.188。

CommonsenseQA perplexity is 6.176, 5.882, and 8.140 in the same order.

同样顺序下,CommonsenseQA 困惑度分别为 6.176、5.882 和 8.140。

These scores use top-20 filtering, candidate renormalization, and probability smoothing described in Appendix E.3.

这些分数采用附录 E.3 所述的 top-20 筛选、候选概率重新归一化及概率平滑。

They are not standard full-vocabulary perplexities on the complete benchmark.

它们不是完整基准上标准的全词表困惑度。

The QA experiments also report the best temperature directly, so a new deployment should select temperature on separate validation data.

QA 实验还直接报告最佳温度结果,因此实际新任务应在独立验证集上选择温度。

The human evaluation uses 150 continuations with two annotators each; factuality ratings rise from 2.16 for CD + REAL to 2.31 for APD + REAL.

人工评估包含 150 个续写,每个由两名标注者评价;事实性评分从 CD + REAL 的 2.16 提升至 APD + REAL 的 2.31。

The small sample and modest inter-annotator correlation limit the strength of deployment conclusions.

样本较少且标注者相关性不高,限制了对部署效果作强结论的依据。

Limits, reproduction, and interpretation

局限、复现与解释

The main evidence concerns older pretrained model families, with mixed results for OPT and Qwen on some QA tasks.

主要证据来自较早的预训练模型家族,OPT 与 Qwen 在部分 QA 任务上的结果并不一致。

A shared tokenizer, comparable training data, and a useful range of model sizes make the extrapolation easier to interpret.

相同分词器、可比训练数据以及足够宽的模型规模范围,有助于解释外推的含义。

The asymptote remains an inductive assumption; finite observations cannot uniquely identify the behavior of an infinite model.

渐近值仍依赖归纳假设;有限观测不能唯一确定无限大模型的行为。

A useful reproduction should preserve candidate filtering, report unfiltered accuracy as well, and separate training cost from inference cost.

有价值的复现应保留候选筛选设置,同时报告未筛选准确率,并区分训练与推理成本。

The author repository is amazon-science/llm-asymptotic-decoding, linked from the paper.

论文链接的作者仓库为 amazon-science/llm-asymptotic-decoding。

The key contribution is a learned replacement for a crude extrapolation rule, not proof that a small model literally contains a larger model.

核心贡献是学习一个更好的外推规则,而不是证明小模型真的包含一个更大的模型。