arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2007.14966cs.CLcs.ITmath.IT
收藏

Mirostat:一种直接控制复杂度的神经文本解码算法

Mirostat: A Neural Text Decoding Algorithm that Directly Controls Perplexity

University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Salesforce Research(Salesforce研究院)

Sourya Basu, Govardana Sachitanandam Ramachandran, Nitish Shirish Keskar, Lav R. Varshney

摘要:

神经文本解码对于使用语言模型生成高质量文本非常重要。为了生成高质量的文本,流行的解码算法,如top-k、top-p(nucleus)和基于温度的采样,会截断或扭曲语言模型的不可靠的低概率尾部。虽然这些方法在参数调优后生成高质量的文本,但它们是临时的。关于它们对输出统计数据的控制,我们知之甚少,这一点很重要,因为最近的报告显示,文本质量在特定的可能性范围内是最高的。在这里,首先,我们提供了一个理论分析的困惑在top-k,top-p,和温度采样,发现交叉熵行为近似线性的函数p在top-p采样,而它是一个非线性函数k在top-k采样,Zipfian统计。我们使用这种分析来设计一种基于反馈的自适应top-k文本解码算法,称为mirostat,它可以生成具有预定困惑值的文本(任何长度),从而无需任何调整即可生成高质量的文本。实验表明,在top-k和top-p采样中,当k和p值较低时,困惑度随着生成的文本长度而显著下降,这也与文本中的过度重复(无聊陷阱)相关。另一方面,对于k和p的大值,我们发现困惑随着生成的文本长度而增加,这与文本中的不连贯(混淆陷阱)相关。Mirostat避免了这两个陷阱:实验表明,交叉熵与生成的文本中的重复具有近似线性的关系。这种关系几乎与抽样方法无关,但与所用模型略有关系。因此,对于给定的语言模型,对困惑的控制也给出了对重复的控制。对流畅性,连贯性和质量的人类评分员的实验进一步验证了我们的发现。

英文摘要:

Neural text decoding is important for generating high-quality texts using language models. To generate high-quality text, popular decoding algorithms like top-k, top-p (nucleus), and temperature-based sampling truncate or distort the unreliable low probability tail of the language model. Though these methods generate high-quality text after parameter tuning, they are ad hoc. Not much is known about the control they provide over the statistics of the output, which is important since recent reports show text quality is highest for a specific range of likelihoods. Here, first we provide a theoretical analysis of perplexity in top-k, top-p, and temperature sampling, finding that cross-entropy behaves approximately linearly as a function of p in top-p sampling whereas it is a nonlinear function of k in top-k sampling, under Zipfian statistics. We use this analysis to design a feedback-based adaptive top-k text decoding algorithm called mirostat that generates text (of any length) with a predetermined value of perplexity, and thereby high-quality text without any tuning. Experiments show that for low values of k and p in top-k and top-p sampling, perplexity drops significantly with generated text length, which is also correlated with excessive repetitions in the text (the boredom trap). On the other hand, for large values of k and p, we find that perplexity increases with generated text length, which is correlated with incoherence in the text (confusion trap). Mirostat avoids both traps: experiments show that cross-entropy has a near-linear relation with repetition in generated text. This relation is almost independent of the sampling method but slightly dependent on the model used. Hence, for a given language model, control over perplexity also gives control over repetitions. Experiments with human raters for fluency, coherence, and quality further verify our findings.

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

↑