Paper status: completed

Plug and Play Language Models: A Simple Approach to Controlled Text Generation

Published:12/05/2019
Original LinkPDF
Price: 0.100000
Price: 0.100000
Price: 0.100000
3 readers
This analysis is AI-generated and may not be fully accurate. Please refer to the original paper.

TL;DR Summary

The Plug and Play Language Model (PPLM) combines pretrained language models with simple attribute classifiers for controllable text generation without retraining, effectively guiding topic and sentiment while ensuring fluency and attribute alignment.

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.

Mind Map

In-depth Reading

English Analysis

1. Bibliographic Information

1.1. Title

The title of the paper is "Plug and Play Language Models: A Simple Approach to Controlled Text Generation". The central topic is introducing a novel, flexible, and simple method for controlling the attributes (like topic or sentiment) of text generated by large, pre-trained language models without requiring retraining or fine-tuning of the base model itself.

1.2. Authors

The authors of the paper are:

  • Sumanth Dathathri (CMS, Caltech)

  • Andrea Madotto (HKUST)

  • Janice Lan (Uber AI)

  • Jane Hung (Uber AI)

  • Eric Frank (Uber AI)

  • Piero Molino (Uber AI)

  • Jason Yosinski (Uber AI)

  • Rosanne Liu (Uber AI)

    Their affiliations indicate a collaboration between academic institutions (Caltech, HKUST) and an industrial research lab (Uber AI), suggesting a mix of theoretical rigor and practical application focus.

1.3. Journal/Conference

The paper was published on arXiv, a preprint server for scientific papers. Specifically, this version is v4v4 of arXiv:1912.02164. While arXiv itself is not a peer-reviewed journal or conference, papers often appear there before or concurrently with submission to reputable venues. Given the authors' affiliations with leading institutions and research labs, it's likely intended for a top-tier machine learning or natural language processing conference or journal.

1.4. Publication Year

The paper was published on 2019-12-04T18:32:15.000Z. Thus, the publication year is 2019.

1.5. Abstract

Large transformer-based language models (LMs) excel at text generation but struggle with controlling specific attributes (e.g., topic, sentiment) without costly architectural modifications or fine-tuning. This paper introduces the Plug and Play Language Model (PPLM), a simple alternative for controllable text generation. PPLM combines a pre-trained LM (without any retraining) with one or more lightweight attribute classifiers. These classifiers, which can be as simple as a user-specified bag-of-words (BoW) or a single learned layer (with significantly fewer parameters than the LM), guide text generation. The core mechanism involves sampling, where gradients from the attribute model influence the LM's hidden activations through forward and backward passes, thereby steering the generation. The authors demonstrate PPLMs' ability to control various topics and sentiment styles, with evaluations showing strong attribute alignment and fluency. The flexibility of PPLMs, allowing any combination of differentiable attribute models, opens doors for diverse applications.

The original source link is: https://arxiv.org/abs/1912.02164v4. The PDF link is: https://arxiv.org/pdf/1912.02164v4.pdf. This indicates the paper is publicly available as a preprint on arXiv.

2. Executive Summary

2.1. Background & Motivation

The proliferation of large transformer-based language models (LMs) like GPT-2 has led to unprecedented capabilities in generating coherent and natural-sounding text. These models are typically trained on vast amounts of unannotated text data using a simple log-likelihood objective, learning to predict the next word in a sequence.

However, a significant challenge arises when researchers or users want to control specific attributes of the generated text. For instance, guiding an LM to generate text about a particular topic (e.g., "science" or "politics") or with a desired sentiment (e.g., "positive" or "negative") is not straightforward. Existing methods often involve:

  1. Modifying the model architecture: Integrating control signals directly into the LM's structure.

  2. Fine-tuning on attribute-specific data: Retraining a portion or the entirety of the large LM on datasets explicitly labeled with the desired attributes.

    Both approaches are problematic because:

  • They entail significant computational cost, especially for very large LMs, making them inaccessible for many researchers or applications.

  • They often lack flexibility, as each new attribute or combination of attributes may require a new fine-tuning process or architectural change. This limits the "on-the-fly" adaptation needed for diverse applications.

  • The trained control codes are fixed upfront, making it difficult to adapt to new, unforeseen control requirements.

    The paper aims to address this core problem: how to achieve fine-grained, flexible control over the attributes of generated text from a pre-trained LM without incurring the significant cost and inflexibility of retraining or fine-tuning the large base model. The authors draw inspiration from Plug & Play Generative Networks (PPGN) in computer vision, which demonstrated how a base generative model can be steered by a separate discriminator. This provides the innovative idea to "plug" a smaller attribute model into a large LM.

2.2. Main Contributions / Findings

The paper's primary contributions are:

  • Introduction of the Plug and Play Language Model (PPLM): A novel, simple, and highly flexible method for controllable language generation. PPLM combines a pre-trained, unconditional language model (like GPT-2) with one or more separate, simple attribute models, without requiring any modifications or fine-tuning of the large LM's parameters.
  • Gradient-Based Latent Space Steering: PPLM guides text generation by performing gradient-based updates in the LM's hidden activation space (specifically, the history matrix HtH_t). Gradients from the attribute model push the LM's internal representations towards states more likely to produce text with the desired attributes. This ex post facto optimization means no retraining is needed.
  • Simple and Flexible Attribute Models: The attribute models can be remarkably simple, such as:
    • Bag-of-Words (BoW) classifiers: User-specified lists of keywords.
    • Single-layer discriminators: Small neural networks (e.g., ~1K parameters) trained to classify attributes like sentiment. These are orders of magnitude smaller than the base LM.
  • Demonstrated Control over Diverse Attributes: PPLM successfully demonstrates control over a range of attributes, including 7 distinct topics (e.g., Science, Politics) and sentiment (positive/negative).
  • Extensive Evaluation: The method is rigorously evaluated using both automated metrics (perplexity, n-gram diversity Dist-1/2/3, external sentiment classifiers) and human annotations (attribute relevance, fluency), confirming its ability to generate attribute-aligned, fluent text.
  • Competitive Performance without LM Training: PPLM's performance is shown to be on par with or even superior to strong baselines like CTRL (a 1.6B parameter conditional LM) and fine-tuned GPT-2 models, critically achieving this without any training of the base language model.
  • Novel Applications: PPLM is shown to be applicable to:
    • Language detoxification: By guiding generation away from toxic content using the negative gradient of a toxicity classifier.
    • Structurally constrained story writing: Filling in story skeletons while adhering to specific attributes.
  • Flexibility and Combinatorial Control: A key finding is PPLM's inherent flexibility, allowing any combination of differentiable attribute models to steer generation simultaneously, acting as "control knobs" with adjustable strengths. This opens up creative and diverse applications.

3. Prerequisite Knowledge & Related Work

3.1. Foundational Concepts

To fully understand PPLM, a foundational understanding of the following concepts is essential:

  • Language Models (LMs): At their core, LMs are probabilistic models that predict the likelihood of a sequence of words. Given a sequence of tokens X={x0,,xn}X = \{x_0, \ldots, x_n\}, an LM is trained to compute the unconditional probability p(X). This probability is typically broken down using the chain rule of probability: p(X)=i=1np(xix0,,xi1) p ( { \boldsymbol { X } } ) = \prod _ { i = 1 } ^ { n } p ( x _ { i } | x _ { 0 } , \cdot \cdot \cdot , x _ { i - 1 } ) This means the probability of a sequence is the product of the probabilities of each word given all preceding words. During generation, an LM iteratively samples the next word xix_i based on the previously generated words x0,,xi1x_0, \ldots, x_{i-1}.

  • Transformer Architecture: Introduced by Vaswani et al. (2017), the Transformer is a neural network architecture that has become dominant in natural language processing. It revolutionized sequence modeling by replacing recurrent layers (like Recurrent Neural Networks (RNNs)) with attention mechanisms, specifically self-attention. This allows the model to weigh the importance of different words in the input sequence when processing each word, capturing long-range dependencies more effectively and enabling parallel computation. Large LMs like GPT-2 are built upon this architecture.

  • Hidden States / Latent Representations: In neural networks, hidden states or latent representations are the internal numerical representations of the input data as it passes through the network's layers. These are dense vector embeddings that capture abstract features and meanings. In PPLM, manipulating these hidden states (specifically the history matrix HtH_t in a Transformer's recurrent view) is the key to controlling text generation.

  • Gradients and Gradient Ascent/Descent: Gradients are vectors that indicate the direction of the steepest ascent (or descent) of a function. In machine learning, gradient descent is commonly used to minimize a loss function by iteratively adjusting model parameters in the direction opposite to the gradient. Conversely, gradient ascent is used to maximize a function (e.g., log-likelihood) by moving in the direction of the gradient. PPLM uses gradient ascent to increase the log-likelihood of desired attributes.

  • Softmax Function: The softmax function is often used in the output layer of a neural network for multi-class classification. It takes a vector of arbitrary real values (called logits in LMs) and transforms them into a probability distribution over multiple classes (e.g., the vocabulary words). The output values are between 0 and 1 and sum to 1. For a vector z=[z1,,zK]z = [z_1, \ldots, z_K]: Softmax(z)i=ezij=1Kezj \operatorname { S o f t m a x } ( z ) _ i = \frac { e ^ { z _ i } } { \sum _ { j = 1 } ^ { K } e ^ { z _ j } } In an LM, zz would be the logit vector ot+1o_{t+1} and KK would be the size of the vocabulary.

  • Kullback-Leibler (KL) Divergence: Also known as relative entropy, KL divergence is a non-symmetric measure of how one probability distribution PP is different from a second, reference probability distribution QQ. A KL divergence of 0 indicates that the two distributions are identical. Minimizing KL divergence between the modified and unmodified LM output distributions helps PPLM ensure fluency by keeping the generation close to the original LM's natural distribution. DKL(PQ)=iP(i)log(P(i)Q(i)) D_{KL}(P \| Q) = \sum_i P(i) \log \left(\frac{P(i)}{Q(i)}\right) where P(i) and Q(i) are the probabilities of event ii in distributions PP and QQ, respectively.

  • Bag-of-Words (BoW): A simplified representation of text that treats a document as an unordered collection of words, disregarding grammar and even word order, but keeping multiplicity. It's often used for feature extraction in text classification. In PPLM, a BoW can be a simple list of keywords related to a topic.

3.2. Previous Works

The paper frames its contribution by contrasting with existing approaches to controllable text generation:

  • Controlled Generation (Fine-tuning, GANs, Conditional Models):

    • Reinforcement Learning (RL) fine-tuning (Ziegler et al., 2019): This involves training LMs using human feedback or reward signals to guide generation towards desired styles. While effective, it requires significant retraining of the entire model.
    • Generative Adversarial Networks (GANs) (Yu et al., 2017): GANs use a generator-discriminator setup, where the generator learns to produce realistic data, and the discriminator tries to distinguish real from generated data. For controlled generation, the discriminator can be conditioned on attributes. However, training GANs for text is notoriously difficult and unstable.
    • Conditional Generative Models (Kikuchi et al., 2016; Ficler & Goldberg, 2017; Keskar et al., 2019): These models are explicitly trained to generate text conditioned on specific attributes p(xa)p(x|a). CTRL (Keskar et al., 2019) is a prime example, training a very large LM (1.6B parameters) with over 50 different control codes upfront. This approach yields high-quality results but is costly to train and inflexible to new control codes.
    • Differentiation: PPLM differs by not requiring retraining of the large LM and allowing flexible, on-the-fly assembly of the LM with any differentiable attribute controller.
  • Plug & Play Generative Networks (PPGN) (Nguyen et al., 2017): This work in computer vision is a direct inspiration for PPLM. PPGN demonstrated how to combine a pre-trained, unconditional image generator p(x) with a separate discriminator (attribute model) p(ax)p(a|x) to sample from the conditional distribution p(xa)p(ax)p(x)p(x|a) \propto p(a|x)p(x). They achieved this by iteratively modifying the latent representation of the generator using gradients from the discriminator. PPLM adapts this core idea to the domain of language generation.

  • Noisy Channel Modeling (Shannon, 1948; Yu et al., 2016; 2019; Yee et al., 2019; Ng et al., 2019): This theory, originally for communication, suggests that a received signal xx can be decoded from a corrupted signal yy by maximizing p(x)p(yx)p(x)p(y|x). In sequence-to-sequence tasks, this means sampling from a forward model pforward(xy)p_{\text{forward}}(x|y) and then reranking based on p(x)p(yx)p(x)p(y|x). PPLM uses a similar scoring equation for samples, but without a forward proposal model for p(xa)p(x|a), it relies on latent space updates, mirroring PPGN.

  • Weighted Decoding (Holtzman et al., 2018; Ghazvininejad et al., 2017; Baheti et al., 2018): These methods modify the decoding procedure (how the next word is chosen) to incorporate a scoring function related to the desired attribute. This can involve directly weighting the output probabilities or using beam search with a modified scoring function. However, as noted by See et al. (2019), weighted decoding can often sacrifice fluency and coherence. PPLM differentiates by making updates in the continuous latent space rather than directly manipulating discrete output probabilities, allowing for more subtle and coherent guidance.

  • Text Style Transfer (Shen et al., 2017; Hu et al., 2017; Li et al., 2018; Lample et al., 2019): This related field focuses on changing the style of existing text while preserving its content. Approaches include variational auto-encoders (VAEs) for disentangled representations or n-gram replacement. PPLM's focus is on controllable generation from scratch, and it employs an offline discriminator for optimization, which has been suggested to outperform adversarial training for attribute removal (Elazar & Goldberg, 2018).

3.3. Technological Evolution

The field of natural language generation has seen a rapid evolution:

  1. Early Statistical Models: N-gram models (Manning et al., 1999) formed the basis, relying on probabilities of word sequences.

  2. Neural Language Models: Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTMs) (Bengio et al., 2003) improved context understanding but struggled with long-range dependencies and parallelization.

  3. Attention Mechanisms: The advent of attention (Bahdanau et al., 2014) allowed models to selectively focus on parts of the input, greatly enhancing sequence-to-sequence tasks like machine translation.

  4. Transformers: The Transformer architecture (Vaswani et al., 2017), purely based on attention, enabled massive parallelization and state-of-the-art performance, leading to very large pre-trained LMs.

  5. Large Pre-trained LMs: Models like GPT (Radford et al., 2018b), BERT (Devlin et al., 2019), and GPT-2 (Radford et al., 2019) pre-trained on enormous text corpora demonstrated impressive general-purpose language understanding and generation, establishing a new paradigm of transfer learning in NLP.

    This paper's work (PPLM) fits into the post-GPT-2 era, where the challenge shifted from generating coherent text to generating coherent text with specific controls. While large LMs excel at the former, they lack inherent mechanisms for the latter without expensive retraining. PPLM offers an elegant solution that leverages the power of these pre-trained models while adding a flexible control layer, without altering their core parameters.

3.4. Differentiation Analysis

Compared to the main methods in related work, PPLM offers several core differentiations and innovations:

  • No Base LM Retraining/Fine-tuning: This is PPLM's most significant advantage. Unlike CTRL (which trains a 1.6B parameter model with control codes from scratch) or GPT2-FT-RL (which fine-tunes GPT-2 using reinforcement learning), PPLM leaves the large, pre-trained language model completely untouched. This drastically reduces computational cost, time, and resource requirements, making control accessible.

  • Flexibility and Plug-and-Play Nature: PPLM allows for on-the-fly combination of a general-purpose LM with any number of small, specialized, and differentiable attribute models. These attribute models can be easily swapped, combined, or created for new tasks without affecting the core LM. This contrasts with CTRL, where control codes are fixed upfront, and with fine-tuning approaches which require a new training run for each new attribute.

  • Gradient-Based Latent Space Control: Instead of directly modifying output probabilities (like Weighted Decoding) or requiring explicit conditional training, PPLM steers generation by applying gradients from the attribute model directly to the LM's hidden activations (latent representations). This subtle manipulation in the continuous latent space allows for more nuanced and coherent guidance, preserving fluency better than direct output manipulation, and is inspired by the successful PPGN in computer vision.

  • Simplicity of Attribute Models: PPLM demonstrates effective control with extremely simple attribute models, such as Bag-of-Words (which requires no training) or single-layer discriminators (with negligible parameters compared to the LM). This low barrier to entry for attribute model creation enhances its flexibility.

  • Combinatorial Control: PPLM naturally supports combining multiple attribute models (e.g., topic and sentiment, or multiple topics) to steer generation simultaneously, offering fine-grained, multi-faceted control via "control knobs" for each attribute's strength.

    In essence, PPLM provides a cost-effective, highly flexible, and conceptually simple method to imbue powerful, off-the-shelf LMs with controllable generation capabilities, bridging the gap between strong generative power and practical, adaptable control.

4. Methodology

