Skip to main content
QUICK REVIEW

[论文解读] Natural Language Generation with Neural Variational Models

Hareesh Bahuleyan|arXiv (Cornell University)|Aug 27, 2018
Topic Modeling参考文献 81被引用 9
一句话总结

本文提出一种新型变分注意力机制的变分自编码器,通过将注意力上下文向量建模为随机变量,实现有意义的潜在空间,从而提升神经文本生成性能。实验表明,该方法生成的句子在多样性与质量上均优于确定性注意力模型,潜在空间解耦性更好,且潜在空间被更充分地利用,避免了其被绕过。

ABSTRACT

In this thesis, we explore the use of deep neural networks for generation of natural language. Specifically, we implement two sequence-to-sequence neural variational models - variational autoencoders (VAE) and variational encoder-decoders (VED). VAEs for text generation are difficult to train due to issues associated with the Kullback-Leibler (KL) divergence term of the loss function vanishing to zero. We successfully train VAEs by implementing optimization heuristics such as KL weight annealing and word dropout. We also demonstrate the effectiveness of this continuous latent space through experiments such as random sampling, linear interpolation and sampling from the neighborhood of the input. We argue that if VAEs are not designed appropriately, it may lead to bypassing connections which results in the latent space being ignored during training. We show experimentally with the example of decoder hidden state initialization that such bypassing connections degrade the VAE into a deterministic model, thereby reducing the diversity of generated sentences. We discover that the traditional attention mechanism used in sequence-to-sequence VED models serves as a bypassing connection, thereby deteriorating the model's latent space. In order to circumvent this issue, we propose the variational attention mechanism where the attention context vector is modeled as a random variable that can be sampled from a distribution. We show empirically using automatic evaluation metrics, namely entropy and distinct measures, that our variational attention model generates more diverse output sentences than the deterministic attention model. A qualitative analysis with human evaluation study proves that our model simultaneously produces sentences that are of high quality and equally fluent as the ones generated by the deterministic attention counterpart.

研究动机与目标

  • 为解决训练变分自编码器(VAE)进行文本生成时,KL散度项常导致潜在空间被忽略的问题。
  • 探究序列到序列模型中传统注意力机制如何作为旁路连接,降低潜在空间的质量。
  • 提出一种变分注意力机制,将上下文向量建模为随机变量,以提升潜在空间的利用效率。
  • 通过自动评估与人工评估指标,评估所提方法对句子多样性与流畅性的影响。
  • 开发改进的训练启发式方法,如自适应KL退火与词 dropout,以稳定VAE训练。

提出的方法

  • 提出一种变分编码器-解码器(VED)模型,其中句子级潜在码 z 和解码器上下文向量 cj 均被建模为具有高斯后验分布的随机变量。
  • 使用重参数化技巧,实现VAE的可微训练,支持通过潜在变量进行反向传播。
  • 引入变分注意力机制,其中上下文向量 cj 从学习得到的高斯分布 qϕ(cj|x) 中采样,其均值 μcj = c_j^det(确定性注意力),方差 σcj 通过神经网络学习得到。
  • 采用混合先验分布对 cj 建模:可为标准正态分布 N(0, I),或基于数据的先验分布 N(μ_src, I),其中 μ_src 为源端隐藏状态的均值。
  • 在整体损失函数中应用KL代价退火,逐步增加KL正则化项的权重,以稳定训练并防止后验坍缩。
  • 在训练过程中引入词 dropout,进一步正则化模型,提升潜在空间的泛化能力。

实验结果

研究问题

  • RQ1与确定性注意力相比,所提出的变分注意力机制在生成文本的质量与多样性方面有何改进?
  • RQ2序列到序列模型中的传统注意力机制在多大程度上作为旁路连接,削弱了潜在空间的作用?
  • RQ3改进的训练启发式方法(如KL退火与词 dropout)是否能有效缓解基于VAE的文本生成中的后验坍缩问题?
  • RQ4所学习的潜在空间在支持有意义的生成任务(如随机采样、线性插值与邻域采样)方面表现如何?
  • RQ5将上下文向量建模为随机变量是否能带来更解耦且更有意义的潜在空间?

主要发现

  • 与确定性注意力基线相比,所提出的变分注意力模型在句法多样性上表现更优,其 distinct-1 与 distinct-2 分数显著更高。
  • 自动评估显示,变分模型生成的句子具有更高的熵值,表明其词汇多样性更强。
  • 人工评估确认,变分模型生成的句子在流畅性与质量上与确定性模型相当,同时展现出更高的多样性。
  • 实验表明,潜在空间支持有意义的生成:随机采样、线性插值与邻域采样均能生成连贯且语义相关的句子。
  • 该模型通过确保生成过程中潜在空间被主动使用,成功缓解了解码器忽略潜在码的“旁路”现象。
  • 所提出的自适应KL退火调度相比标准退火方法,能更稳定地训练模型,并生成更具意义与解耦性的潜在空间。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。