arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.10810cs.CL
收藏

文本生成中的局部与全局解码

Local and Global Decoding in Text Generation

University of Luxembourg(卢森堡大学);ETH Zürich(苏黎世联邦理工学院)

Daniel Gareev, Thomas Hofmann, Ezhilmathi Krishnasamy, Tiago Pimentel

AI总结:

本文通过引入全局归一化解码方法和独立Metropolis-Hastings采样算法,研究了局部归一化对文本生成分布的扭曲影响,实验发现局部解码的分布扭曲反而是其优于全局解码的重要特征。

摘要:

文本生成是对话系统等应用的关键组件,依赖于从语言模型分布中采样字符串的解码算法。传统方法(如top-$k$和top-$π$)对模型输出分布应用局部归一化,这会扭曲分布。本文通过引入这些解码方法的全局归一化版本来研究这种扭曲的影响。此外,我们提出了一种独立的Metropolis-Hastings算法,用于近似从全局归一化分布中采样,而无需显式计算它们。我们的实证分析使用Pythia语言模型,比较了局部和全局归一化在两种解码算法(top-$k$和top-$π$)及各种超参数下的性能。结果表明,在大多数配置中,全局解码的表现劣于相同算法的局部解码版本——尽管前者保持了分布的完整性。我们的结果指出,扭曲是局部解码算法的一个重要特征。

英文摘要:

Text generation, a key component in applications such as dialogue systems, relies on decoding algorithms that sample strings from a language model distribution. Traditional methods, such as top-$k$ and top-$π$, apply local normalisation to the model's output distribution, which can distort it. In this paper, we investigate the effect of this distortion by introducing globally-normalised versions of these decoding methods. Additionally, we propose an independent Metropolis-Hastings algorithm to approximate sampling from globally-normalised distributions without explicitly computing them. Our empirical analysis compares the performance of local and global normalisation across two decoding algorithms (top-$k$ and top-$π$) with various hyperparameters, using Pythia language models. Results show that, in most configurations, global decoding performs worse than the local decoding version of the same algorithms -- despite preserving the distribution's integrity. Our results suggest that distortion is an important feature of local decoding algorithms.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