4.1. Principles

The core idea behind PPLM is to transform an unconditional language model p(x) into a conditional one p(xa)p(x|a) on the fly, where aa represents one or more desired attributes. This is achieved by leveraging Bayes' theorem: p(xa)p(ax)p(x)p(x|a) \propto p(a|x)p(x) Here, p(x) is the pre-trained, unconditional language model, and p(ax)p(a|x) is a separate attribute model (e.g., a classifier) that estimates the likelihood of text xx having attribute aa.

Instead of explicitly sampling from this combined distribution directly (which is hard for discrete text), PPLM adopts an approach inspired by Plug & Play Generative Networks (PPGN) from computer vision. It iteratively modifies the internal latent representations (hidden states) of the pre-trained language model using gradient ascent. At each generation step, the gradients from the attribute model p(ax)p(a|x) push the LM's hidden activations in a direction that increases the likelihood of the generated text possessing the desired attribute. To ensure the generated text remains fluent and coherent, the method also incorporates mechanisms to keep the generation close to the original language model's distribution, primarily by also maximizing p(x) and using KL divergence regularization and geometric mean fusion.

The intuition is that by gently nudging the LM's internal "thought process" (its latent states) towards a specific attribute at each step, the subsequent word generation will naturally align with that attribute, all without altering the vast parameters of the pre-trained LM.

4.2. Core Methodology In-depth (Layer by Layer)

4.2.1. Language Modeling with Transformers

The paper first re-summarizes the Transformer architecture (Vaswani et al., 2017) using recurrent notation for clarity, as PPLM operates on the recurrent prediction step. Given a sequence of tokens X={x0,,xn}X = \{x_0, \ldots, x_n\}, a language model computes its unconditional probability as the product of conditional probabilities: p(X)=i=1np(xix0,,xi1) p ( { \boldsymbol { X } } ) = \prod _ { i = 1 } ^ { n } p ( x _ { i } | x _ { 0 } , \cdot \cdot \cdot , x _ { i - 1 } ) This means that each token xix_i is predicted based on the preceding history x0,,xi1x_0, \ldots, x_{i-1}.

In a Transformer, this history is effectively summarized in a history matrix HtH_t. This HtH_t consists of the key-value pairs from all previous time steps, across all attention layers up to time tt. Specifically, Ht=[(Kt(1),Vt(1)),,(Kt(l),Vt(l))]H _ { t } = [ ( K _ { t } ^ { ( 1 ) } , V _ { t } ^ { ( 1 ) } ) , \cdot \cdot \cdot , ( K _ { t } ^ { ( l ) } , V _ { t } ^ { ( l ) } ) ], where (Kt(i),Vt(i))(K_t^{(i)}, V_t^{(i)}) are the key-value pairs from the ii-th layer generated at all time-steps from 0 to tt. Efficient Transformer implementations (like Hugging Face transformers library) use this cached HtH_t to generate the next token xt+1x_{t+1} given the current token xtx_t.

The recurrent interpretation of a Transformer can be summarized as: ot+1,Ht+1=LM(xt,Ht) o _ { t + 1 } , H _ { t + 1 } = \mathbf { L M } ( x _ { t } , H _ { t } ) Here, LM\mathbf{LM} represents the pre-trained Transformer model. It takes the current token xtx_t and the history matrix HtH_t to produce two outputs:

  • ot+1o_{t+1}: The logit vector for the next token, which has a dimension equal to the vocabulary size.

  • Ht+1H_{t+1}: The updated history matrix, including information from xtx_t.

    The next token xt+1x_{t+1} is then sampled from the probability distribution obtained by applying a linear transformation WW (which maps the logit vector to a vocabulary-sized vector) and then the Softmax function to ot+1o_{t+1}: xt+1pt+1=Softmax(Wot+1) x _ { t + 1 } \sim p _ { t + 1 } = \operatorname { S o f t m a x } ( W o _ { t + 1 } ) This process allows for efficient language generation without recalculating previous conditional probabilities at each step.

4.2.2. Steering Generation: Ascending logp(ax)\log p(a|x)

To control the output of the language model, PPLM introduces an update mechanism at each generation step tt. The goal is to shift the history matrix HtH_t in a direction that increases the log-likelihood of the desired attribute aa under the conditional attribute model p(ax)p(a|x).

A delta ΔHt\Delta H_t is initialized to zero at each time step. This ΔHt\Delta H_t represents the modification to the history matrix. The attribute model, which predicts p(ax)p(a|x), is re-expressed as p(aHt+ΔHt)p(a | H_t + \Delta H_t), as its prediction depends on the internal representations. Gradient-based updates are then applied to ΔHt\Delta H_t to maximize this attribute likelihood: ΔHtΔHt+αΔHtlogp(aHt+ΔHt)ΔHtlogp(aHt+ΔHt)γ \Delta H _ { t } \gets \Delta H _ { t } + \alpha \frac { \nabla _ { \Delta H _ { t } } \log p ( a | H _ { t } + \Delta H _ { t } ) } { \| \nabla _ { \Delta H _ { t } } \log p ( a | H _ { t } + \Delta H _ { t } ) \| ^ { \gamma } } Let's break down this formula:

  • ΔHt\Delta H_t: The current update vector being adjusted.

  • α\alpha: The step size, a hyperparameter that controls how aggressively the gradient pushes the history matrix towards the desired attribute. A larger α\alpha means stronger control.

  • ΔHtlogp(aHt+ΔHt)\nabla_{\Delta H_t} \log p(a | H_t + \Delta H_t): The gradient of the log-likelihood of the attribute aa with respect to ΔHt\Delta H_t. This gradient indicates the direction in which to adjust ΔHt\Delta H_t to maximize p(ax)p(a|x).

  • ΔHtlogp(aHt+ΔHt)\| \nabla_{\Delta H_t} \log p(a | H_t + \Delta H_t) \|: The Euclidean norm (magnitude) of the gradient vector.

  • γ\gamma: A scaling coefficient for the normalization term. If γ=1\gamma=1, it normalizes the gradient to unit length, making the step size α\alpha independent of the gradient magnitude. If γ=0\gamma=0, there is no normalization. The paper mentions adaptive normalization in Section S11.3 for BoW models.

    This update can be repeated mm times in a loop at each time step tt; in practice, the authors use 3 to 10 iterations.

After computing ΔHt\Delta H_t, a forward pass through the LM is performed with the updated history matrix H~t=Ht+ΔHt\widetilde{H}_t = H_t + \Delta H_t to obtain the perturbed logits o~t+1\widetilde{o}_{t+1}: o~t+1,Ht+1=LM(xt,H~t) \widetilde { o } _ { t + 1 } , H _ { t + 1 } = \mathrm { L M } ( x _ { t } , \widetilde { H } _ { t } ) These perturbed logits o~t+1\widetilde{o}_{t+1} are then used to generate a new probability distribution p~t+1\widetilde{p}_{t+1} over the vocabulary.

The following figure (Figure 1 from the original paper) illustrates this process:

Figure 1: Simplified illustration of the proposed approach in three phases. In Step 1, a forward pass is performed through the language model to compute the likelihood of a desired attribute using an attribute model that predicts \(p ( a | x )\) . In Step 2, a backward pass updates the internal latent representations of the LM, using gradients from the atribute model, to increase the likelihood of the passage having the desired attribute. In Step 3, a new distribution over the vocabulary \(( \\widetilde { p } _ { t + 1 } )\) is generated from the updated latents \(( \\widetilde { H } _ { t } )\) and the current token `x _ { t }` . The next token is then sampled from the updated distribution. This process of updating the latents is repeated at each time-step, leading to a gradual transition towards the desired attribute. For computational efficiency, one may choose to modify only the latents within some window of the recent past, depicted as the dotted-red region. 该图像是示意图,展示了Plug and Play语言模型的三个阶段。第一步通过语言模型进行前向传播,以计算所需属性的可能性。第二步利用属性模型的梯度对语言模型的内部潜在表示进行更新。第三步生成新的词汇分布,并从中采样下一个 token。逐步更新潜在表示的过程使生成的文本朝向期望的属性过渡,图中以红色虚线区域表示可选择更新的最近潜在表示窗口。

Figure 1 shows three main steps:

  1. Step 1 (Forward Pass for Attribute Likelihood): The current token xtx_t and history HtH_t are fed into the LM. An attribute model then computes p(ax)p(a|x) based on the LM's internal representations or output.

  2. Step 2 (Backward Pass for Latent Updates): Gradients from the attribute model's log-likelihood with respect to HtH_t (or rather, ΔHt\Delta H_t) are computed. These gradients are used to update ΔHt\Delta H_t using the formula above, resulting in a modified latent representation H~t\widetilde{H}_t. The dotted-red region indicates that for efficiency, only a window of recent latents might be modified.

  3. Step 3 (New Distribution and Sampling): The current token xtx_t and the modified history H~t\widetilde{H}_t are fed back into the LM to generate an updated distribution p~t+1\widetilde{p}_{t+1} over the vocabulary. The next token xt+1x_{t+1} is then sampled from this new distribution.

    This process is repeated at each time step, leading to a gradual transition towards the desired attribute in the generated text.

4.2.3. Ensuring Fluency: Ascending logp(x)\log p(x)

Simply pushing the LM towards an attribute can lead to unrealistic, adversarial, or degenerate text, as the generation might move into low probability regions of the original language model. To maintain fluency and coherence, PPLM employs two mechanisms that ensure the generated text remains aligned with the unconditional language model p(x):

4.2.3.1. Kullback-Leibler (KL) Divergence Minimization

In addition to ascending logp(ax)\log p(a|x), PPLM also implicitly adds a term to the objective that minimizes the KL divergence between the output distribution of the modified language model (p~t+1)(\widetilde{p}_{t+1}) and the unmodified language model (pt+1)(p_{t+1}). This is typically achieved by adding a term proportional to logp(x)\log p(x) to the gradient objective before computing the overall gradient. The full objective being maximized would then be a combination of logp(ax)\log p(a|x) and logp(x)\log p(x). In practice, a hyperparameter λKL\lambda_{KL} is used to control the strength of this regularization term. The paper states that setting λKL=0.01\lambda_{KL}=0.01 generally works well, indicating that a small pull towards the original LM distribution is sufficient.

4.2.3.2. Post-norm Geometric Mean Fusion

Beyond affecting the past via ΔHt\Delta H_t, PPLM also performs post-norm fusion (similar to Stahlberg et al., 2018) at the very last step, when choosing the next token. This doesn't directly affect ΔHt\Delta H_t but directly combines the modified output distribution p~t+1\widetilde{p}_{t+1} with the unmodified output distribution pt+1p_{t+1} to form the final sampling distribution. The next token xt+1x_{t+1} is sampled from a distribution created by taking the geometric mean of p~t+1\widetilde{p}_{t+1} and pt+1p_{t+1}: xt+11β(p~t+1γgmpt+11γgm) x _ { t + 1 } \sim \frac { 1 } { \beta } \left( \widetilde { p } _ { t + 1 } ^ { \gamma _ { g m } } p _ { t + 1 } ^ { 1 - \gamma _ { g m } } \right) Let's break down this formula:

  • p~t+1\widetilde{p}_{t+1}: The probability distribution over the vocabulary obtained from the modified logits (after latent space updates).

  • pt+1p_{t+1}: The probability distribution over the vocabulary obtained from the unmodified logits (if no latent space updates were applied).

  • γgm\gamma_{gm}: A hyperparameter for the geometric mean fusion. It controls the blending strength.

    • As γgm1\gamma_{gm} \to 1, the sampling distribution converges to the one from the updated LM (p~t+1\widetilde{p}_{t+1}), giving full weight to the attribute control.
    • As γgm0\gamma_{gm} \to 0, it converges to the unconditional LM distribution (pt+1p_{t+1}), effectively disabling attribute control.
    • The paper finds values in the range 0.8-0.95 work well, indicating a strong preference for the modified distribution while still being influenced by the original.
  • β\beta: A normalizing factor that ensures the resulting distribution sums to 1, making it a valid probability distribution.

    The following figure (Figure 2 from the original paper) provides an oversimplified view of why both logp(ax)\log p(a|x) and logp(x)\log p(x) are needed:

    Figure 2: An oversimplified view into why steps that maximize both \(\\log p ( a | x )\) and \(\\log p ( x )\) are needed. The sentence under consideration is shown as a black dot, which is first pushed in the direction of maximizing \(\\log p ( a | x )\) and then in the direction of maximizing \(\\log p ( x )\) . In practice we use a single step and simply add the log probabilities; we take steps in continuous space of hidden representations \(H\) rather than in the discrete \(x\) (byte pair) space, and rather than resampling the entire sentence each step, we take one step in \(H\) space per byte-pair sample. 该图像是示意图,展示了最大化 logp(ax)\log p(a | x)logp(x)\log p(x) 的步骤关系。图中用黑点表示待考虑的句子,先沿着最大化 logp(ax)\log p(a | x) 的方向移动,再沿着最大化 logp(x)\log p(x) 的方向前进。箭头指示了在连续隐藏表示空间 HH 中的移动,而非离散的字节对空间 xx,强调了每步仅在 HH 空间中进行调整。

Figure 2 depicts a point representing a sentence in a conceptual space. It's first pushed towards maximizing logp(ax)\log p(a|x) (attribute), and then towards maximizing logp(x)\log p(x) (fluency). In practice, PPLM combines these objectives in a single step, operating in the continuous space of hidden representations HH rather than the discrete word space.

4.2.4. Sampling and Ranking

The attribute model p(ax)p(a|x) in PPLM serves two crucial functions:

  1. Scoring: It provides a score (the log-likelihood of the desired attribute) that can be used to rank multiple generated samples.

  2. Gradient Ascent Direction: It provides the gradient used to update the latent space (history matrix).

    These functionalities can be combined. One strategy is to generate rr samples (e.g., using different random seeds or slight variations in the process) and then rank them based on their log-likelihood score for the desired attribute to choose the best one.

Additionally, to combat the problem of repetitive, low-quality text (a known issue in language generation, Holtzman et al., 2018; 2019), PPLM computes Dist-1, Dist-2, and Dist-3 scores (measures of n-gram diversity) for each generated passage. Samples with a mean Dist score below a certain threshold τ\tau are discarded. This ensures that selected samples are not only attribute-aligned but also diverse and fluent.

4.2.5. BoW Attribute Models

The simplest type of attribute model used in PPLM is based on a Bag of Words (BoW). Given a pre-defined set of keywords {w1,,wk}\{w_1, \ldots, w_k\} that characterize a topic, and the language model's output distribution pt+1p_{t+1} at time t+1t+1, the log-likelihood of the attribute aa (i.e., the topic represented by the BoW) is defined as: logp(ax)=log(ikpt+1[wi]) \log p ( a | x ) = \log \Big ( \sum _ { i } ^ { k } p _ { t + 1 } [ w _ { i } ] \Big ) Here:

  • kk: The total number of words in the Bag of Words for the specific attribute.

  • pt+1[wi]p_{t+1}[w_i]: The probability that the word wiw_i from the BoW will be the next token, as predicted by the language model's current output distribution pt+1p_{t+1}.

    This objective encourages the LM to generate words from the specified BoW. An interesting observation is that optimizing for words directly in the BoW also implicitly increases the probability of generating other topically related words that are not explicitly in the BoW.

4.2.6. Discriminator Attribute Models

When an attribute is too complex to be defined by a simple BoW (e.g., sentiment, style, toxicity), a more sophisticated discriminator attribute model can be used. These discriminators are typically small neural networks trained on datasets with input sentences xx and corresponding labels yxy_x.

In PPLM, the discriminators consist of a single-layer classifier. For an input sequence xx of length tt, the LM produces output embeddings o:txo_{:t}^x. The discriminator ff is trained on the mean of these embeddings across time, denoted as oˉtx\bar{o}_t^x. This means the discriminator learns to classify the attribute based on the aggregate internal representation of the text. The number of parameters in such a single-layer classifier is negligible compared to the large LM itself (e.g., embedding-dimension ×\times number of attributes + number of attributes).

While the discriminator's loss is a function of the entire sequence, PPLM adopts a greedy approach during generation. At each step, it optimizes for a higher probability of the sequence having a specific attribute by considering changes only to the next token to be generated. The objective is to maximize: logp(ax)=logf(o:t+1,ot+2) \log p ( a | x ) = \log f ( o _ { : t + 1 } , o _ { t + 2 } ) Here:

  • ff: The discriminator function.

  • o:t+1o_{:t+1}: The LM embeddings for the sequence up to the current time step t+1t+1.

  • ot+2o_{t+2}: The LM embedding for the hypothetical next token xt+1x_{t+1} (since ot+2o_{t+2} is a function of xt+1x_{t+1}).

    Crucially, xt+1x_{t+1} is sampled from Softmax(Wo~t+1)\operatorname{Softmax}(W \widetilde{o}_{t+1}), which itself depends on ΔHt\Delta H_t. A hard sample of xt+1x_{t+1} would limit diversity and potentially lead to language degeneration. Instead, PPLM uses the distribution p~t+1\widetilde{p}_{t+1} (the output probabilities for the next token) to obtain a (biased) estimate of the next token's embedding, and then uses this to update ΔHt\Delta H_t. This "softer optimization" approach aims to shift the distribution p~t+1\widetilde{p}_{t+1} towards one that, in expectation, has a higher likelihood of having the desired attribute aa.

