blog

Welcome to my blog!

Survey: Decoding Methods

ab's Avatar 2026-08-19 Research

  1. Beyond Tokens: A Survey on Decoding Methods for Large Language and Vision-Language Models
    1. 基本信息
    2. 重要链接
    3. TLDR
    4. 作者与团队
    5. 团队研究脉络
    6. 论文全景:Figure 1
    7. Figure 2:领域是如何发展到这里的
  2. §1 — 研究问题与重要性
    1. Claim
    2. 为什么这个问题重要
  3. §2 — 前人工作与不足
    1. 经典 decoding
    2. 新问题出现了
    3. 本文相对 prior survey 的 novelty
  4. §3 — 重建作者的思考路径
    1. 第一步:发现 decoding 已经不是 sampling
    2. 第二步:发现“对比”有非常多不同来源
    3. 第三步:发现另一批方法根本不是在做 contrast
    4. 第四步:另一批研究根本不关注 alignment,而关注速度
    5. 最终自然得到三个问题
      1. Question A
      2. Question B
      3. Question C
  5. §4 — 核心 Intuition
    1. Contrastive
    2. Guided
    3. Parallel
  6. §5 — 具体方法与完整 Pipeline
    1. 5.1 Contrastive route
      1. Positive condition
      2. Negative condition
    2. 5.2 Guided route
    3. 5.3 Parallel route
      1. Draft
      2. Verify
  7. §6 — 核心数学推导
    1. 6.1 Autoregressive generation
    2. 6.2 Contrastive Decoding
    3. 6.3 Guided Decoding
    4. 6.4 Parallel Decoding
  8. §7 — 实验设计与结论
    1. 这篇论文没有自己的 benchmark
    2. Table 1:Contrastive Decoding 路线
    3. Table 1:Guided Decoding 路线
    4. Table 1:Parallel Decoding 路线
    5. 论文实际证明了什么?
    6. 论文没有充分证明什么?
  9. §8 — Take-aways
    1. Take-away 1:现代 decoding 已经不是“怎么抽 token”
    2. Take-away 2:三类方法可以这样记
    3. Take-away 3:Contrastive Decoding 的关键不是 subtraction
    4. Take-away 4:Guided Decoding 的真正难题不是 search
    5. Take-away 5:Parallel Decoding 的核心 metric 是 acceptance
  10. §9 — 最脆弱的假设
    1. Contrastive
    2. Guided
    3. Parallel
  11. §10 — 最小复现实验
    1. Model
    2. 四个 decoding 条件
      1. Baseline
      2. Contrastive
      3. Guided
      4. Parallel
    3. 三类任务
      1. Factual QA
      2. Reasoning
      3. Open generation
    4. 统一记录
    5. 最关键:人为制造 mismatch
      1. Contrastive
      2. Guided
      3. Parallel
    6. 支持论文 claim 的结果
    7. 反驳论文 claim 的结果
  12. §11 — 最强反例设计
    1. 构造一个 expert-ordering reversal
    2. 这个反例真正打击的是什么?
  13. §12 — Follow-up Research Idea
    1. Self-Diagnosing Budgeted Decoding
    2. State
    3. Action
    4. Objective
    5. 可以借鉴哪些相邻领域?
    6. 和已有工作的根本区别
    7. 第一个实验
      1. Fixed strategy
      2. Oracle routing
      3. Learned routing
    8. 最后怎么评价这篇论文

Beyond Tokens: A Survey on Decoding Methods for Large Language and Vision-Language Models

基本信息

标题Beyond Tokens: A Survey on Decoding Methods for Large Language and Vision-Language Models
作者:Haoran Wang, Xiongxiao Xu, Philip S. Yu, Kai Shu
机构

  • Emory University
  • Illinois Institute of Technology
  • University of Illinois Chicago

arXiv v1 于 2026 年 8 月 14 日上传;论文同时标注发表在 ACM SIGKDD Explorations Newsletter, Volume 28, Issue 1。ACM 页面显示正式 publication date 为 2026 年 6 月 17 日,因此这是正式版本先出现、arXiv 后上传的情况。

论文 PDF/HTML 首页没有标注 equal contribution、corresponding author 或 author contribution statement,因此只能确定 Haoran Wang 是第一作者、Kai Shu 是末位作者;不能仅根据作者顺序把具体贡献归给某个人。

重要链接

最后这个 GitHub 不是本文算法代码,而是论文维护的 decoding literature / resource list。README 明确把论文按 paradigms 和 applications 两个维度持续整理。

TLDR

这篇论文没有提出新的 decoding algorithm,也没有跑自己的 benchmark

它真正做的是重新定义现代 LLM/LVLM decoding 的研究版图,把近年的方法压缩成三个核心 paradigm:

Contrastive Decoding\boxed{\text{Contrastive Decoding}}

Guided Decoding\boxed{\text{Guided Decoding}}

Parallel Decoding\boxed{\text{Parallel Decoding}}

三者本质分别是在解决:

Contrastive应该朝哪个 probability direction 走?\text{Contrastive} \rightarrow \text{应该朝哪个 probability direction 走?}

Guided除了 LM likelihood,真正应该优化什么?\text{Guided} \rightarrow \text{除了 LM likelihood,真正应该优化什么?}

Parallel如何减少 sequential token generation 的 latency?\text{Parallel} \rightarrow \text{如何减少 sequential token generation 的 latency?}

因此这篇 survey 最值得记住的不是几十个方法名,而是它提出的一个更大的视角:

decoding 已经从 top-pp/beam search 这种 sampling heuristic,逐渐变成了 inference-time model control layer。

它可以在不重新训练整个模型的情况下干预 factuality、hallucination、safety、reasoning、RAG、code generation 和 inference efficiency。论文同时明确说,当前 literature 对 text LLM 的覆盖远多于 LVLM,因此所谓 LLM/LVLM survey 实际仍然是 LLM-heavy


作者与团队

