arXiv:2411.01610cs.CL2024-11EMNLP被引 11

通过外推概率曲线改进对比解码,提升生成事实性与准确性。

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

  • 将对比解码视为对超大语言模型的线性外推,揭示其本质机制。
  • 提出APD方法,在不增加计算成本下显著提升生成事实性,优于CD及基线模型。
  • 适合追求高事实性、低错误率的开放文本生成任务,尤其适配中小模型优化。

对比解码(CD)通过使用小型业余语言模型改进大型专家语言模型的下一个词分布。尽管CD已广泛应用于多种模型与领域以增强开放式文本生成,但其为何常有效、何时会失败以及如何改进仍不明确。本文首次从理论上证明,CD可被视作对一个巨大且假设的大型语言模型的下一个词对数进行线性外推。同时指出,这种线性外推可能导致CD无法输出已被业余模型赋予高概率的明显答案。为克服此局限,我们提出一种新的无监督解码方法——渐近概率解码(APD)。APD显式外推不同规模语言模型的概率曲线,推断出无穷大语言模型的渐近概率,且推理开销与CD相当。在FactualityPrompts基准上,使用APD采样的生成结果显著优于CD及其变体,并在Pythia 6.9B和OPT 6.7B上达到当前最优表现。此外,在五个常识问答数据集上,APD通常显著优于CD,效果接近使用更大模型。例如,在CommonsenseQA和LAMBADA上,基于Pythia 6.9B的APD困惑度甚至低于Pythia 12B。

原文摘要 · Abstract (English)

Contrastive decoding (CD) (Li et al., 2023) improves the next-token distribution of a large expert language model (LM) using a small amateur LM. Although CD is applied to various LMs and domains to enhance open-ended text generation, it is still unclear why CD often works well, when it could fail, and how we can make it better. To deepen our understanding of CD, we first theoretically prove that CD could be viewed as linearly extrapolating the next-token logits from a huge and hypothetical LM. We also highlight that the linear extrapolation could make CD unable to output the most obvious answers that have already been assigned high probabilities by the amateur LM. To overcome CD's limitation, we propose a new unsupervised decoding method called $\mathbf{A}$symptotic $\mathbf{P}$robability $\mathbf{D}$ecoding (APD). APD explicitly extrapolates the probability curves from the LMs of different sizes to infer the asymptotic probabilities from an infinitely large LM without inducing more inference costs than CD. In FactualityPrompts, an open-ended text generation benchmark, sampling using APD significantly boosts factuality in comparison to the CD sampling and its variants, and achieves state-of-the-art results for Pythia 6.9B and OPT 6.7B. Furthermore, in five commonsense QA datasets, APD is often significantly better than CD and achieves a similar effect of using a larger LLM. For example, the perplexity of APD on top of Pythia 6.9B is even lower than the perplexity of Pythia 12B in CommonsenseQA and LAMBADA.

解码优化语言模型事实性生成概率外推

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。