Skip to main content
QUICK REVIEW

[论文解读] Plug and Play Language Models: A Simple Approach to Controlled Text Generation

Sumanth Dathathri, Andrea Madotto|arXiv (Cornell University)|Dec 4, 2019
Topic Modeling参考文献 51被引用 130
一句话总结

PPLM 将一个预训练语言模型与轻量级属性模型结合起来,在无需再训练的情况下通过潜在空间梯度更新和流畅性保护来引导生成。它支持词袋(BoW)和基于判别器的控制,并在以GPT-2为基础语言模型的主题和情感任务上进行了演示。

ABSTRACT

Large transformer-based language models (LMs) trained on huge text corpora have shown unparalleled generation capabilities. However, controlling attributes of the generated language (e.g. switching topic or sentiment) is difficult without modifying the model architecture or fine-tuning on attribute-specific data and entailing the significant cost of retraining. We propose a simple alternative: the Plug and Play Language Model (PPLM) for controllable language generation, which combines a pretrained LM with one or more simple attribute classifiers that guide text generation without any further training of the LM. In the canonical scenario we present, the attribute models are simple classifiers consisting of a user-specified bag of words or a single learned layer with 100,000 times fewer parameters than the LM. Sampling entails a forward and backward pass in which gradients from the attribute model push the LM's hidden activations and thus guide the generation. Model samples demonstrate control over a range of topics and sentiment styles, and extensive automated and human annotated evaluations show attribute alignment and fluency. PPLMs are flexible in that any combination of differentiable attribute models may be used to steer text generation, which will allow for diverse and creative applications beyond the examples given in this paper.

研究动机与目标

  • 在不修改基础语言模型参数或在属性特定数据上重新训练的前提下,激发可控文本生成。
  • 提出一个即插即用的框架,将预训练语言模型与简单的属性模型结合。
  • 展示使用 BoW 和基于判别器的属性实现对主题和情感的控制。
  • 通过自动化度量和人工评估来评估属性相关性和流畅性。

提出的方法

  • 使用一个预训练的基准 Transformer 的语言模型(GPT-2 345M)作为无条件模型 p(x)。
  • 附加一个或多个轻量级属性模型 p(a|x),如词袋或简单判别器,以引导生成。
  • 在每个生成步骤,在语言模型潜在空间 H_t 进行梯度更新以最大化 log p(a|x),同时通过 KL 散度和与无条件 LM 的后置归一化融合来保持 log p(x)。
  • 通过归一化梯度步长更新潜在表示 Delta H_t,然后使用更新后的潜在变量对 LM 进行前向传播,以获得修改后的输出分布。
  • 可选地根据前向属性似然对多个样本进行排序,并通过多样性(Dist-1/2/3)进行筛选,以避免重复。
  • 展示与各种属性模型的兼容性,并讨论在推理阶段将多个控制器结合使用的即插即用特性。

实验结果

研究问题

  • RQ1在不重新训练或微调 LM 的情况下,是否可以将预训练 LM 指导向特定属性?
  • RQ2轻量级属性模型(BoW 和判别器)在引导生成到主题和情感方面的效果如何?
  • RQ3属性控制对流畅性和多样性的影响是什么,如何进行保障?
  • RQ4就属性相关性和自然性而言,PPLM 与现有的可控生成方法相比如何?

主要发现

  • PPLM 通过在推理时将 p(x) 与 p(a|x) 结合起来实现可控生成,而无需重新训练 LM。
  • 基于 BoW 的属性模型和基于判别器的属性模型能够在可衡量的属性对齐下引导主题和情感。
  • 潜在空间更新加上 KL 散度流畅性约束产生的文本流畅且属性对齐,在相关性和流畅性方面往往与基线相当甚至更好。
  • 使用基于梯度的潜在操作结合排序相较于重新排序或直接输出权重化基线,在主题和情感控制方面有所提升。
  • 将判别器基的控制用于情感表达时,当结合潜在更新和采样策略可获得显著提升。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

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