投机解码Speculative Decoding
Speculative Decoding
用小模型先猜几个词,大模型一次验证,生成更快。Guess several tokens cheaply, then have the big model verify them in one pass.
Leviathan 等人的定义:一种并行计算多个 token 的采样算法。前提是不改变输出。
原论文在 T5-XXL 上报告 2–3 倍加速,且输出完全一致。
vLLM 已内置 n-gram、EAGLE 等多种投机解码实现。
Leviathan et al.'s definition: an algorithm to sample from autoregressive models faster, computing several tokens in parallel with no changes to the outputs.
The paper reports 2x-3x acceleration on T5-XXL with identical outputs.
vLLM ships n-gram, EAGLE and other speculative decoding implementations.
本地跑大模型时,这是少数「白拿」的提速手段之一。For local inference this is one of the few speedups you get for free.
推测解码
从业者深版:跑起来深水专题(AI 模型站)Practitioner deep-dive: serving deep dive guide (AI Models site) ↗
回到名词地图看第5段的其他 45 个词 →Back to the map: the other 45 terms in stage 5 →
别停在定义:去任务手册看按什么顺序做、验收什么;或者按你手头的任务,筛 3 个工具候选。Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.
任务手册 →Task handbooks → · 按任务筛 3 个候选 →Filter three candidates →