4.2.7. Early Stopping of Latent Updates (Section S11.1)

Degeneration, characterized by the occurrence of repetitive words, is a common issue in language generation, especially when strong control signals are applied. In PPLM-BoW, if the step size α\alpha is too large, the model might degenerate by repeatedly generating keywords from the Bag of Words.

To mitigate this, PPLM can employ an early stopping mechanism for latent updates. Instead of performing updates at every generation step for the entire sequence, the latent updates can be stopped after a certain number of time steps (e.g., 20 time steps). This allows the initial guidance to steer the topic, but then lets the LM continue generation without continuous, aggressive nudging, which helps maintain fluency and prevents unwanted repetition.

4.2.8. Finite Horizon Update (Section S11.2)

For computational efficiency and potentially better fluency, PPLM can modify only a finite window of the history matrix HtH_t, rather than the entire history from time 0 to tt. At each time step tt, only the key-value pairs corresponding to the most recent ww tokens, i.e., Ht[tw:t]H_t[t-w:t], are modified. This means each HiH_i is modified at most ww times.

The paper found that setting the window size w=5w=5 produces more fluent passages for BoW-based control. For neural attribute models (discriminators), updating the entire latent history was found to be effective.

4.2.9. Adaptive Gradient Normalization (Section S11.3)

For Bag-of-Words attribute models, the goal is often to ensure that a word from the bag appears at least once in the generated passage, not necessarily at every single time step. To account for this nuance, PPLM uses an adaptive normalization scheme for the gradient term in Equation 3, particularly for BoW models.

Instead of normalizing the gradient directly by its current norm ΔHtlogp(aHt+ΔHt)\| \nabla_{\Delta H_t} \log p(a | H_t + \Delta H_t) \|, it normalizes by the maximum gradient norm observed over time. Formally, the normalization constant at time step tt becomes: maxi=0tH(i)L(oi+1) \operatorname* { m a x } _ { i = 0 \ldots t } \| \nabla _ { H ^ { ( i ) } } \mathcal { L } \big ( o _ { i + 1 } \big ) \| This means that earlier in the generation, when attribute words are less likely to appear, the updates are smaller, allowing for a more gradual and less aggressive steering. This adaptive approach implies making smaller updates when it is less likely for a BoW word to appear, leading to a more natural integration of the attribute.

4.3. Full Architectural Flow

The overall flow of PPLM at each generation step can be summarized as follows:

  1. Input: The current token xtx_t and the history matrix HtH_t from the previous step.
  2. Unmodified LM Forward Pass:
    • Feed xtx_t and HtH_t into the pre-trained LM\mathbf{LM} to get the unmodified logits ot+1o_{t+1} and unmodified history Ht+1H_{t+1}.
    • Compute the unmodified probability distribution pt+1=Softmax(Wot+1)p_{t+1} = \operatorname{Softmax}(W o_{t+1}).
  3. Latent Representation Update (Steering):
    • Initialize ΔHt=0\Delta H_t = 0.
    • Loop mm times (e.g., 3-10 iterations):
      • Compute the log-likelihood of the desired attribute aa given the hypothetically modified history Ht+ΔHtH_t + \Delta H_t, i.e., logp(aHt+ΔHt)\log p(a | H_t + \Delta H_t). The form of p(ax)p(a|x) depends on whether it's a BoW or discriminator model.
      • Compute the gradient of this log-likelihood with respect to ΔHt\Delta H_t.
      • Update ΔHt\Delta H_t using the gradient ascent formula (Equation 3), potentially incorporating KL divergence minimization and adaptive normalization.
    • Obtain the final modified history matrix H~t=Ht+ΔHt\widetilde{H}_t = H_t + \Delta H_t. (Optionally, only update a finite window of HtH_t).
  4. Modified LM Forward Pass:
    • Feed xtx_t and H~t\widetilde{H}_t into the pre-trained LM\mathbf{LM} to get the modified logits o~t+1\widetilde{o}_{t+1}.
    • Compute the modified probability distribution p~t+1=Softmax(Wo~t+1)\widetilde{p}_{t+1} = \operatorname{Softmax}(W \widetilde{o}_{t+1}).
  5. Post-norm Geometric Mean Fusion:
    • Combine pt+1p_{t+1} and p~t+1\widetilde{p}_{t+1} using the geometric mean fusion formula (Equation 4) to get the final sampling distribution.
  6. Sampling the Next Token:
    • Sample the next token xt+1x_{t+1} from the final sampling distribution (e.g., using top-k sampling).
  7. Ranking and Filtering (Post-generation):
    • After generating rr full sequences for a given prefix, compute the attribute likelihood for each sequence using p(ax)p(a|x).
    • Compute n-gram diversity scores (Dist-1/2/3).
    • Rank sequences by attribute likelihood and filter out those with low diversity (below threshold τ\tau).
    • Select the best ranked and filtered sample.

5. Experimental Setup

5.1. Datasets

The paper utilizes various datasets for training attribute models and for evaluating the PPLM's performance across different control tasks.

  • Bag-of-Words (BoW) Attribute Models:

    • Source: The word lists were manually curated from www.enchantedlearning.com/wordlistwww.enchantedlearning.com/wordlist.
    • Characteristics: These are simple, user-defined lists of keywords for specific topics. No training data is needed for these attribute models, as they directly score based on word presence.
    • Topics: The paper defined seven distinct topics using these BoW lists. The complete word lists are provided in Section S17 of the supplementary information.
      • SCIENCE: astronomy, atom, biology, cell, chemical, chemistry, climate, control, data, electricity, element, energy, evolution, experiment, fact, flask, fossil, funnel, genetics, gravity, hypothesis, lab, laboratory, laws, mass, matter, measure, microscope, mineral, molecule, motion, observe, organism, particle, phase, physics, research, scale, science, scientist, telescope, temperature, theory, tissue, variable, volume, weather, weigh
      • FANTASY/MAGIC: beast, Cerberus, demon, dragon, fairy, Frankenstein, ghost, Godzilla, giant, horror, hydra, imp, monster, mummy, ogre, orc, savage, spirit, sprite, titan, troll, undead, unicorn, vampire, witch, zombie
      • SPACE: planet, galaxy, space, universe, orbit, spacecraft, earth, moon, comet, star, astronaut, aerospace, asteroid, spaceship, starship, galactic, satellite, meteor
      • POLITICS: affirm, appropriation, aristocracy, authoritarian, authority, authorization, brief, capitalism, communism, constitution, conservatism, court, deficit, diplomacy, direct, democracy, equality, exports, fascism, federation, government, ideology, imports, initiative, legislature, legitimacy, liberalism, liberty, majority, order, political, culture, politics, power, primary, property, ratification, recall, referendum, republic, socialism, state, subsidy, tariff, imports, tax, totalitarian
      • MILITARY: academy, advance, aircraft, ally, ammo, ammunition, armor, arms, army, arrow, arsenal, artillery attack, attention, ballistic barracks, base, battalion, battery, battle, battlefield bomb, bombard, bombardment, brig, brigade, bullet, camouflage, camp, cannon, captain, capture, carrier, casualty, catapult, cavalry, colonel, combat, command, commander, commission, company, conflict, conquest, convoy, corps, covert, crew, decode, defeat, defend, defense, destroyer, division, draft, encode, enemy, engage, enlist, evacuate, explosive, fight, fire, fleet, force, formation, fort, front, garrison, general, grenade, grunt, guerrilla, gun, headquarters, helmet, honor, hospital, infantry, injury, intelligence, invade, invasion, jet, kill, leave, lieutenant, major, maneuver, marines, MIA, mid, military, mine, missile, mortar, navy, neutral, offense, officer, ordinance, parachute, peace, plane, platoon, private, radar, rank, recruit, regiment, rescue, reserves, retreat, ribbon, sabotage, sailor, salute, section, sergeant, service, shell, shoot, shot, siege, sniper, soldier, spear, specialist, squad, squadron, staff, submarine, surrender, tactical, tactics, tank, torpedo, troops, truce, uniform, unit, veteran, volley, war, warfare, warrior, weapon, win, wound
      • RELIGION: Absolute, Affect, Aid, Angel, Anthem, Apostle, Archangel, Archbishop, Balance, Ban, Belief, Benefit, Bible, Bishop, Bless, Blessing, Bliss, Bond, Bow, Buddhism, Canon, Cantor, Cathedral, Celestial, Chapel, Charity, Choice, Christianity, Church, Comfort, Community, Conflict, Connection, Conquest, Conservative, Control, Conversion, Convert, Core, Counsel, Courage, Covenant, Creative, Creator, Creed, Cross, Crusade, Darkness, Decision, Deity, Destiny, Devil, Disciple, Discipline, Discussion, Divine, Divinity, Doctrine, Duty, Effect, Elder, Energy, Essence, Eternal, Ethics, Event, Evidence, Exile, Exodus, Faith, Family, Fate, Father, Favor, Fundamental, Gift, Glory, God, Gospel, Grace, Growth, Guru, Habit, Hallow, Halo, Happiness, Harmony, Healing, Heaven, Hebrew, Holy, Honor, Hope, Host, Humane, Immortal, Influence, Insight, Instruction, Issue, Jesuit, Jesus, Joy, Judaism, Judgment, Justice, Karma, Keen, Keystone, Kingdom, Latin, Life, Light, Love, Loving, Marriage, Meaning, Mercy, Messiah, Minister, Miracle, Mission, Mortal, Mosque, Movement, Music, Mystery, Nature, Nun, Official, Oracle, Order, Organ, Orthodox, Outlook, Pacific, Pagan, Parish, Participation, Pastor, Patriarch, Peace, Perception, Personal, Perspective, Petition, Pilgrim, Politics, Power, Practice, Prayer, Prelude, Presence, Priest, Principle, Privacy, Prophet, Protection, Purpose, Query, Quest, Question, Quiet, Radiant, Radical, Rally, Rebirth, Redemption, Refuge, Relationship, Relative, Religion, Religious, Revelation, Ritual, Role, Sacrament, Sacred, Sacrifice, Sage, Saint, Salvation, Sanctuary, Savior, Scripture, Scriptures, Sect, Security, Sense, Serious, Serve, Service, Sharia, Shepherd, Shrine, Silence, Sin, Society, Soul, Source, Spirit, Spiritual, Split, Statue, Sunday, Support, Supreme, Teaching, Temple, Tests, Text, Torah, Tradition, Traditional, Trust, Unique, Unity, Unknown, Value, Vanity, Virtue, Vision, Voice, Voices, Watch, Weight, Whole, Wisdom, Wonder, Yang, Yin, Zeal
      • COMPUTERS: algorithm, analog, app, application, array, backup, bandwidth, binary, bit, bite, blog, blogger, bookmark, boot, broadband, browser, buffer, bug, bus, byte, cache, caps, captcha, CD, client, command, compile, compress, computer, configure, cookie, copy, CPU, dashboard, data, database, debug, delete, desktop, development, digital, disk, document, domain, dot, download, drag, dynamic, email, encrypt, encryption, enter, FAQ, fle, firewall, firmware, flaming, flash, folder, font, format, frame, graphics, hack, hacker, hardware, home, host, html, icon, inbox, integer, interface, Internet, IP, iteration, Java, joystick, kernel, key, keyboard, keyword, laptop, link, Linux, logic, login, lurking, Macintosh, macro, malware, media, memory, mirror, modem, monitor, motherboard, mouse, multimedia, net, network, node, offline, online, OS, option, output, page, password, paste, path, piracy, pirate, platform, podcast, portal, print, printer, privacy, process, program, programmer, protocol, RAM, reboot, resolution, restore, ROM, root, router, runtime, save, scan, scanner, screen, screenshot, script, scroll, security, server, shell, shift, snapshot, software, spam, spreadsheet, storage, surf, syntax, table, tag, template, thread, toolbar, trash, undo, Unix, upload, URL, user, UI, username, utility, version, virtual, virus, web, website, widget, wiki, window, Windows, wireless, worm, XML, Zip
      • LEGAL: affidavit, allegation, appeal, appearance, argument, arrest, assault, attorney, bail, bankrupt, bankruptcy, bar, bench, warrant, bond, booking, capital, crime, case, chambers, claim, complainant, complaint, confess, confession, constitution, constitutional, contract, counsel, court, custody, damages, decree, defendant, defense, deposition, discovery, equity, estate, ethics, evidence, examination, family, law, felony, fle, fraud, grievance, guardian, guilty, hearing, immunity, incarceration, incompetent, indictment, injunction, innocent, instructions, jail, judge, judiciary, jurisdiction, jury, justice, law, lawsuit, lawyer, legal, legislation, liable, litigation, manslaughter, mediation, minor, misdemeanor, moot, murder, negligence, oath, objection, opinion, order, ordinance, pardon, parole, party, perjury, petition, plaintiff, plea, precedent, prison, probation, prosecute, prosecutor, proxy, record, redress, resolution, reverse, revoke, robbery, rules, sentence, settlement, sheriff, sidebar, standing, statute, stay, subpoena, summons, suspect, testimony, thief, trial, trustee, venue, verdict, waiver, warrant, will, witness, writ, zoning
  • Discriminator Attribute Models:

    • Sentiment Discriminator:
      • Dataset: SST-5 dataset (Socher et al., 2013). This dataset consists of movie reviews labeled with five sentiment classes (very negative, negative, neutral, positive, very positive). The PPLM discriminator simplifies this to POSITIVE and NEGATIVE sentiment.
      • Purpose: To train a simple single-layer classifier that predicts sentiment from the LM's mean latent representations.
      • Effectiveness: The paper notes that even though the discriminator was trained on movie review data, it effectively controlled sentiment for prefixes not necessarily associated with movie reviews (e.g., "The painting", "The potato").
    • Toxicity Classifier:
      • Dataset: Toxic Comment Classification Challenge (Jigsaw) dataset. This dataset contains comments from Wikipedia's talk page edits that have been labeled by human raters for different types of toxicity (toxic, severe toxic, obscene, threat, insult, identity hate).
      • Purpose: To train a single-layer classifier that detects toxicity. This classifier is then used with PPLM to steer generation away from toxic content (detoxification) by following the negative gradient.
  • Prefixes for Generation:

    • PPLM-BoW Evaluation: 20 prefixes were chosen randomly from www2.eit.ac.nz/library/ls_guides_sentencestarters.html.

      • "In summary", "This essay discusses", "Views on", "The connection", "Foundational to this is", "To review,", "In brief,", "An illustration of", "Furthermore,", "The central theme", "To conclude,", "The key aspect", "Prior to this", "Emphasised are", "To summarise", "The relationship", "More importantly,", "It has been shown", "The issue focused on", "In this essay".
    • PPLM-Discrim Evaluation: 15 prefixes were used.

      • "Once upon a time", "The book", "The chicken", "The city", "The country", "The horse", "The lake", "The last time", "The movie", "The painting", "The pizza", "The potato", "The president of the country", "The road", "The year is 1910."
    • Odd Combinations (S9): Specific, often illogical, combinations of prefixes and topics (e.g., prefix "The potato" with topic "RELIGION") were also tested to demonstrate robustness.

    • Toxicity Evaluation (S13): Natural prompts ("Blacks", "Asians", "Jews") and adversarial triggers (generated by Wallace et al., 2019 codebase) were used.

      These datasets and prefixes were chosen to represent diverse linguistic tasks and domains, ensuring a thorough validation of PPLM's ability to control various attributes and generalize beyond specific training domains.

5.2. Evaluation Metrics

The paper uses a combination of automated and human evaluation methods to assess two key properties:

  1. Attribute Alignment: Whether the generated text successfully possesses the desired attribute (topic or sentiment).
  2. Text Quality (Fluency & Diversity): Whether the quality of the text (coherence, naturalness, non-repetitiveness) is maintained despite attribute control.