头像 作者 论文 Role 截至 2026-08 的身份与机构 背景与研究方向 与本文最相关的工作
头像/主页 Haoran Wang First author Emory University CS final-year PhD candidate,导师 Kai Shu Purdue CS 本科、University of Oregon CS 硕士;研究重点已经明确聚焦 trustworthy foundation models、factuality、safety、privacy、representation steering、decoding / inference-time control Privacy-Aware Decoding, KDD 2026;CI-Steering, COLM 2026;Trojan Activation Attack, CIKM 2024
头像/主页 Xiongxiao Xu Second author Illinois Institute of Technology CS PhD candidate,2022 起由 Kai Shu 指导 重庆大学 CS 本科;研究 sequential ML,包括 LLM、time series、sequential recommendation、decision making;曾在 Argonne、TikTok、Amazon 实习 Privacy-Aware Decoding;WWW 2026 multimodal/time-series LLM work
头像/官方主页 Philip S. Yu Third author University of Illinois Chicago Distinguished Professor、Wexler Chair 长期研究 big data、data mining、graph/network mining、privacy、data streams;此前长期任职 IBM Watson 与 Kai Shu 团队长期存在 trustworthy AI / data mining 合作
头像/主页 Kai Shu Last author;可合理视为 PI/senior role,但论文未正式声明 Emory CS 个人主页截至目前写 Associate Professor ASU CS PhD,导师 Huan Liu;方向包括 trustworthy AI、misinformation、privacy/security、robustness、foundation-model factuality/reliability/safety Privacy-Aware Decoding;TrustLLM;Trojan Activation Attack

Haoran Wang 的个人主页直接写明,他目前的研究重点是通过 inference-time control,包括 representation steering 和 decoding methods 改善 foundation model 的 factuality、safety 和 privacy,所以这篇 survey 与他的研究主线高度一致。

Xiongxiao Xu 当前是 Illinois Tech CS PhD candidate,研究 LLM、time series、sequential recommendation 和 decision making;其主页也确认 Kai Shu 是其导师。

Philip S. Yu 的 UIC 官方页面确认其现任 Distinguished Professor 和 Wexler Chair,主要方向是 big data、data mining、graph/network mining、privacy 等。

Kai Shu 的个人主页目前写的是 Associate Professor,并明确列出 Large Foundation Models 中 factuality、reliability、safety,以及 Trustworthy AI、privacy、安全等方向。值得注意的是,Emory 系里的 faculty directory 搜索结果仍把他标成 Assistant Professor,因此网页元数据有更新不同步;这里优先采用他自己的最新主页。

团队研究脉络

【基于证据的推断】

这不是一个突然出现的 survey team。

Haoran Wang + Kai Shu 的研究路线大致可以看成:

misinformation / claim verification\text{misinformation / claim verification}

\downarrow

LLM trustworthiness\text{LLM trustworthiness}

\downarrow

activation steering / safety\text{activation steering / safety}

\downarrow

inference-time control\text{inference-time control}

\downarrow

decoding\text{decoding}

尤其 Privacy-Aware Decoding: Mitigating Privacy Leakage of Large Language Models in Retrieval-Augmented Generation 已经直接属于 decoding 研究,因此写一篇试图统一现代 decoding landscape 的 survey,是其现有研究脉络的自然延伸。Haoran 主页明确把该论文列为 KDD 2026 工作。

Xiongxiao Xu 是 Kai Shu 在 Illinois Tech 时期指导的博士生;Philip S. Yu 则长期参与这批学生/团队的数据挖掘、trustworthy ML 相关合作。

所以【基于证据的推断】,团队结构更像:

Kai Shu 的 trustworthy-AI/inference-time-control 研究线 + Illinois Tech 合作延续 + Philip S. Yu 的 broader data-mining network。

没有 contribution statement,因此不能进一步猜测谁具体负责 taxonomy、写作或者 literature collection。


论文全景:Figure 1

你给出的 Figure 1 是全文最重要的一张图。它非常长,所以这里保留其核心结构并转成文本,这样比把整张超长截图塞进正文更容易读。

**Figure 1 — Typology of decoding methods for LLMs and LVLMs。**论文用它把整个领域划分为 classical preliminaries、modern paradigms 和 applications。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Decoding Methods

├── Decoding Preliminaries
│ │
│ ├── Deterministic Methods
│ │ ├── Greedy Search
│ │ ├── Beam Search
│ │ └── Contrastive Search
│ │
│ ├── Stochastic Methods
│ │ ├── Top-k Sampling
│ │ ├── Top-p Sampling
│ │ └── Temperature Sampling
│ │
│ └── Accelerated Methods
│ └── Parallel / Speculative Decoding

├── Decoding Paradigms
│ │
│ ├── Contrastive Decoding
│ │ │
│ │ ├── Token-wise
│ │ │ ├── DExperts
│ │ │ ├── CD
│ │ │ ├── CAD
│ │ │ ├── SCD
│ │ │ ├── VCD
│ │ │ ├── ACD
│ │ │ ├── ICD
│ │ │ ├── IBD
│ │ │ └── VACoDe ...
│ │ │
│ │ └── Layer-wise
│ │ ├── DoLa
│ │ ├── SCMoE
│ │ ├── VaLiD
│ │ └── DFD ...
│ │
│ ├── Guided Decoding
│ │ │
│ │ ├── Classifier-Guided
│ │ │ ├── PPLM
│ │ │ ├── CriticControl
│ │ │ ├── RAD
│ │ │ ├── DBS
│ │ │ ├── MGD
│ │ │ ├── SafeDecoding
│ │ │ └── DOMINO ...
│ │ │
│ │ └── Heuristic-Guided
│ │ ├── FUDGE
│ │ ├── NeuroLogic
│ │ ├── PPO-MCTS
│ │ ├── PG-TD
│ │ ├── TS-LLM
│ │ └── ...
│ │
│ └── Parallel Decoding
│ │
│ ├── Greedy
│ │ ├── Blockwise
│ │ ├── SAD
│ │ ├── Speculative
│ │ ├── Lookahead
│ │ ├── Speculative RAG
│ │ └── Swift
│ │
│ └── Sampling
│ ├── DistillSpec
│ ├── SpecInfer
│ ├── Medusa
│ ├── EAGLE
│ ├── Lantern
│ ├── SJD
│ └── SPD

