[论文解读] Locally Typical Sampling
本文提出局部典型采样(locally typical sampling),一种基于信息论原理的生成解码策略,通过强制每个生成词的信息含量接近其在上下文条件下的期望值,实现对概率语言模型的优化。该方法通过限制采样范围至信息熵接近预期值的词,减少了重复性退化现象,生成的文本在流畅性和人类自然度方面优于核采样(nucleus)或top-k采样。人类评估显示,在文本摘要和故事生成任务中,其生成质量具有竞争力或更优表现。
Today's probabilistic language generators fall short when it comes to producing coherent and fluent text despite the fact that the underlying models perform well under standard metrics, e.g., perplexity. This discrepancy has puzzled the language generation community for the last few years. In this work, we posit that the abstraction of natural language generation as a discrete stochastic process--which allows for an information-theoretic analysis--can provide new insights into the behavior of probabilistic language generators, e.g., why high-probability texts can be dull or repetitive. Humans use language as a means of communicating information, aiming to do so in a simultaneously efficient and error-minimizing manner; in fact, psycholinguistics research suggests humans choose each word in a string with this subconscious goal in mind. We formally define the set of strings that meet this criterion: those for which each word has an information content close to the expected information content, i.e., the conditional entropy of our model. We then propose a simple and efficient procedure for enforcing this criterion when generating from probabilistic models, which we call locally typical sampling. Automatic and human evaluations show that, in comparison to nucleus and top-k sampling, locally typical sampling offers competitive performance (in both abstractive summarization and story generation) in terms of quality while consistently reducing degenerate repetitions.
研究动机与目标
- 解决一个悖论:尽管语言模型的高概率输出具有较强的困惑度得分,但其文本往往显得平淡或重复。
- 探究在词粒度熵中强制执行信息论典型性是否能带来更接近人类语言的文本生成效果。
- 提出并评估一种新的解码策略——局部典型采样,该策略强制每个词的信息含量接近其预期熵值。
- 证明该方法在减少退化重复现象的同时,相较于现有随机解码策略,能保持或提升文本质量。
提出的方法
- 将语言建模重新表述为离散随机过程,将序列建模为索引随机变量 {Yt},而非单一字符串变量。
- 将局部典型性定义为:每个词的信息含量(−log p(yt|y<t))接近其条件熵 H(Yt|y<t),以确保信息效率。
- 提出一种采样过程,将每一步的选择限制在信息含量与预期熵值相差在阈值 τ 以内的词上,并采用动态阈值机制。
- 在解码过程中应用该准则,通过基于模型预测熵值的相对信息含量,对候选词进行过滤。
- 使用类似温度的超参数 τ 控制可接受范围围绕预期熵值的宽度,从而在多样性与典型性之间实现权衡。
- 在过滤后的集合中采用贪心选择策略,以在保持序列整体典型性的同时确保效率。
实验结果
研究问题
- RQ1强制每个词的信息含量接近其预期熵值,是否能提升生成文本的流畅性与连贯性?
- RQ2为何语言模型生成的高概率序列尽管自回归性能出色,却常被认为不自然或不流畅?
- RQ3局部典型采样相较于核采样与top-k采样,在减少退化重复现象的同时,是否能保持或提升文本质量?
- RQ4局部典型采样在多大程度上使生成文本在信息密度与重复性方面更符合人类语言特性?
主要发现
- 局部典型采样将退化重复现象降低至与人类写作文本相当的水平,其 REP 得分与人类基准持平。
- 人类评估显示,在抽象文本摘要与故事生成任务中,局部典型采样生成的文本质量优于核采样或top-k采样。
- 该方法生成的故事更具流畅性与连贯性,重复短语更少,叙事结构更优,优于其他随机解码策略。
- 使用局部典型采样生成的文本,每个词的信息含量更符合人类语言模式,支持了‘人类生成的文本具有接近恒定的信息密度’的假设。
- 该方法在自动指标上保持了竞争力,同时显著提升了文本的定性属性,尤其在减少重复与提升连贯性方面表现突出。
- 该方法效率高,可无缝集成至现有推理流程中,且已在 Hugging Face 的 Transformers 库中提供开源实现。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。