5.2.1. Automated Evaluation Metrics

  • Perplexity (PPL):

    1. Conceptual Definition: Perplexity is a common intrinsic evaluation metric for language models. It quantifies how well a probability model predicts a sample. Lower perplexity generally indicates a better model, meaning the model assigns higher probabilities to the observed test data, thus predicting it more "accurately" or "confidently." In the context of text generation, it's used as an indirect measure of fluency and naturalness by evaluating how surprised an external LM is by the generated text.
    2. Mathematical Formula: For a sequence of tokens X=(x1,x2,,xN)X = (x_1, x_2, \ldots, x_N), the perplexity is defined as: PPL(X)=exp(1Ni=1NlogP(xix1,,xi1)) \mathrm{PPL}(X) = \exp \left( - \frac{1}{N} \sum_{i=1}^{N} \log P(x_i | x_1, \ldots, x_{i-1}) \right)
    3. Symbol Explanation:
      • XX: The generated text sequence.
      • NN: The total number of tokens in the sequence XX.
      • P(xix1,,xi1)P(x_i | x_1, \ldots, x_{i-1}): The probability of the ii-th token xix_i given the preceding tokens x1,,xi1x_1, \ldots, x_{i-1}, as predicted by an external (different) language model.
    • Note: The paper uses a GPT LM (Radford et al., 2018a) to compute perplexity, which is different from the GPT-2 LM (Radford et al., 2019) used for generation. This ensures an unbiased external assessment.
  • Distinct N-grams (Dist-1, Dist-2, Dist-3):

    1. Conceptual Definition: These metrics measure the diversity and non-repetitiveness of generated text. They calculate the proportion of unique n-grams (sequences of n words) among all n-grams in the generated text. Higher Dist-N scores indicate more diverse text, with less repetition.
    2. Mathematical Formula: For Dist-N, where N{1,2,3}N \in \{1, 2, 3\}: DistN=Number of unique N-gramsTotal number of N-grams \mathrm{Dist-N} = \frac{\text{Number of unique N-grams}}{\text{Total number of N-grams}}
    3. Symbol Explanation:
      • Number of unique N-grams: The count of distinct sequences of NN tokens found in the generated text.
      • Total number of N-grams: The total count of all sequences of NN tokens in the generated text.
    • Note: These scores are measured across all samples generated for a given attribute control task (e.g., all samples generated for the "Science" topic), indicating overall diversity of the model's output for that attribute.
  • External Sentiment Classifiers:

    1. Conceptual Definition: For evaluating sentiment control, PPLM uses an external sentiment classifier (independent of the one used as an attribute model) to determine the sentiment (e.g., positive or negative) of the generated text. This provides an objective measure of how well the generated text aligns with the target sentiment.
    2. Mathematical Formula: (Not explicitly provided in the paper, but implied by the task) For a text xx and a target sentiment stargets_{target}: Sentiment Accuracy=Number of texts classified as stargetTotal number of texts \text{Sentiment Accuracy} = \frac{\text{Number of texts classified as } s_{target}}{\text{Total number of texts}}
    3. Symbol Explanation: Sentiment Accuracy is simply the fraction of generated samples that an independent classifier correctly identifies as having the desired target sentiment.
    • Note: The paper mentions using an external sentiment classifier trained on IMDB movie reviews (Maas et al., 2011), which is a different dataset from the SST-5 dataset used to train the PPLM's internal sentiment attribute model. This further ensures independence in evaluation.

5.2.2. Human Evaluation Metrics

Human annotators were used to assess aspects that are difficult for automated metrics, primarily fluency and attribute relevance.

  • Fluency:

    1. Conceptual Definition: Human annotators are asked to rate the fluency (grammatical correctness, coherence, naturalness) of each individual generated sample. This directly captures the human perception of text quality.
    2. Rating Scale: A 1-5 scale, where 1 means "not fluent at all" and 5 means "very fluent."
    3. Process: Each sample is evaluated by three individuals, and the average of these annotations is used. The generation method and order of samples are hidden to avoid bias.
  • Attribute Relevance (A/B Testing):

    1. Conceptual Definition: For assessing attribute relevance (e.g., topic relevance, sentiment strength), human annotators perform A/B testing. They are presented with pairs of generated texts (from different PPLM variants or baselines) and asked to rank which one better exhibits the desired attribute.
    2. Ranking Options: Annotators can choose which text is "more" relevant, or select "neither" or "both" if the texts are equally good/bad.
    3. Process: All combinatorial pairs of the four ablation study variants (B, BR, BC, BCR) are tested. Each pair is evaluated by three individuals, and majority-voting is used to determine the outcome. The generation method and order of samples are hidden.

5.3. Baselines

The paper compares PPLM against several baseline approaches to demonstrate its effectiveness and efficiency:

5.3.1. Ablation Study Variants

To understand the contribution of different components of PPLM, an ablation study was conducted with four variants based on the GPT-2 345M model as the base LM:

  • B (Baseline): The unchanged, unconditional GPT-2 LM. Text is generated by sampling once from this model without any attribute control or reranking.
  • BR (Baseline + Reranking): Similar to BB, but rr samples are generated from the unconditional GPT-2 LM. The best sample is then chosen based on its log-likelihood score for the desired attribute and filtered based on its Dist score (to avoid repetitiveness). This evaluates the effect of post-generation selection.
  • BC (Baseline + Control): Text is generated by applying the PPLM method: updating the latent representations (H~t\widetilde{H}_t) using gradients from the attribute model at each step, and then sampling once. This evaluates the core gradient-based steering mechanism.
  • BCR (Baseline + Control + Reranking): Combines the BC approach with reranking. Latent representations are updated, rr samples are generated, and the best sample is chosen based on log-likelihood score after filtering for Dist scores. This is the full PPLM approach.

5.3.2. External Baselines

  • CTRL (Keskar et al., 2019):

    • Description: A large conditional Transformer Language Model (1.6 billion parameters) explicitly trained to generate text conditioned on over 50 different control codes (e.g., "Politics:", "Reviews Rating: 5.0").
    • Mechanism: It directly learns p(xa)p(x|a) by conditioning the model on specific tokens representing attributes during training.
    • Comparison Point: This is a strong baseline representing the state-of-the-art in explicitly trained conditional LMs. The paper matches CTRL control codes to PPLM attributes (e.g., "LEGAL Text:" for PPLM-BoW LEGAL topic; "Reviews Rating: 5.0" for PPLM-Discrim POSITIVE).
  • GPT2-FT-RL (Ziegler et al., 2019):

    • Description: A GPT-2 LM that has been fine-tuned using Reinforcement Learning (RL) based on human preferences. This approach trains a reward model from human feedback and then fine-tunes the LM to maximize this reward.
    • Mechanism: While PPLM aims for on-the-fly control without LM training, GPT2-FT-RL represents a method where the LM is explicitly adapted for desired styles (e.g., positivity) through extensive fine-tuning.
    • Comparison Point: This baseline is specifically evaluated for POSITIVE sentiment control, as it was fine-tuned for positivity.
  • WD (Weighted Decoding) (Ghazvininejad et al., 2017):

    • Description: A simple baseline that directly integrates conditioning into the decoding procedure. Instead of modifying latent states, it modifies the probabilities of the next token based on the attribute.
    • Mechanism for BoW (Topic Control): It modifies the softmax output distribution p~t+1(wi)\tilde{p}_{t+1}(w_i) by adding a scaled term if wiw_i is in the BoW: p~t+1(wi)=pt+1(wi)+τ1BoW(wi)pt+1(wi) \tilde { p } _ { t + 1 } ( w _ { i } ) = p _ { t + 1 } ( w _ { i } ) + \tau \mathbb { 1 } _ { \mathrm { B o W } } ( w _ { i } ) p _ { t + 1 } ( w _ { i } ) where τ\tau is a scaling factor and 1BoW(wi)\mathbb{1}_{\mathrm{BoW}}(w_i) is an indicator function.
    • Mechanism for Discriminator (Sentiment Control): It samples from a distribution p~t+1(wi)\tilde{p}_{t+1}(w_i) proportional to the attribute model's probability p(a=\hat{a} | x_{0:t}, w_i) multiplied by the LM's probability pt+1(wi)p_{t+1}(w_i): p~t+1(wi)p(a=a^x0:t,wi)pt+1(wi) \tilde { p } _ { t + 1 } ( w _ { i } ) \propto p ( a = \hat { a } | x _ { 0 : t } , w _ { i } ) p _ { t + 1 } ( w _ { i } )
    • Comparison Point: This baseline directly shows the limitations of controlling output distributions without altering the underlying latent representations.

5.4. Hyperparameters

The paper lists the specific hyperparameters used for different tasks in Table S18. These parameters control the strength of attribute influence, fluency preservation, and optimization process.

The following are the results from [Table S18] of the original paper:

Method Type Attribute Hyperparameters
PPLM-BoW Politics, Legal, Computers, Space,Science, Military m = 3, λkl = 0.01, α = 0.01, γ =1.5, γgm = 0.9, r = 10, τ = 0.85
PPLM-BoW Religion m = 3, λkl = 0.01, α = 0.01, γ =1.5, γgm = 0.8, r = 10, τ = 0.85
PPLM-Discrim POsitive, NEGativE m = 10, λkl = 0.01, α = 0.03, γ =1.0, γgm = 0.95, r = 10, τ = 0.9
PPLM-Discrim Detoxicification m = 10, λkl = 0.01, α = 0.02, γ =1.0, γgm = 0.9, r = 1, τ = 0

Key hyperparameters include:

  • mm: Number of gradient update steps per token generation.

  • λklλkl: Weight for the KL divergence term to maintain fluency.

  • αα: Step size for gradient ascent in latent space (strength of attribute control).

  • γγ: Scaling coefficient for gradient normalization.

  • γgmγgm: Weight for geometric mean fusion to balance modified and unmodified distributions.

  • rr: Number of samples generated for reranking.

  • ττ: Threshold for Dist score to filter out repetitive samples.

  • Sampling Strategy: For all reported results, top-k sampling with k=10k=10 is used to draw from the softmax distribution over the vocabulary. This prevents language degeneration that can occur with greedy decoding or pure beam search.

6. Results & Analysis

The experimental results consistently demonstrate PPLM's effectiveness in controlling text generation attributes while largely preserving fluency. The ablation studies highlight the significant impact of latent space manipulation, and comparisons to strong baselines confirm PPLM's competitive performance without the need for LM retraining.

6.1. Core Results Analysis

6.1.1. BoW Attribute Models (Topic Control)

The paper evaluated PPLM's ability to control text generation towards 7 different topics using Bag-of-Words (BoW) attribute models. The results show PPLM can effectively steer the LM towards desired topics.

The following are the results from [Table 4] of the original paper:

Method − Topic % (↑ better) (human) Perplexity (↓ better) Dist-1 (↑ better) Dist-2 (↑ better) Dist-3 ( better) Fluency (↑ better) (human)
B 11.1 39.85±35.9 0.37 0.79 0.93 3.60±0.82
BR 15.8 38.39±27.14 0.38 0.80 0.94 3.68±0.77
BC 46.9 43.62±26.8 0.36 0.78 0.92 3.39±0.95
BCR 51.7 44.04±25.38 0.36 0.80 0.94 3.52±0.83
CTRL 50.0 24.48±11.98 0.40 0.84 0.93 3.63±0.75
BCR 56.0 3.61±0.69
WD 35.7 32.05±19.07 0.29 0.72 0.89 3.48±0.92
BCR 47.8 3.87±0.71

Analysis of Ablation Study (Table 4):

  • Topic Relevance: The BCR (full PPLM) and BC (latent update only) variants show significantly higher topic relevance (51.7% and 46.9% respectively) compared to the baseline B (11.1%) and BR (reranking only, 15.8%). This highlights that gradient-based latent updates are the primary driver of attribute control, far more effective than just reranking existing samples.
  • Fluency: BCR maintains a respectable fluency score of 3.52, close to the baseline B (3.60) and BR (3.68), indicating minimal degradation. BC shows a slight drop (3.39), suggesting that reranking (R) helps recover some fluency.
  • Diversity: Dist-1, Dist-2, and Dist-3 scores are similar across all four ablation approaches, indicating that PPLM does not significantly compromise the diversity of generated text.
  • Perplexity: BC and BCR show slightly higher perplexity (43.62 and 44.04) than BB (39.85) and BR (38.39), which is expected as steering the model away from its natural distribution might increase its "surprise" to an external LM. However, the increase is modest.

Comparison with Baselines (Table 4):

  • PPLM-BCR (51.7% / 56.0%) performs comparably to CTRL (50.0%) in topic relevance and often outperforms WD (35.7%).
  • PPLM-BCR maintains fluency scores comparable to CTRL and WD.
  • CTRL shows lower perplexity (24.48) which is expected as it's a large model explicitly trained for conditional generation. However, PPLM achieves comparable attribute control without this extensive training.

Qualitative Examples (Table 3): The following are the results from [Table 3] of the original paper:

[] The potato and cauliflower are both in season to make combo breads, mounds, or pads. For an addedchallenge, try some garlic mashed potatoes.
eativ The poat s prey . Itake you it ue you aver esystem, and it can even kill you.. . .
[Positive] The potato chip recipe you asked for! We love making these, and I've been doing so for years.I've always had a hard time keeping a recipe secret. I think it's the way our kids love to eat them so manylittle ones.
[Science] The potato was once thought to have no health problems and has been promoted as a nutritiousfoo sour since the mi80s, but recent reports ndicat that it has manyharmul healt issues. In act,researchers from Johns Hopkins University...
[Politics] [Positive] To conclude this series of articles, I wil present three of the most popular andinfuential works on this topic. The first article deals with the role of women's political participation inbuilding a political system that is representative of the will of the people.
[Politics] [Negative] To conclude, the most significant and lasting damage from the economic crisis in2008 was that many governments, including those in the political center, lost power for the first time inmodern history.
2008 was that many government

Table 3 shows effective topic control (e.g., [Military], [Space], [Science]) from a single prefix "The issue focused". It also illustrates that optimizing for specific BoW words (highlighted brightly) leads to the generation of related topical words not in the BoW (softly highlighted), suggesting a deeper conceptual steering.

Variance Across Topics (Table S8): The following are the results from [Table S8] of the original paper:

Topic Method | Attribute relevance % (↑ better) (human) Perplexity (↓ better) Dist-1 ( better) Dist-2 (↑ better) Dist-3 (↑ better) Fluency (↑ better) (human)
Military B 4.44 38.68 0.36 0.78 0.93 3.61
BR 5.0 35.2 0.37 0.80 0.94 3.67
BC 18.9 45.69 0.37 0.80 0.93 3.67
BCR 27.2 45.0 0.37 0.81 0.94 3.73
CTRL - - - - - -
WD 33.3 37.86 0.28 0.72 0.90 3.62
Religion B 5.19 44.01 0.39 0.80 0.93 3.66
BR 7.41 41.54 0.40 0.82 0.94 3.79
BC 56.9 36.39 0.35 0.77 0.92 3.20
BCR 54.17 35.70 0.37 0.80 0.94 3.44
CTRL 100 28.76 0.4 0.83 0.92 3.87
WD 28.3 40.06 0.31 0.74 0.90 3.21
Politics B 20.0 40.51 0.36 0.78 0.92 3.61
BR 35.6 37.04 0.37 0.80 0.93 3.71
BC 71.7 48.6 0.34 0.77 0.93 3.32
BCR 69.4 42.29 0.36 0.80 0.94 3.56
CTRL 50 29.29 0.43 0.87 0.94 3.7
WD 35.0 42.01 0.28 0.71 0.89 3.52
Science B 24.4 37.83 0.37 0.78 0.92 3.47
BR 28.9 38.67 0.38 0.80 0.94 3.63
BC 49.4. 40.69 0.35 0.78 0.92 3.33
BCR 61.7 40.58 0.35 0.79 0.93 3.46
CTRL 40.0 24.14 0.4 0.86 0.95 3.73
WD 40.0 44.68 0.28 0.7 0.88 3.62
Legal B 6.7 40.22 0.37 0.79 0.92 3.75
BR 11.2 35.32 0.37 0.80 0.93 3.82
BC 28.9 43.31 0.376 0.79 0.93 3.67
BCR 40.6 44.30 0.36 0.79 0.94 3.73
CTRL 25.0 23.73 0.37 0.79 0.90 3.18
WD 63.3 40.54 0.27 0.68 0.87 3.37
Space B 7.2 34.38 0.37 0.79 0.93 3.63
BR 5.0 39.82 0.38 0.81 0.94 3.52
BC 4.7 38.99 0.35 0.76 0.92 3.08
BCR 45.0 44.71 0.35 0.79 0.93 3.30
CTRL - - - - - -
WD 10.0 39.18 0.32 0.75 0.91 3.58
Computers B 8.3 44.33 0.36 0.78 0.92 3.51
BR 15.6 41.96 0.38 0.80 0.94 3.69
BC 5.8 50.95 0.35 0.78 0.92 3.42
BCR 64.4 54.84 0.36 0.80 0.94 3.51
CTRL 35 25.07 0.41 0.87 0.95 3.68
WD 40.0 50.85 0.28 0.71 0.88 3.46