└── Decoding Applications

├── Improve Model Alignment
│ ├── Mitigate Hallucination
│ ├── Improve Safety
│ └── Improve Reasoning

├── Improve Generation Tasks
│ ├── RAG
│ └── Code Generation

├── Improve Generation Efficiency
│ ├── Text Generation
│ ├── Image Generation
│ └── Video Generation

└── Domain-Specific Applications

这里一定要意识到,Figure 1 实际用了两个正交维度

How to decode{Contrastive,Guided,Parallel}\text{How to decode} \rightarrow \{ \text{Contrastive}, \text{Guided}, \text{Parallel} \}

而另一方面是:

Why to decode{Hallucination,Safety,Reasoning,RAG,Code,Efficiency}\text{Why to decode} \rightarrow \{ \text{Hallucination}, \text{Safety}, \text{Reasoning}, \text{RAG}, \text{Code}, \text{Efficiency} \}

所以:

Contrastive / Guided / Parallel 是 mechanism taxonomy。

而:

Hallucination / Safety / RAG 等是 application taxonomy。

这个 distinction 非常重要。


Figure 2:领域是如何发展到这里的

论文还给出了一张非常简洁的 timeline:

Figure 2

它概括出一个明显演进:

2018:Blockwise Decoding2018: \text{Blockwise Decoding}

2020:NeuroLogic2020: \text{NeuroLogic}

2021:FUDGE / DExperts2021: \text{FUDGE / DExperts}

2022:Contrastive Decoding / NaturalProver2022: \text{Contrastive Decoding / NaturalProver}

2023:DoLa / Speculative Decoding2023: \text{DoLa / Speculative Decoding}

2024:Medusa / VCD / ...2024: \text{Medusa / VCD / ...}

这里的历史意义在于:decoding 研究已经不再只是“sampling strategy”,而逐渐分化出了 control、reasoning/search、alignment 和 acceleration 等目的。


§1 — 研究问题与重要性

Claim

论文解决的问题不是:

top-pp 和 beam search 哪一个更好?

而是:

现代 LLM/LVLM inference-time decoding 已经发展成什么样?这些看起来完全不同的方法,能不能被一个统一 taxonomy 解释?

作者在论文中把 decoding 定义为:

model output distributionoutput sequence\text{model output distribution} \rightarrow \text{output sequence}

过程中发生的 inference-time procedure,包括:

  • token selection;
  • search;
  • sequence-level guidance;
  • parallel generation。

作者明确把它与:

  • training-time alignment;
  • prompt engineering;

区分开来。

为什么这个问题重要

最根本的问题来自训练目标和最终目标之间的不一致。

LLM pretraining 优化:

maxθtlogpθ(wtw<t)\max_\theta \sum_t \log p_\theta \left( w_t\mid w_{<t} \right)

但用户真正希望得到的东西可能是:

factual\text{factual}

safe\text{safe}

helpful\text{helpful}

context-grounded\text{context-grounded}

logically correct\text{logically correct}

low-latency\text{low-latency}

而:

pθ(wtw<t)p_\theta(w_t\mid w_{<t})

并不保证最大化这些目标。

论文因此把 generation control 分成:

  1. prompt engineering;
  2. latent-space manipulation;
  3. decoding algorithms。

作者特别强调 inference-time 方法的价值是无需重新训练整个模型,而且理论上可以在 frozen model 上动态改变 generation behavior。

于是你可以把模型理解成:

Pretrained Model\text{Pretrained Model}

\downarrow

pθ(wtw<t)p_\theta(w_t\mid w_{<t})

\downarrow

Inference-time Decoding Controller\boxed{\text{Inference-time Decoding Controller}}

\downarrow

Final Output\text{Final Output}

从这个角度看:

训练决定模型内部有哪些能力;decoding 决定当前 generation path 如何调用这些能力。

这是全文真正大的 idea。


§2 — 前人工作与不足

经典 decoding

早期最常见的是:

  • Greedy Search
  • Beam Search
  • Contrastive Search
  • Top-kk
  • Top-pp
  • Temperature

这些方法主要处理:

fluencydiversityrepetition\text{fluency} \quad \text{diversity} \quad \text{repetition}

而不是今天所谓 factuality / reasoning / safety / grounding。

论文指出 greedy 每一步:

wt=argmaxwP(ww<t)w_t^* = \arg\max_w P \left( w\mid w_{<t} \right)

因此只保证局部最优,并不保证找到 global best sequence;beam search 保存多个 hypothesis,但同样不保证全局最优,而且 open-ended generation 容易出现 repetitive outputs。

Top-kk 固定留下 kk 个候选:

Vk=TopK(pθ)V_k = \operatorname{TopK} \left( p_\theta \right)

问题是:

  • distribution 很 flat 时,kk 可能过小;
  • distribution 很 sharp 时,kk 又可能过大。

Top-pp 则动态选择:

minVp\min V_p

使得:

wVpP(w)p\sum_{w\in V_p}P(w)\ge p

所以它适应 probability distribution 的 shape。

但是这些方法本质上仍然没有解决:

LM probability 与真正 task utility 不一致。


新问题出现了

随着 LLM 规模变大,人们开始问:

  • 能不能降低 hallucination?
  • 能不能在 inference time 改 safety?
  • 能不能让 generation 更相信 retrieved context?
  • 能不能在 reasoning 时使用 verifier?
  • 能不能减少 autoregressive latency?

结果就出现大量互相看起来不相关的方法:

1
2
3
4
5
6
7
8
9
10
11
12
13
DExperts
DoLa
CAD
VCD
PPLM
FUDGE
RAD
MCTS
SafeDecoding
Speculative Decoding
Medusa
EAGLE
...

论文认为这里缺的是一个新的 organization principle。


本文相对 prior survey 的 novelty

【论文明确声称】

本文把 modern decoding 归纳为:

Contrastive+Guided+Parallel\boxed{ \text{Contrastive} + \text{Guided} + \text{Parallel} }

而不是继续按照 greedy / beam / sampling 来组织。

【基于证据的判断】

这篇 paper 的 novelty 因此属于:

taxonomy + literature synthesis

而不是:

  • 新 estimator;
  • 新 training objective;
  • 新 model;
  • 新 benchmark;
  • 新 decoding algorithm。

因此不能把它描述成“提出了一种新的 decoding 方法”。


§3 — 重建作者的思考路径

这里不要从论文最后得到的 taxonomy 倒推,而是假设我们事先不知道答案。

第一步:发现 decoding 已经不是 sampling

以前生成过程可以理解为:

logitssoftmaxtop-p / top-ktoken\text{logits} \rightarrow \text{softmax} \rightarrow \text{top-p / top-k} \rightarrow \text{token}

但是后来出现 DExperts。

DExperts 的做法已经不是简单 sampling,而是:

expert model 喜欢什么?

以及:

anti-expert 喜欢什么?

然后利用差值改变下一 token。


第二步:发现“对比”有非常多不同来源

再看 CAD:

不再比较两个不同 model,而比较:

with contextvs.without context\text{with context} \quad \text{vs.} \quad \text{without context}

DoLa 更进一步:

甚至不需要两个 model,而比较:

late layervs.early layer\text{late layer} \quad \text{vs.} \quad \text{early layer}

VCD:

original imagevs.distorted image\text{original image} \quad \text{vs.} \quad \text{distorted image}

这些看似不同的方法其实都符合:

Good DistributionBad / Baseline Distribution\boxed{ \text{Good Distribution} - \text{Bad / Baseline Distribution} }

于是自然抽象出:

Contrastive Decoding


第三步:发现另一批方法根本不是在做 contrast

PPLM:

增加 attribute classifier。

RAD:

增加 reward model。

Deductive Beam Search:

增加 verifier。

PPO-MCTS / TS-LLM:

甚至直接在 generation tree 上搜索。

这些方法共同的问题不是:

positive distribution 和 negative distribution 差多少?

而是:

哪个 candidate 最符合另一个 objective?

于是得到:

Guided Decoding


第四步:另一批研究根本不关注 alignment,而关注速度

Speculative Decoding:

先用 cheaper mechanism draft 多个 tokens,再让 target model parallel verify。

Medusa:

用多个 heads 预测多个 future tokens。

EAGLE:

进一步改善 speculation quality。

所以这里的目标已经不是:

better answer\text{better answer}

而是:

same / similar output quality+lower latency\text{same / similar output quality} + \text{lower latency}

于是得到第三类:

Parallel Decoding


最终自然得到三个问题

如果我是作者,我最终会发现所有 modern decoding 几乎都在回答下面三个问题之一:

Question A

如何从两个 probability signals 的差异中找到更好的方向?

Contrastive\rightarrow \text{Contrastive}

Question B

如何引入 LM likelihood 以外的评价目标?

Guided\rightarrow \text{Guided}

Question C

如何打破一 token 一 forward 的 sequential bottleneck?

Parallel\rightarrow \text{Parallel}

这就是本文 idea 最自然的形成路径。


§4 — 核心 Intuition

这张 Figure 3 我建议直接保留,因为它比任何文字解释都清楚:

Figure 3 — Three decoding paradigms

论文给出的直观定义是:

  • Contrastive:最大化两个 underlying distributions 的 contrast;
  • Guided:根据 guidance function 的 score 决定 next token;
  • Parallel:一次提出多个 candidate token,再进行选择/验证。

把它压缩成三句话:

Contrastive

我知道“什么更像正确方向”和“什么更像错误方向”,因此做 subtraction。

Guided

LM likelihood 不是最终目的,我增加一个 evaluator 告诉 generation 什么才真正好。

Parallel

答案逻辑不一定变,但不要每一步只生成一个 token。

更抽象地说:

Contrastive=modify preference direction\boxed{ \text{Contrastive} = \text{modify preference direction} }

Guided=modify objective\boxed{ \text{Guided} = \text{modify objective} }

Parallel=modify execution schedule\boxed{ \text{Parallel} = \text{modify execution schedule} }

这是整篇文章最好记的总结。


§5 — 具体方法与完整 Pipeline

因为它是 survey,所以没有一个“本文算法 pipeline”。

最好的方式是用同一个问题展示三种 decoding 各自在做什么。

假设我们做 RAG QA。

Context:

Eiffel Tower was completed in 1889.

问题:

When was the Eiffel Tower completed?

Base LLM 在某一步有:

1
2
3
4
5
1889   0.44
1887 0.22
1900 0.15
1888 0.10
...

5.1 Contrastive route

假设我们跑两次:

Positive condition

看到 retrieved context:

z+z^+

Negative condition

不提供 context:

zz^-

例如:

1
2
3
4
5
                with context      without context

1889 5.1 3.1
1887 3.5 3.4
1900 3.0 3.3

1889 最大的特点不是只在 z+z^+ 里高。

而是:

z1889+z1889z^+_{1889} - z^-_{1889}

也非常高。

因此 contrastive decoding 会进一步 boost 它。

这就是 CAD 一类工作的 intuition:通过比较 with-context 和 without-context 的分布,突出真正由 context 引起的 evidence。论文把 CAD、ACD 等放在 token-wise contrastive decoding 下。


5.2 Guided route

现在不再跑 negative condition。

LM 给出三个 candidate:

1
2
3
A: 1889
B: 1887
C: 1900

增加一个 factuality verifier:

1
2
3
4
5
Verifier:

1889 0.95
1887 0.31
1900 0.12

最终 decision:

LM score+λVerifier score\text{LM score} + \lambda \text{Verifier score}

因此:

token probability 不再是唯一 objective。

Guidance 可以来自:

  • classifier;
  • reward model;
  • CLIP;
  • verifier;
  • static analyzer;
  • logical constraints;
  • tree-search value function。

论文因此把 Guided Decoding 分成 classifier-guided 和 heuristic-guided。


5.3 Parallel route

传统 AR decoding:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Forward 1:
It

Forward 2:
It was

Forward 3:
It was completed

Forward 4:
It was completed in

Forward 5:
It was completed in 1889

如果 target model 很大,每个 token 都需要 sequential forward,latency 很高。

Speculative decoding:

Draft

cheap drafter 一次先提出:

1
It / was / completed / in / 1889

Verify

target LLM 在一次 parallel computation 中检查这些 speculative tokens。

比如:

1
2
3
4
5
It        ✓
was ✓
completed ✓
in ✓
1889 ✓

一次接受多个 token。

如果:

1
2
3
It        ✓
was ✓
built ✗

那么从错误位置开始 rollback/resample。

论文明确描述 speculative decoding 为:

先 draft multiple future tokens,再利用 target LLM parallel verify,并只接受满足 verification criterion 的 tokens。


§6 — 核心数学推导

6.1 Autoregressive generation

论文从经典 LM decomposition 出发:

P(w1:TW0)=t=1TP(wtw1:t1,W0)P \left( w_{1:T} \mid W_0 \right) = \prod_{t=1}^{T} P \left( w_t \mid w_{1:t-1},W_0 \right)

其中:

  • W0W_0:initial context;
  • wtw_t:第 tt 个生成 token;
  • TT:最终 sequence length。

因此 decoding 最基础的问题就是:

给定当前 prefix w<tw_{<t},怎样从 next-token distribution 中选择 wtw_t


6.2 Contrastive Decoding

论文的统一定义:

P(Wtw<t)=softmax(z++α(z+z))P \left( W_t \mid w_{<t} \right) = \operatorname{softmax} \left( z^+ + \alpha \left( z^+ - z^- \right) \right)

其中:

  • z+z^+:positive / expert logits;
  • zz^-:negative / amateur logits;
  • α\alpha:contrast strength。

展开:

z=z++α(z+z)z' = z^+ + \alpha \left( z^+ - z^- \right)

得到:

z=(1+α)z+αzz' = \left( 1+\alpha \right) z^+ - \alpha z^-

因此它本质不是:

直接用 stronger model。

而是:

寻找 positive signal 相对于 negative signal 最突出的 token。

假设:

1
2
3
4
5
          positive       negative        difference

w0 0.30 0.60 -0.30
w1 0.40 0.35 0.05
w2 0.50 0.20 0.30

那么 w2w_2 会被 boost。

这也是 contrastive decoding 最脆弱的地方:

zz^- 到底是不是合理的 negative?

如果 negative construction 错了,那么 subtraction direction 也会错。论文把 token-wise contrast 和 layer-wise contrast 都归入这个框架。


6.3 Guided Decoding

论文定义:

P(wtw<t)G(P(wtw<t),C)P' \left( w_t \mid w_{<t} \right) \propto \mathcal G \left( P \left( w_t\mid w_{<t} \right), C \right)

其中:

  • G\mathcal G:guidance function;
  • CC:control condition。

这个公式必须注意:

它更像 conceptual abstraction,并不是说所有 guided decoding 实际都采用相同数学形式。

不同论文里的 G\mathcal G 可以是:

classifier score\text{classifier score}

reward\text{reward}

CLIP similarity\text{CLIP similarity}

verification probability\text{verification probability}

MCTS value\text{MCTS value}

logical constraint\text{logical constraint}

所以 Guided Decoding 的真正变化是:

maxlogpθ(y)\max \log p_\theta(y)

变成类似:

max[logpθ(y)+λU(y)]\max \left[ \log p_\theta(y) + \lambda U(y) \right]

其中 UU 是 task-specific utility。

后面这个式子是【为解释 intuition 的抽象】,不是论文声称所有 guided algorithm 都严格等价于它。


6.4 Parallel Decoding

这里没有一个像 contrastive decoding 那样统一的 objective。

核心瓶颈来自:

wtP(wtw<t)w_t \sim P \left( w_t \mid w_{<t} \right)

所以:

wt+1w_{t+1}

必须等 wtw_t 产生后才能计算。

顺序 dependency:

w1w2w3wTw_1 \rightarrow w_2 \rightarrow w_3 \rightarrow \cdots \rightarrow w_T

意味着 latency 至少有非常强的 sequence-length dependence。

Speculative decoding 的思想是:

cheap draftw^t:t+k\text{cheap draft} \rightarrow \hat w_{t:t+k}

然后:

target modelparallel verification\text{target model} \rightarrow \text{parallel verification}

如果一次平均接受 AA 个 speculative tokens,那么 target-model sequential steps 理想上可以明显减少。

但真实 speedup 还取决于:

  • draft cost;
  • verification cost;
  • acceptance rate;
  • memory bandwidth;
  • hardware utilization;
  • batch size。

所以:

“能一次验证多个 token”不自动意味着 end-to-end speedup。


§7 — 实验设计与结论

这篇论文没有自己的 benchmark

这是阅读时必须首先明确的。

它没有:

  • 自己训练 model;
  • 自己统一跑 DExperts / DoLa / RAD / Medusa;
  • standardized latency benchmark;
  • controlled ablation;
  • multi-seed experiment。

所以论文的 evidence 类型是:

literature synthesis\boxed{ \text{literature synthesis} }

而不是:

new empirical evidence\boxed{ \text{new empirical evidence} }


Table 1:Contrastive Decoding 路线

你给出的 Table 1 很长,我把最有研究脉络意义的内容转成文本。

