文本自我加速:会话局部 drafting 中的近因性与约束
Text Speeding Itself Up: Recency and Restraint in Session-Local Drafting
AI总结:
该研究提出会话局部 drafter,对比近因加权等会话记忆与提示词查找解码,发现近因性提升速度,弃权 drafter 可节能,94% 输出与贪心解码一致,长度下限为双领域节能的唯一 drafter。
摘要:
推测解码允许廉价的 draft 模型提出 token,由大型语言模型在单次前向传播中验证。当验证器保留 KV 缓存时,验证成本低廉,drafting 几乎无需额外开销。会话局部 drafter 从提示词和已生成文本中进行预测,无需训练即可满足这一要求。我们将近因加权、回退、置信门控的会话记忆,与参考形式的提示词查找解码(从最早的先前匹配中复制)及变体(从最近的匹配中复制)进行比较,全程采用每提示词的配对自助抽样区间。使用 Mistral-7B 验证器,在通用、医疗和法律文本上,近因性是速度的关键:在 500 token 生成中,最近匹配查找比最早匹配查找的加速比最高提升 0.09;而会话记忆的加权与回退在 drafting 成本为 30 至 40 倍时,未带来可测量的额外增益。能耗则呈现不同结果:在医疗和法律文本中,无选择性 drafter 比普通解码快 14%,但每 token 能耗相同;而在弱证据时弃权(不执行)的 drafter,每 100 token 可节省 3 至 4 焦耳;提示词查找的 3 token 最小匹配长度与置信门控会话记忆匹配。94% 的生成输出与贪心解码的 token 完全一致,所有分歧均为数值近似相等。在重复惩罚下,长生成的加速比从 1.4-1.7 倍缩小至 1.1-1.2 倍,但近因性仍有帮助,且长度下限是唯一在两个领域均节能的 drafter。
英文摘要:
Speculative decoding lets a cheap draft model propose tokens that a large language model verifies in a single forward pass. When the verifier keeps a KV cache, verification is cheap and drafting must be nearly free. Session-local drafters, which predict from the prompt and the text generated so far, meet that bar without training. We compare a recency-weighted, backing-off, confidence-gated session memory against prompt lookup decoding in its reference form, which copies from the earliest earlier match, and in a variant that copies from the most recent one, with paired per-prompt bootstrap intervals throughout. On general, medical, and legal text with a Mistral-7B verifier, recency accounts for the speed: most-recent lookup gains up to 0.09 in speedup over earliest-match lookup on 500-token generations, and session memory's weighting and backoff add nothing measurable on top, at 30 to 40 times the drafting cost. Energy tells a different story. On medical and legal text, unselective drafters are 14% faster than plain decoding yet use as much energy per token, while drafters that abstain on weak evidence save 3 to 4 joules per 100 tokens; a three-token minimum match length on prompt lookup matches the confidence-gated session memory. Outputs are token-identical to greedy decoding in 94% of generations, with every divergence at a numerical near-tie. Under a repetition penalty, long-generation speedups shrink from 1.4-1.7x to 1.1-1.2x, but recency still helps and the length floor is the only drafter that saves energy in both domains.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。