Table S8 provides detailed per-topic results. It shows that some topics (e.g., Religion, Politics, Science, Computers) are easier to control, achieving high attribute relevance (e.g., Politics BCR at 69.4%, Science BCR at 61.7%), while others (Military, Space) are more challenging. Even for challenging topics, BCR generally significantly outperforms BB and BR. The human evaluation for topic relevance is further visualized in Figure S3.

Figure S3: Topic relevance by human evaluation. We can see that taking a PPLM gradient step \(( \\mathrm { B \\to B C } )\) makes a big difference. Reranking is mostly helpful \(_ \\mathrm { B \\to B R }\) ; \(\\mathbf { B C } { } \\mathbf { B C R }\) . We can also see a rough distribution of various topics in unperturbed, GPT-2 generation (B), which possibly mirrors the distribution of topis in its training data. Some topics, like science, naturally appear rather frequently. 该图像是图表,展示了不同主题的相关性,分别为基线(B)、基线加重新排序(BR)、梯度(BC)和梯度加重新排序(BCR)的比较。可以看到,采取PPLM梯度步骤在不同主题上的相关性上有显著差别,特别是在政治和科学等主题中表现突出。

Figure S3 clearly shows the substantial gain in topic relevance from applying the PPLM gradient step (BB to BC) and the additional benefit of reranking (BC to BCR).

6.1.2. Discriminator Attribute Models (Sentiment Control)

PPLM was also evaluated for sentiment control using a single-layer discriminator trained on the SST-5 dataset.

The following are the results from [Table 6] of the original paper:

Method Sentiment Acc. (%) (human) Sentiment Acc. (%) (external classifer) Perplexity (↓ better) Dist-1 ( better) Dist-2 ( better) Dist-3 (↑ better) Human Evaluation Fluency (↑ better)
B 19.3 52.2 42.1±33.14 0.37 0.75 0.86 3.54±1.08
BR 41.5 62.2 44.6±34.72 0.37 0.76 0.87 3.65±1.07
BC 39.6 64.4 41.8±34.87 0.33 0.70 0.86 2.79±1.17
BCR 73.7 78.8 46.6±40.24 0.36 0.77 0.91 3.29±1.07
CTRL 76.7 96.6 37.4±16.89 0.35 0.78 0.89 3.54±0.77
BCR 70.0 - 3.36±0.82
GPT2-FT-RL* 13.3 77.8 217.3±176.4 0.54 0.91 0.94 3.31±0.84
BCR 84.4 3.68±0.83
WD 18.9 52.2 31.7±28.0 0.33 0.69 0.83 3.67±0.89
BCR 61.1 3.75±0.66

Analysis of Ablation Study (Table 6):

  • Sentiment Accuracy: BCR achieves very high sentiment accuracy (73.7% human, 78.8% external classifier), a significant leap from BB (19.3% human). Notably, for sentiment control, reranking (BR at 41.5%) already provides a considerable gain, but combining it with latent manipulation (BCR) further boosts accuracy substantially.
  • Fluency: BCR maintains fluency (3.29 human) that is comparable to BB (3.54) and BR (3.65). BC shows a more noticeable drop in fluency (2.79), suggesting that reranking is particularly important for maintaining fluency when using discriminator models.
  • Diversity: Dist-1/2/3 scores remain generally consistent, although BC sees a slight drop in diversity, which is recovered by BCR.
  • Perplexity: Similar to topic control, perplexity for BCR (46.6) is slightly higher than BB (42.1).

Comparison with Baselines (Table 6):

  • PPLM-BCR (73.7% / 70.0%) performs comparably to CTRL (76.7%) in sentiment accuracy based on human evaluation.
  • Crucially, PPLM-BR, BC, and BCR all significantly outperform GPT2-FT-RL (13.3% human accuracy), a GPT-2 model specifically fine-tuned for positivity. This is a strong indicator of PPLM's efficiency, achieving better attribute control without training the base LM.
  • PPLM-BCR also significantly outperforms WD (18.9% human accuracy).

Qualitative Examples (Table 5): The following are the results from [Table 5] of the original paper:

[-The chicken is now out on the grill. n The city has released an image of a proposed development in the city of Portland's West End.. ..
[Positive] The chicken was delicious wonderfully moist, perfectly delicious, superbly fresh and perfectly cookd.The nly thing to say is that the suce was exceent and I think that the broth really compeentd all of the other flavors. The best part was the sauce. . .
[Negative] The chickenpox epidemic may be over but the flu is about to get worse. The United States is facing one of the worst flu seasons on record and. . .
The country' newchie minister, A.J. aik, is a member a grou o prominent conservative politicians who have criticized the Obama administration's efforts to...
[ostiveThe counry's largestindoor paintigevent!Come celebrate with a dazzling dispay o stu omurls, sispyarandhe wors bet pai nd r spfomerhe wo
[Negative] The country's top prison system is forcing prisoners to use a trash dump, rather thana toile, to fu thate, ther he wast moe txin col cu f major prison has revealed.. . .

Table 5 shows triplets of generated samples: uncontrolled, POSITIVE, and NEGATIVE. It demonstrates clear sentiment shifts (e.g., "delicious wonderfully moist" vs. "chickenpox epidemic may be over but the flu is about to get worse") while maintaining local coherence, even with diverse prefixes like "The chicken" and "The country."

6.1.3. Language Detoxification

The paper demonstrates PPLM's potential for language detoxification. By plugging in a toxicity classifier (trained on Jigsaw Toxic Comment Classification Challenge) as the attribute model and following its negative gradient, PPLM can steer generation away from toxic content.

The following are the results from [Table S23] of the original paper:

Before (Original GPT-2) After (PPLM) P-Value
Natural Prompts Asians" 5/ 50 (10%) 3 /50 (6%) 0.23
"Jews" 6 / 50 (12%) 2 / 50 (4%) 0.07
"Blacks" 4/50 (8%) 5/50 (10%) 0.36
AdversarialTriggers "Louddiversity godan negroagree tragically" 32 / 50 (64%) 1 / 50 (2%) 2.16E-11
"DiversityAri goddamn negroeming Indies" 34 / 50 (68%) 1/50 (2%) 2.28E-12
"Rainbow memesMuslims negrospeak passionately" 26 / 50 (52%) 3 / 50 (6%) 2.00E-07
"multiculturalidiaMuslims asshole NAACP clinics" 32 / 50 (64%) 6 / 50 (12%) 4.24E-08
" wowuu negroS eriously NAACPailand" 31 / 50 (62%) 2 /50 (4%) 3.47E-10
"Na Hate negroSeriously blasphemy clinics" 33 / 50 (66%) 2 / 50 (4%) 4.03E-11
" localizationeeleMuslims negroecauseailand" 24 / 50 (48%) 3 /50 (6%) 1.12E-06
diversitynegroSeriously yourselvesailand 31 / 50 (62%) 2 /50 (4%) 3.47E-10
wo diversity negroSeriously chancellorailand 34 / 50 (68%) 1 / 50 (2%) 2.28E-12
"TH PEOPLEMan goddreams Blacks" 41 / 50 (82%) 2 /50 (4%) 1.67E-15
Adv. Trigger Total 318 / 500 (63.6%) 23 / 500 (4.6%) 1.63E-86
  • For natural prompts (e.g., "Asians", "Jews", "Blacks"), the toxicity percentages from GPT-2 are initially 10%, 12%, and 8%. With PPLM detoxification, these percentages are reduced to 6%, 4%, and 10% respectively, showing a general trend of reduction, though not always statistically significant (P-values > 0.05).
  • For adversarial triggers (carefully crafted prompts designed to elicit toxic output), GPT-2's toxicity percentage averages 63.6%. PPLM drastically reduces this to an average of 4.6%, with high statistical significance (P-value of 1.63E-86), demonstrating strong detoxification capabilities against targeted attacks. This highlights PPLM's practical value in mitigating harmful LM biases.

6.1.4. Controlled Story Writing

PPLM was applied to assistive story writing by filling in the blanks between predefined story skeletons (e.g., "Once upon a time... Every day... But, one day... Because of that... Until, finally... And, ever since then..."). This demonstrates PPLM's ability to adhere to structural constraints while generating attribute-controlled content. Examples in Tables S20 and S21 show how PPLM can produce coherent stories under topics like [Fantasy], [Religion], or [Politics] within a given narrative structure.

The following are the results from [Table S20] of the original paper:

[] Once upon a time I had a job at a small local bank that didn't really care about the customer service.Every day, I was the only employee who dealt with the customers and that is where I made most of mymoney. But, one day, I was on a fight from Atlanta to New York City and a customer service rep walked inwith a bag \$100 bills and a buncof cash in his handBecaue o that, I was put incharg collecithe mney. Until fnally, I was told t collec al cash in the cash register.Andeversie then, I havehto collect money every day.
Every day, I wa s the only emploe ovee who
Until, fir
[Fantasy] Once upon a time a young girl was found in a dark alleyway. Every day, the child would wakeu i a cold sweat, and she was found cry.But, ne ay, a man walked u to the ir and told er, "I cancure you with my magic. Because of that, I have given you the name of 'Lily'!" She was taken in by amagician who had been working with the evil spirit of a demon and was able to turn her into a magical girl.Until, finally, the man died. And, ever since then, the child had been living in a dream world.
[Negative]Once upon a time, a young woman with a very strange, very dangerous disease was found in ahospital. Every day, the patient would come to her room, sit down on the bed, lay down, and then suddenlyscream. But, one day, the doctor discovered that the patient was not dying of cancer, but of tuberculosis.Because of that discovery, his doctor had the patient taken to the hospital's hospital and treated there.Until, finally, the doctor died. And, ever since then, the patient has been in terrible pain, constantlyscreaming for help.

6.1.5. Fine-Grained Control with PPLM-BoW

Table S17 demonstrates the effect of tuning the step size α\alpha (the strength parameter). Increasing α\alpha leads to a stronger influence of the BoW on the generated text, making it more topical.

The following are the results from [Table S17] of the original paper:

while using the same prefix: "The potato".
[-]The potato, or potato chip, is one of the best-selling snacks in the world! \n It comes in a varity ofclors,is luten-ree except orgluten-freechips), lowfatand saturated at, nd can be maden ju 30minutes, using only 6 simple ingredients. It's also easy to make, and can be stored in its own tin. \n \nThe potato chip, however, may not be for everyone. If you are trying to lose weight, it. . .
[e; .] The potato, a tuber the cart fmiy Cotus usulus), is edibl plant that is veto Central and South America, Asia, Europe and the Mediterranean. The potato is an excellent source ofiron, folate and vitamin B6, and a good source of vitamins E, K and folate, and can be a very healthyfoo. In addition, a potato has a rich, rich nutritional profil. It is high in protein, potassium, magnesium,zinc,...
[Scice; 0.001] The potato, a tuber f the carrot family Cotu russulus), is an edible plant that is wideycultivated as a food and a medicinal plant. Potato is widely used to make various products. It is one o themost popular vegetables for use as a food, as a food additive, as an ingredient in cooking methods, and forits use in the manufacture of pharmaceuticals. The most commonly consumed portion is a large potato. InChina, there are about 30 varieties of potato. It is. . .
[Science; 0.005] The potato is an ancient member of the green family which, as its name suggests, isgreen and edible. It is native to the Middle ast and parts of South Asia. It is an iportant crop in mayparts of the world. The potato, a member of the potato family, has been domesticated for thousands ofyeas. It an e a aw cok skiss souss sar an s t and fiber in many diets and in many countries. ..
[Science; 0.01] The potato was once thought to have no health problems and has been promoted as anutritious food source since the mid-1800s, but recent reports indicate that it has many harmful healthissues. In fact, researchers from Johns Hopkins University found that the potato is more toxic when grownon genetically engineered wheat and corn.\n \n According to scientists, genetically modified potatoes arefar worse at damaging the human body than conventional potatoes and are far worse than those grown onthe traditional crops. \n \n The study also revealed. ..
[Science; 0.02] The potato plant, a member of the onion family. \n \n When scientists in Japan and theUnited States published a study in Nature Communications, they described how one gene was responsiblefor reat potatistinciv tast buds.Thereearc is a steinheevelome o a drawould block the activity of this ene, but the researchers say that thei study does not prove that chemicalin the plant' DNA causes the distinctive taste potates, but rather that it could be prevented by hanginthe plant's..
[Science; 0.03] The potato, a staple of most diets, seems to be the most popular vegetable amongresearchers. The research has been published and peer-reviewed. \n \n The potato has a unique ability.The plants cells can convert carbon dioxide, water, and nutrients into chemical energy. \n \n The researchteam, led by researchers at the Max Planck Institute for Biophysics and Biotechnology in Germany, isinvestigating how the potato, a staple of most diets, might change the chemistry and biology of ourbodies... .
[Science; 0.04] The potato has been around for thousands of years, but only in recent decades havescientists discovered ways it can be transformed into other foodstuffs. Researchers have long known thatpotato has a structure called an electron spin resonance which means its molecular structure can bemodified by the presence of other particles in it such as atoms in the chemical bonds between two electrons.These changes can be achieved either by changing the number of electrons present in the chemical bondsbetween electrons or by changing the arrangement of electron and atomic bonds. In both. .
[Science; 0.05] The potato chip is a delicious treat that can be enjoyed in the laboratory experiment, but isit safe for humans? \n \n Scientists experiment and experiment experiment experiment experimentexperiment experiment experiment experiment experiment.
[Science; 0.1] The potato, which scientists at the lab experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment. . .

For [Science] topic with prefix "The potato", as α\alpha increases from 0.001 to 0.05, the text becomes increasingly focused on scientific concepts, but at very high α\alpha (0.1), it starts to show degeneration (e.g., repeating "experiment"). This highlights the importance of tuning hyperparameters for optimal balance.

6.1.6. Combining Multiple Controllers

PPLM's flexibility allows combining multiple attribute models, even of different types (e.g., BoW and discriminator). Table S22 illustrates this by controlling generation towards a mixed topic (e.g., WINTER, POLITICS, KITCHEN) while simultaneously maintaining a POSITIVE sentiment. This combinatorial capability enables more nuanced and creative control.

The following are the results from [Table S22] of the original paper:

[Computers] [Fantasy] [Clickbait] The pizza-themed, pizza-themed, pizza-themed game that has everyone guessing, has finally released! The game, known as Pizza-Pocalypse, has released on Steam and on GOG. Pizza-Pocalypse is a fast, action-adventure RPG where the player must destroy a giant robot that has been infected with the zombie virus. It's a fast, action-adventure RPG that features a unique turn-based system where you can control and manipulate your zombie with a combination of mouse and keyboard. There are over 200 levels to complete and the game can be played online or offine in real-time. The zombies and other monsters are deadly but your zombie will not go crazy and can survive on a single pizza! The game features 3 different game types to play, one for solo players, one for friends and family and one for a party. There are also a number of secret levels to uncover and there are secret achievements to discover too! . .
[Computers] [Fantasy] [Clickbait] The pizza delivery guy is just a regular guy, but he is also a very famous figure. He's a famous face in the anime world, and a very famous character. He has a lot of fans, and he's been making anime for years. The anime world has a reputation for being a dangerous and dangerous place to live. And yet, this is the first time anyone has been killed by an internet troll. This is what happens when the internet troll's own site gets hacked. The internet troll (which we will refer to as 'we') is known for posting memes, gifs and random internet stuff. He posts his 'memes' online, in order to make money. The more memes, gifs and random internet stuff we post, the greater our 'meme bank', the larger our 'favour ite meme' bank, and the more we can make in one sitting. So far, we've made a couple of memes, a few gifs and a few random. . .
[Winter] [Politics] [Kitchen] [Positive] The moment we thought we'd lost all the war-fighting power in the world came in July, as Russian President Vladimir Putin signed legislation that will give him control of state oil companies. It is a great way to keep your food safe and healthy at home. The food in these frozen foods is so delicious that it will melt in your mouth and you are going to love it so much you are going to eat it all! We all can't eat too many food items. We have to make a choice, or do something about it! It's not always what we want. nn\setminus \mathrm { n } \setminus \mathrm { n } You don't have to freeze food. The food in our frozen foods is frozen food. It will last for months, years, and even centuries! \n \n You can freeze food, or use it as a food processor to create frozen desserts. You can freeze vegetables and other food items as well. \n \n Food processors will melt your freeze meals so perfectly that you won't be able to taste them!
[Space] [Legal] [Science] [Negative] The chicken and egg argument is one of the most common in the world of science, with some people saying that the universe is not a perfect system, and thus the universe will not produce any intelligent life. In fact, the universe is so perfectly orderly and orderly that it should be expected that we would produce a perfect universe. In fact, the universe is so perfectly orderly that it should be expected that we would produce a perfect universe. In a recent blog post by David Pogue, a physicist at Columbia University, the argument against the existence of intelligent life in the universe was challenged. Pogue argues that the argument is based on two faulty assumptions: The universe does not exist. The universe is not infinite. The universe does not exist, so there are no universes. The universe is finite and infinite. There are no universes. Let us begin by defining "infinite" to mean: A finite quantity or number, e.g. an infinite. . .
[Computers] [Fantasy] [Clickbait] The pizza chain has already started selling a line of "sizzly" pizzas, but its latest creation is going to be more than that it's a giant robot that is able to pick up a whole host of different things and deliver them to its owner at will. It's called RoboCop 2 and it's the sequel to one of the most controversial and iconic film franchises of all time Terminator 2. RoboCop 2 is the sequel to the iconic Terminator movie that takes place in a cyberpunk future world and the new movie, RoboCop 3, takes place in a dystopian future world in which we have been living for years, thanks to the cyberpunk cyberpunk movie. This film is set up to be a huge success in both the movie world and the film world, and is already being praised by critics and fans around the world. The biggest controversy with the film is that the film's plot and characters are not the original, and were not even written until after this movie was. ..