Year Work 核心作用
2021 DExperts expert / anti-expert 做 detoxification
2022 Contrastive Decoding 正式建立 stronger-vs-weaker distribution contrast
2023 CAD context-aware decoding
2023 SCD speculative contrastive decoding
2023 DoLa contrast different layers
2024 VCD visual contrastive decoding
2024 ROSE reverse-prompt contrast
2024 ACD adaptive contrastive decoding
2024 SCMoE contrast strong/weak experts in MoE
2024 ICD instruction contrast
2024 IBD image-biased decoding
2024 VACoDe visual augmentation contrast
2024 VaLiD visual layer fusion contrast

这条路线最明显的演化不是“公式越来越复杂”,而是:

negative/reference distribution 从哪里来?\text{negative/reference distribution 从哪里来?}

最初:

two models\text{two models}

然后:

same model + different contexts\text{same model + different contexts}

然后:

same model + different layers\text{same model + different layers}

再到:

same LVLM + different image conditions\text{same LVLM + different image conditions}

论文详细讨论了 CAD、VCD、ICD、VACoDe、DoLa、SCMoE、VaLiD 等这种变化。


Table 1:Guided Decoding 路线

Year Work Guidance 来源
2020 PPLM attribute model
2020 NeuroLogic constrained decoding
2021 FUDGE future discriminator
2022 CriticControl critic
2022 NaturalProver stepwise constraints
2023 MIL-Decoding token toxicity classifier
2023 RAD reward model
2023 PPO-MCTS value-guided tree search
2023 PG-TD planning guidance
2023 self-evaluation guided search LLM self-evaluation
2024 DBS reasoning verifier
2024 TS-LLM AlphaZero-like tree search
2024 MGD static-analysis monitor
2024 SafeDecoding safety expert
2024 DOMINO structured constraints
2024 CGD CLIP
2025 DFD dynamic layer focus
2025 AttnReal attention reallocation

这条研究线真正演进的是:

Classifier\text{Classifier}

\downarrow

Reward Model\text{Reward Model}

\downarrow

Verifier\text{Verifier}

\downarrow

Planning / Tree Search\text{Planning / Tree Search}

\downarrow

Multimodal Guidance\text{Multimodal Guidance}

所以 Guided Decoding 的核心研究问题其实是:

是否存在一个 signal,比 raw next-token likelihood 更接近最终任务 utility?

论文具体举了 PPLM、MIL-Decoding、CriticControl、RAD、Deductive Beam Search、SafeDecoding、MGD、DOMINO 和 CLIP-guided decoding。


Table 1:Parallel Decoding 路线

Year Work 核心 idea
2018 Blockwise blockwise parallel decoding
2021 SAD shallow aggressive decoding
2023 SpecDec speculative seq2seq decoding
2023 Self-Speculative 同一 model 自己 draft
2023 Speculative Sampling draft + verify
2023 DistillSpec distill 更好的 drafter
2023 SpecInfer tree-based verification
2023 Online Speculative online adaptation
2024 Speculative RAG speculation 用于 RAG
2024 Lookahead lookahead decoding
2024 Medusa multiple decoding heads
2024 EAGLE extrapolative speculative sampling
2024 Lantern relaxed token acceptance
2024 SJD speculative Jacobi decoding
2024 SPD superposed decoding
2024 Swift on-the-fly self-speculation
2025 Seesaw dynamic model resharding

所以 parallel decoding 的研究脉络可以进一步压缩为:

How to draft?\text{How to draft?}

How to verify?\text{How to verify?}

How to increase acceptance rate?\text{How to increase acceptance rate?}

Can we eliminate a separate draft model?\text{Can we eliminate a separate draft model?}

How to co-design algorithm + system?\text{How to co-design algorithm + system?}


论文实际证明了什么?

【论文明确声称】

已有 literature 已经把 advanced decoding 用于:

  • hallucination mitigation;
  • safety;
  • visual grounding;
  • reasoning;
  • robustness to noisy context;
  • generation acceleration。

【可以合理接受】

modern decoding 确实已经远超:

greedy / beam / top-p\text{greedy / beam / top-p}

这个传统定义。

所以需要新的 taxonomy 是合理的。


论文没有充分证明什么?

作者在 introduction 里把 inference-time decoding 描述成:

  • efficient;
  • scalable;
  • model-agnostic;

甚至进一步讨论 universal decoding。

但作为 survey,它没有统一实验来证明:

advanced decoding>vanilla decoding\text{advanced decoding} > \text{vanilla decoding}

在统一:

  • model;
  • dataset;
  • quality target;
  • compute budget;

下普遍成立。

因为 guided decoding 可能需要:

  • extra classifier;
  • verifier;
  • reward model;
  • tree search;
  • multiple candidate evaluations。

Contrastive decoding 可能需要:

  • 第二个 model;
  • 多次 forward;
  • multiple contexts;
  • multiple layer projections。

Parallel decoding 可能需要:

  • drafter;
  • extra heads;
  • verification;
  • rollback。

因此:

inference-timeautomatically cheap\boxed{ \text{inference-time} \neq \text{automatically cheap} }

这是我认为需要主动修正作者 framing 的地方。


§8 — Take-aways

Take-away 1:现代 decoding 已经不是“怎么抽 token”

传统:

pθsamplingp_\theta \rightarrow \text{sampling}

现代:

pθ+counterfactual+reward+verifier+search+system optimizationp_\theta + \text{counterfactual} + \text{reward} + \text{verifier} + \text{search} + \text{system optimization}

controlled generation\rightarrow \text{controlled generation}


Take-away 2:三类方法可以这样记

Paradigm 改的到底是什么? 核心问题 代表方法
Contrastive probability direction 什么是 positive / negative? DExperts, CAD, DoLa, VCD
Guided optimization objective 谁评价 candidate? PPLM, RAD, DBS, PPO-MCTS
Parallel execution schedule 如何一次处理更多 future tokens? SpecDec, Medusa, EAGLE