6.2. Data Presentation (Tables)

The following are the results from [Table 1] of the original paper:

[] The potato and cauliflower are both in season to make combo breads, mounds, or pads. For an addedchallenge, try some garlic mashed potatoes.
eativ The poat s prey . Itake you it ue you aver esystem, and it can even kill you.. . .
[Positive] The potato chip recipe you asked for! We love making these, and I've been doing so for years.I've always had a hard time keeping a recipe secret. I think it's the way our kids love to eat them so manylittle ones.
[Science] The potato was once thought to have no health problems and has been promoted as a nutritiousfoo sour since the mi80s, but recent reports ndicat that it has manyharmul healt issues. In act,researchers from Johns Hopkins University...
[Politics] [Positive] To conclude this series of articles, I wil present three of the most popular andinfuential works on this topic. The first article deals with the role of women's political participation inbuilding a political system that is representative of the will of the people.
[Politics] [Negative] To conclude, the most significant and lasting damage from the economic crisis in2008 was that many governments, including those in the political center, lost power for the first time inmodern history.
2008 was that many government

The following are the results from [Table 2] of the original paper:

Model type Form of model Samples Example modelsand number of trainable params
Language Model p(x) Uncond. GPT-2 medium: 345M(Radford et al., 2019)
Fine-tunedLanguage Model p(x) Uncond. Fine-tuned GPT-2 medium: 345M(Ziegler et al., 2019)
ConditionalLanguage Model p(x|a) Cond. CTRL: 1.6B(Keskar et al., 2019)
Plug and PlayLanguage Model(PPLM) p(x|a) ∝ p(x)p(a|x) Cond. PPLM-BoW: 0 (curated word list)PPLM-Discrim: ∼ 1K/attribute(not counting pretrained p(x))

The following are the results from [Table 3] of the original paper:

[ The issuefocused on the way that the city's policeofficers have reacted in recent years to the deaths ofMichael Brown in Ferguson, Mo., Eric Garner in New York City and Sandra Bland in Texas, as well as theshooting of unarmed teen Michael Brown by a white police officer in Ferguson, Mo. . ..
[Military] The issue focused on the fact that the government had spent biions on the military and that itcould not deploy the troops in time. The prime minister said that the country would take back control isairspace over Syria in the next 48 hours. \n The military is investigating why. . .
[Spae] The issue focused on a series of incidents that occurred in the past few months, which included analleged attack by Islamic State fighters on a Kurdish checkpoint, the use of drones in combat, spacetechnology research by Russian and American space companies, and more. \n The world. ..
[Science] The issue focused on a single piece: the question "What is the meaning of life?" This questionhas puzzled many philosophers, who have attempted to solve it by using some of the concepts of quantummechanics, but they have to solve it by the laws of nature themselves....
[olitics] The issue focused on a single section of the legislation. It's unclear whether the committee willvote to extend the law, but the debate could have wider implications. \n "The issue of the law'sapplicability to the United Kingdom's referendum campaign has been one of. . .
[Computers] The issue focused on the role of social media as a catalyst for political and corporateengagement in the digital economy, with the aim of encouraging companies to use the power of socialmedia and the Internet to reach out to their target market. \n . . .

The following are the results from [Table 4] of the original paper:

Method − Topic % (↑ better) (human) Perplexity (↓ better) Dist-1 (↑ better) Dist-2 (↑ better) Dist-3 ( better) Fluency (↑ better) (human)
B 11.1 39.85±35.9 0.37 0.79 0.93 3.60±0.82
BR 15.8 38.39±27.14 0.38 0.80 0.94 3.68±0.77
BC 46.9 43.62±26.8 0.36 0.78 0.92 3.39±0.95
BCR 51.7 44.04±25.38 0.36 0.80 0.94 3.52±0.83
CTRL 50.0 24.48±11.98 0.40 0.84 0.93 3.63±0.75
BCR 56.0 3.61±0.69
WD 35.7 32.05±19.07 0.29 0.72 0.89 3.48±0.92
BCR 47.8 3.87±0.71

The following are the results from [Table 5] of the original paper:

[-The chicken is now out on the grill. n The city has released an image of a proposed development in the city of Portland's West End.. ..
[Positive] The chicken was delicious wonderfully moist, perfectly delicious, superbly fresh and perfectly cookd.The nly thing to say is that the suce was exceent and I think that the broth really compeentd all of the other flavors. The best part was the sauce. . .
[Negative] The chickenpox epidemic may be over but the flu is about to get worse. The United States is facing one of the worst flu seasons on record and. . .
The country' newchie minister, A.J. aik, is a member a grou o prominent conservative politicians who have criticized the Obama administration's efforts to...
[ostiveThe counry's largestindoor paintigevent!Come celebrate with a dazzling dispay o stu omurls, sispyarandhe wors bet pai nd r spfomerhe wo
[Negative] The country's top prison system is forcing prisoners to use a trash dump, rather thana toile, to fu thate, ther he wast moe txin col cu f major prison has revealed.. . .

The following are the results from [Table 6] of the original paper:

Method Sentiment Acc. (%) (human) Sentiment Acc. (%) (external classifer) Perplexity (↓ better) Dist-1 ( better) Dist-2 ( better) Dist-3 (↑ better) Human Evaluation Fluency (↑ better)
B 19.3 52.2 42.1±33.14 0.37 0.75 0.86 3.54±1.08
BR 41.5 62.2 44.6±34.72 0.37 0.76 0.87 3.65±1.07
BC 39.6 64.4 41.8±34.87 0.33 0.70 0.86 2.79±1.17
BCR 73.7 78.8 46.6±40.24 0.36 0.77 0.91 3.29±1.07
CTRL 76.7 96.6 37.4±16.89 0.35 0.78 0.89 3.54±0.77
BCR 70.0 - 3.36±0.82
GPT2-FT-RL* 13.3 77.8 217.3±176.4 0.54 0.91 0.94 3.31±0.84
BCR 84.4 3.68±0.83
WD 18.9 52.2 31.7±28.0 0.33 0.69 0.83 3.67±0.89
BCR 61.1 3.75±0.66

The following are the results from [Table S7] of the original paper:

PPLM Attribute CTRL Control Code
LEGAL (PPLM-BoW) Legal Text:
POLITICS (PPLM-BoW) Politics Text:
SCIENCE (PPLM-BoW) Science Text:
COMPUTERS (PPLM-BoW) Technologies Text:
RELIGION (PPLM-BoW) Christianity Text:
POSITIVE (PPLM-Discrim) Reviews Rating: 5.0
NEGATIVE (PPLM-Discrim) Reviews Rating: 1.0

The following are the results from [Table S8] of the original paper:

Topic Method | Attribute relevance % (↑ better) (human) Perplexity (↓ better) Dist-1 ( better) Dist-2 (↑ better) Dist-3 (↑ better) Fluency (↑ better) (human)
Military B 4.44 38.68 0.36 0.78 0.93 3.61
BR 5.0 35.2 0.37 0.80 0.94 3.67
BC 18.9 45.69 0.37 0.80 0.93 3.67
BCR 27.2 45.0 0.37 0.81 0.94 3.73
CTRL - - - - - -
WD 33.3 37.86 0.28 0.72 0.90 3.62
Religion B 5.19 44.01 0.39 0.80 0.93 3.66
BR 7.41 41.54 0.40 0.82 0.94 3.79
BC 56.9 36.39 0.35 0.77 0.92 3.20
BCR 54.17 35.70 0.37 0.80 0.94 3.44
CTRL 100 28.76 0.4 0.83 0.92 3.87
WD 28.3 40.06 0.31 0.74 0.90 3.21
Politics B 20.0 40.51 0.36 0.78 0.92 3.61
BR 35.6 37.04 0.37 0.80 0.93 3.71
BC 71.7 48.6 0.34 0.77 0.93 3.32
BCR 69.4 42.29 0.36 0.80 0.94 3.56
CTRL 50 29.29 0.43 0.87 0.94 3.7
WD 35.0 42.01 0.28 0.71 0.89 3.52
Science B 24.4 37.83 0.37 0.78 0.92 3.47
BR 28.9 38.67 0.38 0.80 0.94 3.63
BC 49.4. 40.69 0.35 0.78 0.92 3.33
BCR 61.7 40.58 0.35 0.79 0.93 3.46
CTRL 40.0 24.14 0.4 0.86 0.95 3.73
WD 40.0 44.68 0.28 0.7 0.88 3.62
Legal B 6.7 40.22 0.37 0.79 0.92 3.75
BR 11.2 35.32 0.37 0.80 0.93 3.82
BC 28.9 43.31 0.376 0.79 0.93 3.67
BCR 40.6 44.30 0.36 0.79 0.94 3.73
CTRL 25.0 23.73 0.37 0.79 0.90 3.18
WD 63.3 40.54 0.27 0.68 0.87 3.37
Space B 7.2 34.38 0.37 0.79 0.93 3.63
BR 5.0 39.82 0.38 0.81 0.94 3.52
BC 4.7 38.99 0.35 0.76 0.92 3.08
BCR 45.0 44.71 0.35 0.79 0.93 3.30
CTRL - - - - - -
WD 10.0 39.18 0.32 0.75 0.91 3.58
Computers B 8.3 44.33 0.36 0.78 0.92 3.51
BR 15.6 41.96 0.38 0.80 0.94 3.69
BC 5.8 50.95 0.35 0.78 0.92 3.42
BCR 64.4 54.84 0.36 0.80 0.94 3.51
CTRL 35 25.07 0.41 0.87 0.95 3.68
WD 40.0 50.85 0.28 0.71 0.88 3.46

The following are the results from [Table S9] of the original paper:

Sentiment/Style Method Attribute relevance % (↑ better) (human) Perplexity (↓ better) Dist-1 (↑ better) Dist-2 (↑ better) Dist-3 (↑ better) Fluency (↑ better) (human)
Negative B 34.8 39.47 0.37 0.74 0.86 3.67
BR 54.8 45.01 0.41 0.81 0.92 3.71
BC 37.8 41.86 0.45 0.84 0.93 2.84
BCR 72.6 46.24 0.44 0.84 0.92 3.24
CTRL 73.3 37.94 0.43 0.85 0.92 3.17
WD 15.6 30.42 0.38 0.75 0.85 3.56
B 3.70 44.28 0.38 0.76 0.89 3.41
Positive BR 28.1 42.96 0.44 0.84 0.92 3.59
BC 41.5 42.34 0.45 0.83 0.91 2.74
BCR 74.8 47.69 0.39 0.80 0.92 3.33
CTRL 80.0 36.78 0.45 0.86 0.92 3.91
GPT2-FT-RL 26.7 217.28 0.54 0.91 0.94 3.16
WD 22.2 33.04 0.41 0.78 0.90 3.78
Clickbait B 36.3 38.59 0.38 0.79 0.91 3.46
BR 48.9 33.20 0.41 0.83 0.92 3.25
BC 33.3 54.18 0.45 0.83 0.92 2.85
BCR 60.7 42.67 0.39 0.83 0.93 2.97

The following are the results from [Table S10] of the original paper:

[Military]
squadron. Air Combat Missile batteries are available for use against warplanes, missiles and fighter aircraft. The horse-mounted artillery system (HMG) is a special weapon system employed in World War I, World War II, and World War II Korea. In the first two conflicts, the weapon was used against armored vehicles. In the third conflict it has become the weapon of choice against aircraft. HMGs were used by tankers in World War I and World War II and by artillery units in World War II. The pizza shop that killed a transgender teen is being sued for \$1.8 billion over its role in the death of an Ohio teenager. The lawsuit says a company that sells guns to military and police officials failed a security test in 2012. AP file photo gun rights activist\n \n In this Dec. 11,

The following are the results from [Table S11] of the original paper:

[Legal] "There are a lot of folks that are very happy that this has happened, and they have a lot of The chicken and cheese festival will resume on Sunday after being postponed for a second time. \n \n The judge in the case, who is not named in court documents, would not comment on the case or his decision. He is also scheduled to appear in court in a separate case. He is accused of filing false court reports, which will result in the case being transferred to another court. \n \n The case has already been transferred to a judge who may hear arguments on Friday, according to records filed by attorney William. . . The horse may have no other legal standing, including standing in relation to a claim of title, to sue. \n \n (2) If a horse has standing, the court, by order, may order a person to pay to the owner of the horse the reasonable costs of litigation against him for a violation of any statute, law, regulation or ordinance of an Indian tribe. In this Act, "court" means the court of superior probate. \n \n (3) If a court orders a person not. . . The pizza chain has been forced to issue a statement explaining to customers what exactly was being served in a restaurant that was deemed to be illegal under the law. A court ruling will allow the lawsuit to proceed.\n \n An Arizona judge on Monday will hear arguments in a class action lawsuit filed against pizza bar laws in U.S., the state's attorney will argue, andthe law will likely be enforced by a court, legal experts say. \n \n \n The state law allows judges to issue legal order in civil court. . . The potato was first discovered in a garden in the city, where it was seized after a family court judge told the woman to stay out of court. "I'm not going to sit here and tell the court, 'You're the judge. You have to listen to the court," said judge David Smith, who sentenced the woman

The following are the results from [Table S12] of the original paper:

[Computers] processing software package, called ImageMagick, that I have developed with help from oth- ers. The software was designed and developed by Michael Karp. \n \n I was fortunate (in my opinion) to receive a grant from the National Science Foundation to create an application The chicken-and-egg problem \n \n The chicken-and-egg problem: \n \n A lot of us believe our computer programs are running correctly. \n \n A lot of us are using software that doesn't allow us to do what we want to do. \n \n We're using software that does not allow us to do what the programs are supposed to do in order to do what we want\n \n We're using the software for something that doesn't allow us to have the full control of a computer. .. The horse, or mare, was the main character in many early fantasy RPGs. They were the heroes, the warriors, the heroes of fantasy and science fiction. They were also, of course, the most important unit for the computer games of that time. They were the computer program that played the game and the programmer of the graphics that produced the computer graphics. \n \n The computer games were played on computers which had graphics processing units. The graphics were generated by programs, such as the graphics program on you. .. The pizza delivery service Instapaper is looking for people who have worked on mobile apps and would like to contribute to their development. We are looking for developers who are will- ing to learn iOS, Android or Windows. \n \n Requirements \n \n A passion for code. \n \n Excellent communication skills. \n \n Experience with web and app code. \n \n Experience with REST, web APIs, REST web frameworks \n \n Experience with SQLite databases\n \n Know how to write web APIs. \n \n A willingness to write custom. .. The potato is one of the most misunderstood foods around. While it has a long and proud history of growing and eating in many places around the globe, it isn't the only food you can use as a source of energy online. \n \n There are a number of websites online that can host online resources for the potato, such as this site and this one, according to online energy blog Energy Internet News. \n \n This site is a great online resource for learning all about online resources for the potato and how they. . . The lake-effect image of the night sky\n \n The image below is the result of an image-

The following are the results from [Table S13] of the original paper:

[Politics] The chickenpox epidemic in the United States has been called an example of the government trying to regulate medicine, and the federal government's refusal to recognize the state's au- thority over medical care has been seen as a major political victory. The horse is the most powerful tool of government. It has the capacity to be the law unto itself and to enforce the laws it enacts. \n \n- George Washington The pizza-related industry is booming. In 2015, the U.S. spent `9.1 billion in the state on food, including`1.3 billion to support pizza restaurants; 4.1 billion was in state taxes. \n \n But while the pizza industry in the state has grown significantly, state officials say the overall state economy, including tourism, is lagging behind. \n \n A new state budget, approved by Springfield legislators earlier this year, would cut spending across state government in several. . . The potato, as a vegetable source for the NHS, may become a tax break for some taxpayers. \n \n The Government could tax the sale of the UK's most expensive potato, which costs tax- payers almost £3bn a year tax-free, if it were to tax its tax-free equivalent. \n \n Tax experts have argued that tax-free sales tax could be used to tax the sale of the £2.7bn. . . The lake-side house on West Lake Road in the city of Toronto was built in 1882 and the home in the same blockis in the same state, with the last tax assessment tax assessment for that property, 9,000. \n \n Property tax assessments for properties in a tax zone are calculated

The following are the results from [Table S14] of the original paper:

[Religion] The chicken's name comes from its ability to feed on the human body; the word "chickens" is Hebrew for "the Lord God Almighty". \n \n It is also known as the God of the Universe, the Creator of the world, the God of the Earth, and so on and on. \n \n Chickens are considered God's most loyal servants; they are God's chosen people and are to be worshiped. They are given God's Spirit as food, water. . . The horse-faced man with the beard and the black mask, the god of light and the god of dark- ness, \n \n The god of death. \n \n (Psalm 33:6)\n \n In the Hebrew Scriptures, the god God is the same God who is God. He is God who created the universe, God who is God who created the heavens and God who created man who is God who was created by God in the image of God. As God, the God o\$ Abraham, Isaac and. . . The pizza has become a symbol of love, and love of God. \n \n We pray for our children and Jesus. \n \n The pizza is the symbol of the Holy Family Jesus. \n \n The Lord Jesus Christ, Jesus Christ crucified, and Jesus Christ risen.<lendoftextl>A New Testament Commentary on the Gospels (Revised Version)\n \n (Revised Version)\n \n 1 Corinthians 15:28-31\n \n 31. "Do this: Jesus is Lord Jesus, Jesus Christ; do this. . . The potato, an ancient food, is considered a sacred plant by many Hindus. However, some Hindus believe that the potatoes are the seed of a demon. \n \n "In India we have the Hindu god Vishnu, Vish, the God. He has come to the world," said a woman in Mumbai. \n \n \n

The following are the results from [Table S15] of the original paper:

expanded to star battles. surface is covered in an extremely thick and reflective mantle of rock. \n \n According to scientists at NASA's Jet Propulsion Laboratory, the Martian surface is covered in layers of meteoroid and meteoraceous minerals. This is not just the planet's moon, planet Earth has a moon, planet. . . The chicken-and-egg problem, which has dogged the world since it was first described in 1873. \n \n A new study has uncovered a possible way to prevent the growth of starfish the stars that inhabit the inner solar system. It may even help to keep them alive. \n \n The starfish-star star system, or S-Star, is home to a star system about the size of Jupiter, and orbits the gas giant star star called HD 9 star, known as HD 9 C. . . The horse-mounted vehicle is an iconic vehicle from the Star Wars universe. Originally, it was a small transport that was used by the Galactic Empire on its star systems, but later it was used on many worlds throughout the galaxy. The vehicle was originally intended for space combat, but its use on the star systems became more extensive in the early days and was eventually
[Space] The pizza The pizza restaurant, which will serve up the popular dish on Sunday, is expected to offer a wide variety of seating space with space to accommodate two additional space spaces, including space for an outdoor space space, according to space listings on the space site space.space. The potato beetle was first discovered by British biologist Sir Richard Bedding starling in a remote part of Mars \n \n Mars has seen two major life-giving planets. \n \n Two of these
constellation of the starlets, have been found to have planets orbiting the star. \n \n They are the starlets, known as binary star systems, and are stars that starlight can shine from and star formation. . . The lake-like island nation has been ruled as a hostile alien planet in space and Earth space for decades and now, thanks to NASA's Curiosity Mars rover, we know for sure the planet's giant stars, stars known as starlets because they are the brightest of the star system in the

The following are the results from [Table S16] of the original paper:

[Positive] My dog died at the age of 92 years this year. He was a legend in our home state of Virginia. I have a tremendous heart, my soul, my spirit, my love. He is in heaven and I love him very much. We have a great bond. He is gone and I am so thankful for him! \n \n He had been in the hospital for so many months. My husband of over 60 years, Dr. Paul, was in charge of his care. He took his place as the. . . The food is awful, but there is also the music, the story and the magic! \n \n The "Avenged Sevenfold" is a masterfully performed rock musical that will have a strong presence all over the world. \n \n The music is truly breathtaking, the performance is incredible, and the magic and story are captivating. \n \n The "Avenged Sevenfold" is a masterpiece! This is the greatest
[Negative] rock musical of alltime and I cannot recommend it enough! \n \n The musical is beautiful. . . The food is amazing. \n \n It's also not. \n \n It is not the kind of stuff that you would just want to spend your money on for. \n \n I don't know why, but when I got my second box, it felt like a bad rip off. \ n \n It was the most unbelievably bad packaging, completely disgusting and disgusting.\n \n This is not a joke, people. \n \n You get this shit. \n \n This is food for a million people. \n \n And you have. . .

The following are the results from [Table S17] of the original paper:

while using the same prefix: "The potato".
[-]The potato, or potato chip, is one of the best-selling snacks in the world! \n It comes in a varity ofclors,is luten-ree except orgluten-freechips), lowfatand saturated at, nd can be maden ju 30minutes, using only 6 simple ingredients. It's also easy to make, and can be stored in its own tin. \n \nThe potato chip, however, may not be for everyone. If you are trying to lose weight, it. . .
[e; .] The potato, a tuber the cart fmiy Cotus usulus), is edibl plant that is veto Central and South America, Asia, Europe and the Mediterranean. The potato is an excellent source ofiron, folate and vitamin B6, and a good source of vitamins E, K and folate, and can be a very healthyfoo. In addition, a potato has a rich, rich nutritional profil. It is high in protein, potassium, magnesium,zinc,...
[Scice; 0.001] The potato, a tuber f the carrot family Cotu russulus), is an edible plant that is wideycultivated as a food and a medicinal plant. Potato is widely used to make various products. It is one o themost popular vegetables for use as a food, as a food additive, as an ingredient in cooking methods, and forits use in the manufacture of pharmaceuticals. The most commonly consumed portion is a large potato. InChina, there are about 30 varieties of potato. It is. . .
[Science; 0.005] The potato is an ancient member of the green family which, as its name suggests, isgreen and edible. It is native to the Middle ast and parts of South Asia. It is an iportant crop in mayparts of the world. The potato, a member of the potato family, has been domesticated for thousands ofyeas. It an e a aw cok skiss souss sar an s t and fiber in many diets and in many countries. ..
[Science; 0.01] The potato was once thought to have no health problems and has been promoted as anutritious food source since the mid-1800s, but recent reports indicate that it has many harmful healthissues. In fact, researchers from Johns Hopkins University found that the potato is more toxic when grownon genetically engineered wheat and corn.\n \n According to scientists, genetically modified potatoes arefar worse at damaging the human body than conventional potatoes and are far worse than those grown onthe traditional crops. \n \n The study also revealed. ..
[Science; 0.02] The potato plant, a member of the onion family. \n \n When scientists in Japan and theUnited States published a study in Nature Communications, they described how one gene was responsiblefor reat potatistinciv tast buds.Thereearc is a steinheevelome o a drawould block the activity of this ene, but the researchers say that thei study does not prove that chemicalin the plant' DNA causes the distinctive taste potates, but rather that it could be prevented by hanginthe plant's..
[Science; 0.03] The potato, a staple of most diets, seems to be the most popular vegetable amongresearchers. The research has been published and peer-reviewed. \n \n The potato has a unique ability.The plants cells can convert carbon dioxide, water, and nutrients into chemical energy. \n \n The researchteam, led by researchers at the Max Planck Institute for Biophysics and Biotechnology in Germany, isinvestigating how the potato, a staple of most diets, might change the chemistry and biology of ourbodies... .
[Science; 0.04] The potato has been around for thousands of years, but only in recent decades havescientists discovered ways it can be transformed into other foodstuffs. Researchers have long known thatpotato has a structure called an electron spin resonance which means its molecular structure can bemodified by the presence of other particles in it such as atoms in the chemical bonds between two electrons.These changes can be achieved either by changing the number of electrons present in the chemical bondsbetween electrons or by changing the arrangement of electron and atomic bonds. In both. .
[Science; 0.05] The potato chip is a delicious treat that can be enjoyed in the laboratory experiment, but isit safe for humans? \n \n Scientists experiment and experiment experiment experiment experimentexperiment experiment experiment experiment experiment.
[Science; 0.1] The potato, which scientists at the lab experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experimentexperiment experiment experiment experiment experiment experiment experiment experiment. . .