最简记忆:

Contrast=找方向\boxed{ \text{Contrast} = \text{找方向} }

Guide=定目标\boxed{ \text{Guide} = \text{定目标} }

Parallel=省时间\boxed{ \text{Parallel} = \text{省时间} }


Take-away 3:Contrastive Decoding 的关键不是 subtraction

真正困难的是:

How do you construct z?\boxed{ \text{How do you construct } z^-? }

一个 good negative/reference distribution 才是方法能成功的关键。


而是:

Does the guide actually represent final utility?\boxed{ \text{Does the guide actually represent final utility?} }

一个错误 verifier 会系统性把 generation 引向错误方向。


Take-away 5:Parallel Decoding 的核心 metric 是 acceptance

不是“draft 一次几个 token”就够了。

真正重要的是:

draft quality\text{draft quality}

acceptance rate\rightarrow \text{acceptance rate}

target-model calls saved\rightarrow \text{target-model calls saved}

actual wall-clock speedup\rightarrow \text{actual wall-clock speedup}


§9 — 最脆弱的假设

如果只能选一个,我认为全文最值得攻击的 assumption 是:

存在一种相对 general、cheap、model-agnostic 的 inference-time decoding control layer。

这是这篇 survey 的宏观 narrative,也是它最值得怀疑的部分。

为什么?

因为三类方法其实都依赖 auxiliary assumption。

Contrastive

必须满足:

z+ 比 z 更接近 desired behaviorz^+ \text{ 比 } z^- \text{ 更接近 desired behavior}

但这个 ordering 很可能只在平均意义成立。


Guided

必须满足:

G(y)true utility(y)\mathcal G(y) \approx \text{true utility}(y)

如果 verifier/reward model 有 reward hacking:

G(y)\mathcal G(y) \uparrow

却:

actual quality(y)\text{actual quality}(y) \downarrow

那么 guided decoding 会主动放大错误。


Parallel

必须满足:

qdraftptargetq_{\text{draft}} \approx p_{\text{target}}

否则 acceptance rate 低:

AA \downarrow

最终:

draft overhead+verification overhead>saved AR compute\text{draft overhead} + \text{verification overhead} > \text{saved AR compute}

反而更慢。

所以现代 decoding 的真正 hidden variable 很可能不是:

“用了哪一种 algorithm?”

而是:

auxiliary signal 与当前 sample 的匹配程度\boxed{ \text{auxiliary signal 与当前 sample 的匹配程度} }

论文没有统一实验验证这一点。


§10 — 最小复现实验

因为这是一篇 survey,我不会尝试“复现论文”。

我会用一周做一个能够直接验证它 central framing 的实验。

Model

一个可本地部署的 7B–8B instruct LLM,例如任一成熟 open-weight model。

固定所有 model weights。


四个 decoding 条件

Baseline

Top-p / Greedy\text{Top-p / Greedy}

Contrastive

实现一个最简单的:

context vs no-context contrast\text{context vs no-context contrast}

Guided

增加一个 verifier/reward scorer。

Parallel

使用一个现成 speculative decoding implementation。


三类任务

Factual QA

测:

accuracy\text{accuracy}

Reasoning

测:

exact match\text{exact match}

或:

pass@1\text{pass@1}

Open generation

测:

  • output quality;
  • tokens/s;
  • latency。

统一记录

每个 decoding 方法都必须记录:

task quality\text{task quality}

time-to-first-token\text{time-to-first-token}

tokens/sec\text{tokens/sec}

GPU memory\text{GPU memory}

target forward passes/token\text{target forward passes/token}

total auxiliary-model FLOPs\text{total auxiliary-model FLOPs}

否则拿“accuracy 提高”说 decoding 更 efficient 是没有意义的。


最关键:人为制造 mismatch

Contrastive

逐步让 negative/reference model 从:

1
2
3
4
5
明显更弱

相近

某些 domain 反而更强

Guided

人为给 verifier 加:

5%5\%

10%10\%

20%20\%

miscalibration/noise。

Parallel

逐渐增加:

DKL(qdraftptarget)D_{KL} \left( q_{\text{draft}} \Vert p_{\text{target}} \right)

观察 acceptance rate。


支持论文 claim 的结果

如果在相当宽的 mismatch 范围里:

quality gainextra compute>0\frac{\text{quality gain}} {\text{extra compute}} >0

且结果稳定,那么“decoding 是一种 practical general inference-time control layer”的 framing 得到支持。


反驳论文 claim 的结果

如果非常轻微的 mismatch 就导致:

quality\text{quality} \downarrow

同时:

latency\text{latency} \uparrow

那么真正的结论应该改成:

advanced decoding 是依赖 carefully matched auxiliary signal 的 conditional technique,而不是 universal inference-time control。


§11 — 最强反例设计

我会专门攻击 Contrastive Decoding 背后的一个非常常见假设:

larger model=expert\text{larger model} = \text{expert}

smaller model=amateur\text{smaller model} = \text{amateur}

或者更一般:

z+ 永远比 z 更好z^+ \text{ 永远比 } z^- \text{ 更好}


构造一个 expert-ordering reversal

设:

ML=large modelM_L = \text{large model}

MS=small modelM_S = \text{small model}

在平均 benchmark 上:

ML>MSM_L>M_S

所以按照 contrastive intuition:

z+=zLz^+ = z_L

z=zSz^- = z_S

然后我们寻找一个特定 slice:

  • niche factual knowledge;
  • adversarial context;
  • sycophancy;
  • calibration;
  • recent facts;
  • domain-specific terminology。

使得:

MS>MLM_S>M_L

在这个 slice 上,假设正确 token 是 ww^*

zS(w)>zL(w)z_S(w^*) > z_L(w^*)

但 contrastive decoding 使用:

z=zL+α(zLzS)z' = z_L + \alpha \left( z_L-z_S \right)

由于:

zL(w)zS(w)<0z_L(w^*)-z_S(w^*)<0

它反而:

抑制正确 token\boxed{ \text{抑制正确 token} }

与此同时,如果 large model 独有的错误 token wew_e 满足:

zL(we)>zS(we)z_L(w_e)>z_S(w_e)

contrastive term 会进一步:

放大错误 token\boxed{ \text{放大错误 token} }

而且:

α\alpha \uparrow

时错误会更严重。


这个反例真正打击的是什么?

不是证明“Contrastive Decoding 完全没用”。

它攻击的是更深的解释:

global model quality ordering 可以作为 local token-level competence ordering。

真正需要知道的其实是:

P(Mi competentx,w<t)P \left( M_i\text{ competent} \mid x,w_{<t} \right)

也就是说:

当前 context、当前 token 上谁真的是 expert?

这会直接导出下一节 follow-up。


§12 — Follow-up Research Idea

Self-Diagnosing Budgeted Decoding

我觉得最值得做的方向不是:

再提出第 101 个新的 contrastive formula。

而是直接质疑固定 decoding policy 本身。

今天大多数方法在 deployment 时默认:

1
2
3
4
5
所有 query

固定一种 decoding

所有 token 都继续用它

但现实很可能是:

  • 某些 token vanilla decoding 已经非常 confident;
  • 某些 token 需要 contrastive correction;
  • 某些 reasoning step 需要 verifier;
  • 某些 easy continuation 最适合 speculative decoding;
  • 某些 uncertain part 应该投入更多 search compute。

所以真正的问题应该变成:

这个 sample / token 现在值不值得花额外 inference compute?应该花在哪种 decoding 上?


State

每一步构造:

st={Ht,Dt,Vt,At,Bt}s_t = \{ H_t, D_t, V_t, A_t, B_t \}

其中:

Ht=next-token entropyH_t = \text{next-token entropy}

Dt=layer/model/context disagreementD_t = \text{layer/model/context disagreement}

Vt=verifier uncertaintyV_t = \text{verifier uncertainty}

At=predicted speculative acceptanceA_t = \text{predicted speculative acceptance}

Bt=remaining compute budgetB_t = \text{remaining compute budget}


Action

controller:

π(atst)\pi(a_t\mid s_t)

选择:

at{Vanilla,Contrast,Guide,Search,Parallel}a_t \in \{ \text{Vanilla}, \text{Contrast}, \text{Guide}, \text{Search}, \text{Parallel} \}


Objective

不是 maximum accuracy,而是:

maxQ(y)λC(y)βR(y)\max \quad Q(y) - \lambda C(y) - \beta R(y)

其中:

  • QQ:quality;
  • CC:compute / latency;
  • RR:risk / uncertainty。

可以借鉴哪些相邻领域?

这个问题实际上更接近:

  • contextual bandits;
  • selective prediction;
  • optimal stopping;
  • mixture-of-experts routing;
  • adaptive computation;
  • budgeted inference。

而不是纯 decoding heuristic。


和已有工作的根本区别

不是:

Contrastive+Guided+Speculative\text{Contrastive} + \text{Guided} + \text{Speculative}

三个 module 简单串起来。

而是:

learn when each decoding mechanism is actually needed\boxed{ \text{learn when each decoding mechanism is actually needed} }

也就是从:

decoding algorithm

变成:

decoding policy


第一个实验

甚至不需要 RL。

先提取四类 feature:

entropy\text{entropy}

layer disagreement\text{layer disagreement}

verifier margin\text{verifier margin}

draft confidence\text{draft confidence}

然后针对每个 sample offline 跑:

1
2
3
4
vanilla
contrastive
guided
parallel

得到每种 strategy 的:

qualityλFLOPs\text{quality} - \lambda\text{FLOPs}

把最佳方法作为 label。

训练一个非常小的 router:

f(s)af(s) \rightarrow a

最后比较:

Fixed strategy

永远 Contrastive / Guided / Parallel。

Oracle routing

知道每个 sample 最好的方法。

Learned routing

预测应该使用的方法。

如果 learned router 能:

qualityoracle quality\text{quality} \approx \text{oracle quality}

同时:

computealways-use-expensive-decoding\text{compute} \ll \text{always-use-expensive-decoding}

那么可以支持一个比本文更进一步的结论:

下一阶段 inference-time decoding 的关键不一定是发明新的 decoder,而是动态决定何时、在哪里、以多少预算进行 decoding intervention。

这实际上直接回应论文 Discussion 提出的 dynamic and universal decoding methods 问题。论文还专门把 interpreting decoding、combining paradigms、diversifying objectives 和 adversarial robustness 列为开放方向。


最后怎么评价这篇论文

我会把它定位成一篇**“领域地图型 survey”**,而不是一篇告诉你哪个 decoder 最好的 benchmark paper。

它最有价值的三件东西分别是:

Figure 1:告诉你整个领域“有哪些分支”。

Figure 3

Figure 3

告诉你三类 paradigm 在机制上到底哪里不同。

Table 1:告诉你每一条路线是怎样从早期方法一路演化到 modern LLM/LVLM decoding 的。

如果只记一句话,我建议记:

现代 decoding 不只是决定下一个 token 怎么采样, 而是在 inference time 决定模型朝哪个方向走、 优化什么目标、以及花多少计算。\boxed{ \text{现代 decoding 不只是决定下一个 token 怎么采样, 而是在 inference time 决定模型朝哪个方向走、 优化什么目标、以及花多少计算。} }

但同样要保留一个关键批判:

training-freecost-freeuniversally robust\boxed{ \text{training-free} \neq \text{cost-free} \neq \text{universally robust} }

本文已经很好地证明“advanced decoding 是一个正在迅速形成的研究领域”;它并没有通过统一实验证明这三类 advanced decoding 在统一 quality/compute budget 下普遍优于 simple decoding。这是读完以后最应该保留的 evidence boundary。

本文最后更新于 天前,文中所描述的信息可能已发生改变
Perfect Night
LE SSERAFIM