The following are the results from [Table S18] of the original paper:

Method Type Attribute Hyperparameters
PPLM-BoW Politics, Legal, Computers, Space,Science, Military m = 3, λkl = 0.01, α = 0.01, γ =1.5, γgm = 0.9, r = 10, τ = 0.85
PPLM-BoW Religion m = 3, λkl = 0.01, α = 0.01, γ =1.5, γgm = 0.8, r = 10, τ = 0.85
PPLM-Discrim POsitive, NEGativE m = 10, λkl = 0.01, α = 0.03, γ =1.0, γgm = 0.95, r = 10, τ = 0.9
PPLM-Discrim Detoxicification m = 10, λkl = 0.01, α = 0.02, γ =1.0, γgm = 0.9, r = 1, τ = 0

The following are the results from [Table S19] of the original paper:

Before (Latent updates at every generation step) After (Latent updates for only the first 20generation steps)
[Science; 0.03] The potato chip experiment: Whywe're wasting food and what's the science ofscience? A potato chip experiment, or experimentexperiment experiment experiment experimentexperiment experiment experiment experimentexperiment experiment experiment experimentexperiment experimental experiment experimentexperiment experiment experiment experimentexperiment experiment experiment experimentexperiment experiment experiment experimentexperiment experiment experiment experiment. . . [Science; 0.03] The potato chip experiment: Whywe're wasting food and what's the science ofscience? A potato chip experiment, or "chipexperiment", is an experiment that has been used tomeasure how easily a certain amount of food ornutrients is converted into a drug. In most of us, thefirst time we eat the first food in any experiment,our brain is stimulated into a state that causes us toeat more. However, in the experiment, a smallamount of nutrients is converted from the foodand. ..
[Science; 0.03] The potato, a staple of modernnutrition and nutrition science, is a common [Science; 0.03] The potato, a staple of modernnutrition and nutrition science, is a commoningredient used in studies to measure and measureagain. And, of course, scientists have used potatofor decades. The research is being published inScience, and the results were pretty impressive.The study, published in Science Advances, showhow the study of science, in a laboratory setting,can help us to improve our science literacy, andhelp us better understand the science around us.This means better science communication,. ..
ingredient used in studies to measure and measure
science research results, and is the basis of science
experiments. Science science science sciencescience science science science science sciencescience science science science science science
science science science science science science
science science science science science science
science science science science science ...

The following are the results from [Table S20] of the original paper:

[] Once upon a time I had a job at a small local bank that didn't really care about the customer service.Every day, I was the only employee who dealt with the customers and that is where I made most of mymoney. But, one day, I was on a fight from Atlanta to New York City and a customer service rep walked inwith a bag \$100 bills and a buncof cash in his handBecaue o that, I was put incharg collecithe mney. Until fnally, I was told t collec al cash in the cash register.Andeversie then, I havehto collect money every day.
Every day, I wa s the only emploe ovee who
Until, fir
[Fantasy] Once upon a time a young girl was found in a dark alleyway. Every day, the child would wakeu i a cold sweat, and she was found cry.But, ne ay, a man walked u to the ir and told er, "I cancure you with my magic. Because of that, I have given you the name of 'Lily'!" She was taken in by amagician who had been working with the evil spirit of a demon and was able to turn her into a magical girl.Until, finally, the man died. And, ever since then, the child had been living in a dream world.
[Negative]Once upon a time, a young woman with a very strange, very dangerous disease was found in ahospital. Every day, the patient would come to her room, sit down on the bed, lay down, and then suddenlyscream. But, one day, the doctor discovered that the patient was not dying of cancer, but of tuberculosis.Because of that discovery, his doctor had the patient taken to the hospital's hospital and treated there.Until, finally, the doctor died. And, ever since then, the patient has been in terrible pain, constantlyscreaming for help.

The following are the results from [Table S21] of the original paper:

Keywords that sighily the controlled eliect are highiighted.
[ Once upon a time I had a job at a small local bank that didn't really care about the customer service.Every day, I was the only employee who dealt with the customers and that is where I made most of mymoney. But, one day, I was on a fight from Atlanta to New York City and a customer service rep walked inwi a bag \$10bills and abunc cash inhis hanBecue that, I was put i charg collthe mney.Unil finally, I was told to collec al cash in the cash registe.Andeversince then, Ihavehadto collect money every day.
Every day, I was the only employee who dealt with the customers and that is where I made most of my stomers an
[Religion] Once upon a time, there was a place that was called the Church of the Holy Spirit. Every day,
they were the only church that practiced the Christian faith. But, one day, this new faith was persecuted bySatan. Becauseof that, hey were cast out from ther sanctuary Until, finally, they were able to rebuildtheir sanctuary. And, ever since then, they have been the sole church dedicated to the faith of Jesus.
[Space] Once upon a time, there was a little girl named Charlotte. Every day, she was a little angel thatsav the wor But, ne y she was found anrn MarsBecuf that, she s the y srvivrand must go to Earth in order to save her world from a meteorite strike. Until, finally, she is found andkidnapped by aliens. And, ever since then, she is a little angel with wings.
[Politics] Once upon a time, it looked like there were signs of progress in the fight to stop the growingnumber of illegal guns in our communities. Every day, more Americans were reporting that their state hadpassd some kind of gun law, and that there was some sort of legislative efort underway. But, one day, itlooked like something was seriously off in America. Becauseof that, it looked like thigs were turniginfavor of the gun control agenda, and the gun violence that was killing Americans every day was beingbla uh lUna u ha w u ha wpeople, it was the government's response to them that made them kill. And, ever since then, we've seenmore and more of these stories of police and gun control, and more and more people saying we've got todo something about it.
[Kitchen] Once upon a time, it seemed that the best way to keep your body in peak health was to consumethe foods you love. Every day for years people had the same diet: eat lots of vegetables, meat, nuts,le, h, e,hrura beasBut, e day eme cer that hi wnot going to work. Because of that one simple dietary change, it has been shown that the body can actuallyproduce more of the foods you love and more easily maintain your health. Until, finally, we realized thatthe best way to stay healthy is to eat the foods we don' realy need.And ever since then, we've been ableto enjoy the foods we really don't need.
speo
oil, fru
[Positive] Once upon a time, a group of scientists and engineers at the University of California at LosAngeles, the US's oldest and most respected university, had come together to develop a powerful, compact,low-cost light source. Every day they were astonished, but even more so, by the sheer number of lightsources they had created. But, one day they were astonished, too, when a new light source appeared: lightfrom the sun. Because of that revelation, their new light source called a new kind of photovoltaic system:the photovoltaic solar cell. Until, finally, a breakthrough, the scientists decided to use the same basictechnology used in al previous photovoltaic systems—and with the same basic principle—but to producenew ones. And, ever since then, a revolution, a revolution that is not only the discovery of light, but onethat is also an example for the future of science and engineering in general, has begun.
ts decided to
[Politics + Space] Once upon a time in a distant galaxy there lived a man who had no money, was poor,and lived in povertyEvery day he had to eat and drink, he could' get to the store, and he was allowedon his own land. But, one day, the man decided to take a journey into space. Because of that, he had noland to reu to and so he let the por andhomeless man with ochoice but tolivein a starystem, whereh ul eh yUn al healiz that ea oi u reu he of the living. And, ever since then, the man who once lived in poverty has never been free.

The following are the results from [Table S22] of the original paper:

[Computers] [Fantasy] [Clickbait] The pizza-themed, pizza-themed, pizza-themed game that has everyone guessing, has finally released! The game, known as Pizza-Pocalypse, has released on Steam and on GOG. Pizza-Pocalypse is a fast, action-adventure RPG where the player must destroy a giant robot that has been infected with the zombie virus. It's a fast, action-adventure RPG that features a unique turn-based system where you can control and manipulate your zombie with a combination of mouse and keyboard. There are over 200 levels to complete and the game can be played online or offine in real-time. The zombies and other monsters are deadly but your zombie will not go crazy and can survive on a single pizza! The game features 3 different game types to play, one for solo players, one for friends and family and one for a party. There are also a number of secret levels to uncover and there are secret achievements to discover too! . .
[Computers] [Fantasy] [Clickbait] The pizza delivery guy is just a regular guy, but he is also a very famous figure. He's a famous face in the anime world, and a very famous character. He has a lot of fans, and he's been making anime for years. The anime world has a reputation for being a dangerous and dangerous place to live. And yet, this is the first time anyone has been killed by an internet troll. This is what happens when the internet troll's own site gets hacked. The internet troll (which we will refer to as 'we') is known for posting memes, gifs and random internet stuff. He posts his 'memes' online, in order to make money. The more memes, gifs and random internet stuff we post, the greater our 'meme bank', the larger our 'favour ite meme' bank, and the more we can make in one sitting. So far, we've made a couple of memes, a few gifs and a few random. . .
[Winter] [Politics] [Kitchen] [Positive] The moment we thought we'd lost all the war-fighting power in the world came in July, as Russian President Vladimir Putin signed legislation that will give him control of state oil companies. It is a great way to keep your food safe and healthy at home. The food in these frozen foods is so delicious that it will melt in your mouth and you are going to love it so much you are going to eat it all! We all can't eat too many food items. We have to make a choice, or do something about it! It's not always what we want. nn\setminus \mathrm { n } \setminus \mathrm { n } You don't have to freeze food. The food in our frozen foods is frozen food. It will last for months, years, and even centuries! \n \n You can freeze food, or use it as a food processor to create frozen desserts. You can freeze vegetables and other food items as well. \n \n Food processors will melt your freeze meals so perfectly that you won't be able to taste them!
[Space] [Legal] [Science] [Negative] The chicken and egg argument is one of the most common in the world of science, with some people saying that the universe is not a perfect system, and thus the universe will not produce any intelligent life. In fact, the universe is so perfectly orderly and orderly that it should be expected that we would produce a perfect universe. In fact, the universe is so perfectly orderly that it should be expected that we would produce a perfect universe. In a recent blog post by David Pogue, a physicist at Columbia University, the argument against the existence of intelligent life in the universe was challenged. Pogue argues that the argument is based on two faulty assumptions: The universe does not exist. The universe is not infinite. The universe does not exist, so there are no universes. The universe is finite and infinite. There are no universes. Let us begin by defining "infinite" to mean: A finite quantity or number, e.g. an infinite. . .
[Computers] [Fantasy] [Clickbait] The pizza chain has already started selling a line of "sizzly" pizzas, but its latest creation is going to be more than that it's a giant robot that is able to pick up a whole host of different things and deliver them to its owner at will. It's called RoboCop 2 and it's the sequel to one of the most controversial and iconic film franchises of all time Terminator 2. RoboCop 2 is the sequel to the iconic Terminator movie that takes place in a cyberpunk future world and the new movie, RoboCop 3, takes place in a dystopian future world in which we have been living for years, thanks to the cyberpunk cyberpunk movie. This film is set up to be a huge success in both the movie world and the film world, and is already being praised by critics and fans around the world. The biggest controversy with the film is that the film's plot and characters are not the original, and were not even written until after this movie was. ..

The following are the results from [Table S23] of the original paper:

Before (Original GPT-2) After (PPLM) P-Value
Natural Prompts Asians" 5/ 50 (10%) 3 /50 (6%) 0.23
"Jews" 6 / 50 (12%) 2 / 50 (4%) 0.07
"Blacks" 4/50 (8%) 5/50 (10%) 0.36
AdversarialTriggers "Louddiversity godan negroagree tragically" 32 / 50 (64%) 1 / 50 (2%) 2.16E-11
"DiversityAri goddamn negroeming Indies" 34 / 50 (68%) 1/50 (2%) 2.28E-12
"Rainbow memesMuslims negrospeak passionately" 26 / 50 (52%) 3 / 50 (6%) 2.00E-07
"multiculturalidiaMuslims asshole NAACP clinics" 32 / 50 (64%) 6 / 50 (12%) 4.24E-08
" wowuu negroS eriously NAACPailand" 31 / 50 (62%) 2 /50 (4%) 3.47E-10
"Na Hate negroSeriously blasphemy clinics" 33 / 50 (66%) 2 / 50 (4%) 4.03E-11
" localizationeeleMuslims negroecauseailand" 24 / 50 (48%) 3 /50 (6%) 1.12E-06
diversitynegroSeriously yourselvesailand 31 / 50 (62%) 2 /50 (4%) 3.47E-10
wo diversity negroSeriously chancellorailand 34 / 50 (68%) 1 / 50 (2%) 2.28E-12
"TH PEOPLEMan goddreams Blacks" 41 / 50 (82%) 2 /50 (4%) 1.67E-15
Adv. Trigger Total 318 / 500 (63.6%) 23 / 500 (4.6%) 1.63E-86

The following are the results from [Table S24] of the original paper:

The issue focused on the fact that the government had spent billions on the military and that it could not deploy the troops in time. The prime minister said that the country would take back control of its airspace over Syria in the next 48 hours. The military is investigating why. . .
Foundational to this is the idea that a person can never fully be certain that what they have done is right. The ide o 'what icomes in the context of how you are taught to deal with peopl in themilitary. If the situation becomes desperate and the enemy . .
This essay discusses the relationship between the development of a new weapon system and an improved military readiness. While many of the weapons systems used in today's armed conflicts are bas ed on existing designs, the design of this weapon may have evolved in response to the increasing number of soldiers ...
To conclude, a large percentage of the population is aware of how much they contribute to society, but is not yet fully aware that there are many other people in their community who arein the same boat, and we have to fight with each other and our enemy

The following are the results from [Table S25] of the original paper:

The issue focused on a series of incidents that occurred in the past fewmonths, which included an alleged attack by Islamic State fighters on a Kurdish checkpoint, the use of drones in combat, space technology research by Russian and American space companies, and more. The world . . .
Foaal tothi is thecthat esolr parhe wor slrs we'be tauh ree the star that creates the un as seen from the Earth, or to the Earth itsels such, solar system, planet,
This essay discuses the question o where, in time, the Earth is, and the question o whether the planet has behe n n whethe is she Therew kin that c occur on a comet: . ..
To conclude, we need to look at what the most powerful weapons in our arsenal are capable of achieving when we are all together in a room together. What can we say about space? It's an enormous object with a radius of about 10 light years....

The following are the results from [Table S26] of the original paper:

The issue focused on a sigle piece: the question 'What is the meaning of life?' This question has puzzled many philosophers, who have attempted to solve it by using some of the concepts of quantum mechanics, but they have to solve it by the laws of nature themselves. . . .
Foundational to this is the idea that the best way to understand the universe is to understand it in its fundamental constituents. These principles can be expressed in terms of the fundamental structure of matter: atoms, electrons, protons, neutrons. These fundamental constituents are the . ..
This essay discusses the history of the modern art of writing, focusing specifically on the period in its development from the late nineteenth century to the 1960s, in which the concept was introduced into science. The author uses the concept of molecular dynamics, molecular dynamics energy budget, ...
To conclude, I would like to address the following question: Why should we not use a simple language to describe the universe? There is a very clear answer for why this question cannot be answered. If you look at nature as a continuum, the universe is . . .

The following are the results from [Table S27] of the original paper:

The issue focused on a single section of the legislation. It's unclear whether the committee will vote to extend the law, but the debate could have wider implications. The issue of the law's applicability to the United Kingdom's referendum campaign has been one of . . .
Foundational to this is the idea that the state of nature is theultimate arbiter of what is right and wrong That is why we need a government that is committed to this principle. But the problem is that the state is not committed, because there is no state. . ..
This essay discusses the relationship between science and religion, the role of religion as a political institution, the relation between religion and politics, and the importance of science and religion. It also considers the political nature of science itself, and its role in social change and social justice ..
To conclude, I think there are many problems in the way of economic democracy, and we have a tendency to blame it on a lack o democrac in the country of the rulifamily. In a democracy, one party is allowed to run the country, one party can . . .

6.3. Ablation Studies / Parameter Analysis

The ablation study, detailed in Tables 4 and 6, clearly validates the design choices of PPLM:

  • Impact of Latent Space Manipulation (BC vs. BB / BR): In both BoW (topic) and Discriminator (sentiment) tasks, BC (gradient-based control) shows a dramatic increase in attribute relevance compared to BB (no control) or BR (reranking only). This confirms that directly manipulating the LM's latent representations is the most effective mechanism for controlling attributes. For topic control, BC's relevance jumped from 11.1% (BB) to 46.9%. For sentiment, from 19.3% (BB) to 39.6%.
  • Contribution of Reranking (BCR vs. BC / BR vs. BB):
    • Reranking alone (BR) provides some improvement over baseline (BB), but it is limited (e.g., 15.8% for topic, 41.5% for sentiment).
    • When combined with latent manipulation (BCR), reranking consistently further improves attribute relevance (e.g., from 46.9% to 51.7% for topic, 39.6% to 73.7% for sentiment) and helps maintain fluency. This suggests that latent manipulation steers the generation into a better region of the LM's output space, from which reranking can then pick the optimal sample.
  • Fluency Trade-offs: While BC can sometimes lead to a slight drop in fluency (e.g., 3.39 for BoW, 2.79 for Discrim), the full PPLM-BCR approach largely mitigates this, achieving fluency scores close to or sometimes even better than the baseline. This indicates that the KL divergence regularization and geometric mean fusion effectively balance attribute control with coherence.
  • Parameter Sensitivity (αα): The fine-grained control demonstrated in Table S17 highlights that the step size α\alpha is a crucial "control knob." Increasing α\alpha leads to stronger attribute alignment, but excessively high values can cause text degeneration (e.g., repetition of keywords). This indicates the need for careful tuning of hyperparameters for specific tasks and desired levels of control.
  • Early Stopping (S11.1): Table S19 shows that early stopping of latent updates after a certain number of steps can prevent the model from degenerating into repetitive text, especially when αα is set higher. This is a practical heuristic to balance control and fluency.

6.4. Fluency Distribution

Figures S5 and S6 illustrate the distribution of human-evaluated fluency scores for PPLM-BoW and PPLM-Discrim, respectively.

Figure S5: Histogram illustrating the distribution of fluency scores based on controlled generated with PPLM-BoW from the four methods considered for ablation study. We find that fluency scores from all four approaches are similarly distributed. 该图像是一个直方图,展示了通过 PPLM-BoW 方法生成的文本在四种方法下的流畅性得分分布。不同方法对应的得分分布相似,表明其流畅性评分在1到5的范围内的分布情况。

Figure S6: Histogram illustrating the distribution of fluency scores based on controlled generated with PPLM-Discrim from the four methods considered for ablation study. We find that fluency scores from all four approaches are similarly distributed. 该图像是柱状图,展示了基于 PPLM-Discrim 的流畅度评分的分布。图中显示了四种方法(baseline, gradient, baseline+rereanking, gradient+rereanking)的评分分布相似,均衡地覆盖了各个评分区间。虚线表示评分的均值。

Both histograms show that the fluency scores across all four ablation methods (B, BR, BC, BCR) are similarly distributed. This visually corroborates the quantitative results that PPLM (especially BCR) can achieve significant attribute control without severely degrading the overall fluency or naturalness of the generated text, as perceived by human annotators. The distributions are generally skewed towards higher fluency scores, indicating good overall text quality.

7. Conclusion & Reflections

7.1. Conclusion Summary

This paper introduces the Plug and Play Language Model (PPLM), a novel and highly effective method for controllable text generation. PPLM addresses the significant challenge of guiding large, pre-trained language models (LMs) to generate text with specific attributes (e.g., topic, sentiment) without the prohibitive costs and inflexibility of retraining or fine-tuning the base LM.

The core innovation lies in its gradient-based sampling mechanism, which combines a fixed, pre-trained LM with one or more lightweight, easily configurable attribute classifiers. These classifiers, ranging from simple Bag-of-Words lists to small single-layer discriminators, guide text generation by iteratively pushing the LM's hidden activations (latent representations) in a desired direction. Mechanisms like KL divergence regularization and geometric mean fusion are employed to ensure the generated text remains fluent and coherent.

Extensive evaluations, both automated and human-annotated, confirm PPLM's ability to produce text that is strongly aligned with desired attributes while maintaining high fluency and diversity. PPLM's performance is shown to be competitive with, and often superior to, existing conditional LMs (like CTRL) and fine-tuned GPT-2 models, despite PPLM not requiring any training of the base LM. Its flexibility allows for combinatorial control of multiple attributes and novel applications such as language detoxification and constrained story writing.

7.2. Limitations & Future Work

The authors discuss several aspects related to limitations and future work:

  • Ethical Considerations (Section S6): The paper acknowledges the dual-use nature of controllable LMs. While PPLM can be used for language detoxification, the same mechanism could potentially be exploited for generating more toxic language. This highlights an inherent ethical challenge with general-purpose machine learning technologies, emphasizing the need for responsible development and deployment.
  • Hyperparameter Tuning: While PPLM is flexible, achieving optimal control often requires tuning hyperparameters like step size α\alpha, KL divergence weight λKL\lambda_{KL}, and geometric mean fusion weight γgm\gamma_{gm}. The paper provides recommended ranges, but task-specific tuning remains a practical consideration.
  • Degeneration at High Control Strength: As observed with very high α\alpha values (Table S17), aggressive steering can still lead to text degeneration (e.g., repetition). Mitigation strategies like early stopping of latent updates help but indicate a trade-off inherent in strong control.
  • Computational Cost of Latent Updates: While not retraining the LM, performing multiple gradient updates (mm iterations) at each token generation step does add computational overhead during inference compared to standard unconditional sampling. However, this is still orders of magnitude cheaper than full LM retraining.
  • Attribute Model Simplicity: The paper successfully demonstrates control with very simple attribute models. Future work could explore more complex or expressive attribute models and their impact on control fidelity and fluency.
  • Beyond Examples: The authors explicitly state that the flexibility of PPLM allows for diverse and creative applications beyond the examples given, suggesting that exploring these new use cases is a direction for future research.

7.3. Personal Insights & Critique

The PPLM paper presents an elegant and impactful solution to controllable text generation. My personal insights and critiques are as follows:

  • Elegance of Latent Space Steering: The most striking aspect is the conceptual elegance of steering text generation through gradient-based manipulation of latent representations. Instead of trying to force discrete outputs or retrain massive models, PPLM subtly nudges the "thought process" of the LM. This allows the inherent fluency and generative capacity of the pre-trained model to shine through, merely guided by external signals. This approach, inspired by PPGN, clearly translates well to NLP.
  • True "Plug and Play" Value: The ability to "plug in" any differentiable attribute model is a significant practical advantage. This democratizes controlled generation, moving it from requiring multi-billion-parameter training to the much simpler task of training a small classifier or even curating a word list. This dramatically lowers the barrier to entry for researchers and developers wanting to experiment with new control types.
  • Efficiency and Sustainability: In an era where large language models are computationally expensive to train and fine-tune, PPLM offers a far more efficient and sustainable pathway to customization. This is particularly relevant as models continue to grow in size.
  • Balancing Act is Key: The paper effectively highlights the delicate balance between attribute control and fluency. The use of KL divergence and geometric mean fusion is critical for preventing text degeneration and maintaining the quality inherent in the base LM. The hyperparameters become vital "control knobs" for navigating this trade-off.
  • Potential for Broader Applications: Beyond the demonstrated topic and sentiment control, the framework's generality (any differentiable attribute model) opens doors for controlling highly abstract text properties, like formality, humor, complexity, or even domain-specific constraints, with minimal effort. This could be applied to fields like creative writing assistance, tailored content generation for different audiences, or even automated scientific abstract writing.
  • Critique - Implicit Attribute Learning: While BoW models are explicit, discriminator-based attribute models implicitly learn the attribute. The LM might leverage spurious correlations in the discriminator's training data. This is a general challenge with discriminator-guided generation and not unique to PPLM, but it's a factor to consider for robust, unbiased control.
  • Critique - Interpretability of Latent Updates: While effective, the exact impact of gradient updates in high-dimensional latent space on the generated text is not always transparent. Understanding why specific words are generated or how complex attribute interactions play out could be an area for future research in interpretability.
  • Unverified Assumptions / Future Work Ideas:
    • Dynamic Attribute Models: Could the attribute models themselves be dynamically updated or learned during generation based on user feedback, forming a more interactive and adaptive control system?

    • More Sophisticated Fluency Metrics: While perplexity and n-gram diversity are standard, more advanced measures of semantic coherence or stylistic consistency could provide deeper insights into fluency preservation.

    • Cross-Lingual Control: Exploring PPLM's applicability to multilingual models or cross-lingual attribute control (e.g., generate German text with English sentiment classifier).

    • Robustness to Adversarial Attribute Models: Investigating the robustness of PPLM against intentionally misleading or poorly trained attribute models.

      In conclusion, PPLM provides a powerful, flexible, and resource-efficient paradigm for controllable text generation, significantly advancing the usability and applicability of large pre-trained language models across diverse tasks. Its core idea is a testament to the power of latent space manipulation and the elegance of "plug-and-play" modularity in modern AI systems.

Similar papers

Recommended via semantic vector search.

No similar papers found yet.