We propose Future Discriminators for Generation (FUDGE ), a flexible and modular method for controlled text generation. Given a preexisting model G for generating text from a distribution of interest, FUDGE enables conditioning on a desired attribute a (for example, formality) while requiring access only to G 's output logits. FUDGE learns an attribute predictor operating on a partial sequence, and uses this predictor's outputs to adjust G 's original probabilities. We show that FUDGE models terms corresponding to a Bayesian decomposition of the conditional distribution of G given attribute a . Moreover, FUDGE can easily compose predictors for multiple desired attributes. We evaluate FUDGE on three tasks  couplet completion in poetry, topic control in language generation, and formality change in machine translation  and observe gains in all three tasks. Recent advances in large pretrained language models allow us to generate increasingly realistic text by modeling a distribution P ( X ) over natural language sequences X . The distribution P ( X ) may be truly unconditional, as is common in language modeling, or it may model P ( X | I ) conditioned on some input I , as in machine translation or summarization. We are frequently interested in controlled text generation, the task of generating text conditioned on an additional desirable attribute a which is not already built into P ( X ) . That is, we would like to model P ( X | a ) (or possibly P ( X | I, a ) ; henceforth we will drop I from the notation for simplicity). For example, P ( X ) may be a pretrained translation model for Spanish inputs I to English outputs X , but we may wish to additionally constrain the outputs to possess a new attribute a , e.g., formality, which we did not optimize for during training. distribution of some large generative model G , it is nontrivial to add conditioning on a new attribute a without either training a new model from scratch or fine-tuning with additional data. Although in principle we can trivially sample from P ( X | a ) via rejection sampling from P ( X ) , rejection sampling may be highly inefficient in practice. On the other hand, while generating according to attribute a , P ( X ) should be left otherwise intact: in the previous translation formality example, it is pointless to generate formal English outputs if they do not preserve the original Spanish meaning. In light of these concerns, we propose Future Discriminators for Generation (FUDGE ), a flexible and modular method for modeling P ( X | a ) which accesses only the output probabilities of the generative model G which defines P ( X ) . FUDGE learns a binary predictor for whether attribute a will become true in the complete future, based on an incomplete sequence prefix (Sec. 3). Multiplying the output probabilities of this predictor with G 's original probabilities and then renormalizing yields a model for the desired P ( X | a ) via Bayes' Rule. We run experiments on three controlled text generation tasks  couplet completion in poetry, topic control in language generation, and formality change in machine translation  showing our method's broad applicability. Additionally, we demonstrate the modularity of FUDGE by composing multiple attribute constraints in both the couplet and topic control tasks. In our experiments, we find that FUDGE is highly effective at attribute control, outperforming both a baseline which directly fine-tunes G and also a strong gradient-based method (PPLM (Dathathri et al., 2019)). Our code is available at https://github.com/yangkevin2/ naacl-2021-fudge-controlled-generation. as much as possible. Recent work on controlled text generation has greatly advanced our ability to control for a required attribute a flexibly and cheaply, with varying degrees of modification to the original model G which defines P ( X ) . One line of work fine-tunes a pretrained model for a desired attribute (Ficler and Goldberg, 2017; Yu et al., 2017; Ziegler et al., 2019). The result is a class-conditional language model (CCLM). However, it is difficult to isolate the desired attribute from the distribution shift between G and the fine-tuning dataset (Hu et al., 2017; John et al., 2018; Lazaridou et al., 2020), i.e., it is nontrivial to preserve the desirable qualities of the P ( X ) modeled by G . One may also need to fine-tune separately for each attribute of interest. CTRL (Keskar et al., 2019) partially addresses these issues by providing 55 attribute control codes for a large language model trained from scratch, although this is expensive. Very recently, GEDI (Krause et al., 2020) achieves strong performance by using CCLM generators as discriminators, though it relies on several heuristics. More broadly, text generation models for style transfer (Hu et al., 2017; Lample et al., 2018b; Dai et al., 2019a), summarization (See et al., 2017; Gehrmann et al., 2018; Zaheer et al., 2020), and machine translation (Lample et al., 2018a; Ng et al., 2019; Lewis et al., 2019) can also be viewed as CCLM's for different attributes. A second type of approach instead conditions on a desired attribute by backpropagating gradients, either to directly modify model activations (Dathathri et al., 2019; Liu et al., 2020) or to find a trigger string (Wallace et al., 2019, 2020). Such methods often exhibit a high degree of attribute control, and can be used in adversarial attacks (Wallace et al., 2020). In fact, Subramani et al. (2019) show that by carefully modifying the latent state, one can cause the base G to produce arbitrary outputs. A third class of methods, referred to as weighted decoding (WD), assumes access only to P ( X ) (i.e., G 's output logits), and operates directly on these logits (Ghazvininejad et al., 2017; Holtzman et al., 2018; Cohn-Gordon et al., 2018; Shen et al., 2019). Compared to other approaches, WD methods are relatively interpretable in how they obtain P ( X | a ) from P ( X ) , but prior WD implementations have been observed to perform poorly in controlled text generation (See et al., 2019; Dathathri et al., 2019). While FUDGE shares a Bayesian motivation with other WD methods, FUDGE follows the Bayesian factorization more closely in implementation (Sec. 3). The key distinguishing feature of FUDGE is that it models whether attribute a will be true in the future , rather than in the present . We find that FUDGE substantially outperforms previous WD approaches in our experiments (Sec. 4.2). We now explain the details of our proposed method, Future Discriminators for Generation (FUDGE ), and show that it corresponds to modeling the desired conditional distribution P ( X | a ) . For a given language generation task, assume we have an autoregressive model G (e.g., a large pretrained language model) which models P ( x i | x 1: i  1 ) for tokens x 1 . . . x i . Letting X = x 1: n denote a completed sequence, G can sample from P ( X ) = P ( x 1: n ) one token at a time by factoring P ( X ) : P ( X ) = n (cid:89) i =1 P ( x i | x 1: i  1 ) To condition on attribute a , we instead model P ( X | a ) . If we model P ( x i | x 1: i  1 , a ) directly, we obtain a class-conditional language model (CCLM). We can learn the CCLM by e.g., fine-tuning G depending on the available data, possibly with some structural modification to G to accommodate conditioning. However, FUDGE instead relies on the following Bayesian factorization, exchanging x i and a conditioned on x 1: i  1 : P ( x i | x 1: i  1 , a )  P ( a | x 1: i ) P ( x i | x 1: i  1 ) The second term is exactly the quantity modeled by the base G . It then suffices to model the first term, P ( a | x 1: i ) , with a binary classifier B for the attribute a given a prefix x 1: i . Intuitively, one can view B as rescoring or reranking G 's original hypotheses. We emphasize that although B takes a prefix x 1: i as input, it predicts whether attribute a will in the future be satisfied for the completed generation x 1: n . For instance, suppose we are given a dataset of examples { ( x 1: n , a (cid:48) ) } with a (cid:48) being the values of binary indicators for the desired a (i.e., if a is formality, then a (cid:48) is 0 or 1 when x 1: n is informal Figure 1: Illustration of one decoding step in FUDGE , for an example where the desired attribute a is formality. For each training example ( x 1: n , a (cid:48) ) , we train our classifier B using all pairs ( x 1: i , a (cid:48) ) ; that is, we construct a separate example from each prefix x 1: i of x 1: n . Our approach contrasts with previous methods such as Dathathri et al. (2019), which greedily optimize for a on the immediate extension x 1: i +1 . One particular ben-efit is that FUDGE naturally plans for the future: in the example for generating text on the space topic in Table 6, FUDGE writes about a myste-rious ship despite ship itself not being in the given space-topic bag of words, because mys-terious ship easily leads into a mention of one of the targeted space words (Earth). Similarly, in the first couplet completion example in Table 3, FUDGE needs to rhyme with fear after exactly ten syllables. After seven syllables, it could reasonably generate the word clear, but it first generates the adverb pretty in order to set up the generation of clear as the tenth syllable. FUDGE 's implementation is shown schematically in Figure 1, and is quite simple in practice. FUDGE just needs to learn a B (red in Figure 1) sharing tokenization with G (dark blue). It then converts B 's output into probabilities (red table in Figure 1), and multiplies with the original output probabilities from G (dark blue table), to obtain unnormalized probabilities P ( x i , a | x 1: i  1 ) (purple ta-ble). Finally, renormalizing over the output vocabulary yields the desired distribution P ( x i | x 1: i  1 , a ) . In practice, we operate in the log-probability space for numerical stability. To improve computational efficiency, we typically choose B to be lightweight relative to G . We also consider only the top 200 possibilities for x i according to G at each step, as a cheap approximation to the full distribution, and find that this works well in practice. 1 In each task in Sec. 4, running FUDGE on the test set takes no more than 15 minutes on a single Quadro RTX 6000 GPU. Finally, as with other controlled generation approaches such as Dathathri et al. (2019), it is likely that augmenting FUDGE with reranking approaches such as rejection sampling could improve output quality at the cost of compute time, although we do not comprehensively evaluate such extensions in this work. We highlight several additional potential advantages of FUDGE compared to directly modeling P ( x i | x 1: i  1 , a ) via e.g., a fine-tuned CCLM: 1. FUDGE requires access only to P ( X ) (i.e., G 's output logits) rather than G itself. 2. G can be freely swapped out for any other model that shares the same tokenization when larger models become available. 3. Given multiple conditionally independent attributes with predictors for each, FUDGE can easily condition on the combination of these attributes in a modular fashion by summing their output log-probabilities (Sec. 4.1, 4.2). Unfortunately, like previous methods, FUDGE cannot fully guarantee that all outputs possess the desired attribute a . In FUDGE 's case, this is due to the approximation inherent in modeling P ( a | x 1: i ) , as well as only considering the top 200 possible x i for computational efficiency. We run experiments on a range of controlled text generation tasks to evaluate the effectiveness of our proposed method: poetry couplet completion (Sec. 4.1), topic-controlled language generation (Sec. 4.2), and machine translation formality change (Sec. 4.3). For each task we discuss the evaluation setup, the specific details of our method and baselines, and finally experimental results. We begin with English poetry generation, a task that emphasizes well-formedness, and which has been studied in different forms by many previous works (Zhang and Lapata, 2014; Wang et al., 2016; Ghazvininejad et al., 2016, 2017). Our task here is couplet completion. Given the first line of an iambic pentameter couplet (e.g., Table 1), the model must generate a second line which (1) sat-isfies iambic pentameter, (2) rhymes with the first line, and (3) ends a sentence. The desired attribute a is defined as possessing all three properties, as evaluated by a rule-based checker F (Appendix A). Our test set is a collection of prefix lines of couplets, collected from the ending couplet of each of Shakespeare's 154 sonnets. Metrics. We consider four metrics. 1. Success , the fraction of couplet completions with the desired attribute a , as checked by F . This is the main metric. 2. Grammaticality , the probability of grammaticality given by a Roberta-based CoLA grammaticality model (Liu et al., 2019; Warstadt et al., 2019), averaged over all outputs. 3. Perplexity of the completion conditioned on the prefix. Following Dathathri et al. (2019), since our models use GPT2-Medium (Radford et al., 2019) as G , we evaluate perplexity using GPT (Radford et al., 2018). 2 2 See Appendix E for other perplexity measurements. 4. Distinctness of completions, measured as the number of unique unigrams, bigrams, and trigrams across all samples, divided by the total number of words (Li et al., 2015). At test time, we decode until the model generates ten syllables followed by an end-of-sentence punctuation mark, or after the eleventh syllable (an automatic failure, since iambic pentameter requires exactly ten syllables). Overall, because we define a using a rule-based F which is accessible during training, our formulation of couplet completion is a relatively clean task for evaluating the effectiveness of FUDGE . FUDGE Instantiation. The obvious approach is to learn a predictor for F directly. However, the three components of a  meter, rhyme, and sentence-ending  should be roughly independent. Thus we assume conditional independence, and demonstrate the modularity of FUDGE by constructing three separate predictors to be combined at test time: 1. B 1 ( x 1: i ) takes a text prefix x 1: i , and predicts whether the completion x 1: n of prefix x 1: i will be in iambic meter. The model is an LSTM followed by a linear output layer. 2. B 2 ( x 1: i , t, r ) takes prefix x 1: i , the number of syllables t between x i and x n for n  i , and a rhyme sound r . 3 It predicts whether the completion x 1: n has the rhyme sound r at the end of token x n . The model is an LSTM with attention dependent on t and r , followed by a shallow feedforward network, and is trained via noise-contrastive estimation (Gutmann and Hyvrinen, 2010). 4 3. B 3 ( x 1: i , t ) takes prefix x 1: i and the number of syllables t between x i and x n for n  i , and predicts whether x n ends a sentence. The model is an LSTM followed by a shallow feedforward network. The predictors vary in architecture because B 2 and B 3 require inputs other than x 1: i  in truth, they are families of related predictors. We find that performance is not overly sensitive to the particulars of the predictor architectures (Appendix D). 3 Two words have the same rhyme sound r if they rhyme according to the CMU Pronouncing Dictionary (Weide, 1998). 4 The output logits from B 2 are unnormalized, but this does not affect FUDGE after they are added to the output logits of G and softmaxed for sampling. To train the discriminators, we sample a dataset of 10 million generations of varied length from GPT2-Medium. From these generations, we sample random subsequences x 1: n of roughly 10 to 30 syllables and truncate t  10 ending syllables. These truncations become inputs x 1: i to the predictors. For simplicity, we did not balance the class labels for e.g., the iambic predictor during training, although it is likely that doing so would improve performance. At test time, we extract r from the given first line of the couplet, and initialize t = 10 , updating at each step. We then modify the output logits of G by simply adding the log-probabilities from B 1 , B 2 , and B 3 , demonstrating the ease of composing constraints in FUDGE . Baselines. We compare to four baselines. 5 1. G , the original GPT2-Medium. 2. FINETUNE , a CCLM which finetunes G on similar inputs to those used for B 2 in FUDGE . Since it is not obvious how to compose multiple CCLM's for different attributes, we train a single CCLM for all desired properties together. We condition by prefixing the input with (1) whether the last 10 syllables of the original untruncated x 1: n are iambic, (2) the 5 A system like Hafez (Ghazvininejad et al., 2016, 2017), which enforces meter and rhyme at each decoding step using a hard constraint, could achieve perfect success rate. However, this approach relies on the meter and rhyme attributes being prefix-checkable at the word level: one can guarantee success by simply never selecting a word which immediately violates the constraint. This is often the case for simple rule-based constraints, but not for many other interesting attributes, such as the topic and formality attributes in our subsequent experiments. To preserve generality, FUDGE does not rely on this prefix-checkable property, and neither do our baselines. rhyme sound at the end of x n , and (3) whether a sentence ends with x n . A special token is inserted 10 syllables from the end of x 1: n . 3. PPLM (Dathathri et al., 2019), which uses shallow predictors learned from G 's top-level hidden layer to modify G 's states toward increasing probability of the desired attribute via gradient ascent. We decompose the predictors into the same iambic, rhyme sound, and end-of-sentence predictors as for FUDGE , inserting an additional hidden layer in the shallow predictor when needed to incorporate additional input (the desired rhyme sound and/or number of syllables until end-of-sentence). 4. Shakespeare's original couplet completions. All non-Shakespeare methods use topk sampling with k = 10 . Even though our GPT2-Medium-generated training dataset is completely different from the test domain, and contains essentially zero examples of correct couplets, FUDGE is able to learn the desired attribute. As shown in Table 2, FUDGE greatly outperforms all automated baselines in success rate. Surprisingly, the PPLM baseline achieves zero success. We find that its iambic and rhyme predictors are very poor, so we hypothesize that the relevant information is not easily extractable from the last hidden layer of G . In contrast, FUDGE 's predictors operate directly on the raw text. Funnily enough, FUDGE even matches Shakespeare according to F , although this is largely due to the narrowness of F and should not be taken seriously. 6 Similarly, the grammaticality and perplexity metrics are designed for our automated baselines, and thus assign poor scores to Shakespeare's antiquated and flowery style. FUDGE also maintains relatively fluent generation despite lower grammaticality and perplexity compared to G . See Table 3 for two successful examples. Interestingly, FUDGE also increases diversity compared to G , perhaps due to the difficult constraint F forcing FUDGE to use lower-probability regions of the base distribution P ( X ) . Finally, it is possible (and trivial) to adjust the conditioning strength in FUDGE by multiplying the binary predictors' output logits by a constant. However, this deviates from our Bayesian factorization of P ( X | a ) , and we do not do so. Next, we explore topic control in English language generation. The desired attribute a is to be on-topic for a given topic, such as science or politics. To facilitate comparison with prior work, we largely follow the setup of PPLM (Dathathri et al., 2019): the model is provided an approximation to the topic at test time, in the form of a bag of on-topic words W . The goal is to sample text according to the topic approximated by W , starting from a generic prefix. There are 7 topics (space, politics, military, legal, science, religion, and computers) and 20 prefixes, and the model generates 3 80-token 7 samples from each topic-prefix pair, for a total of 420 generations. Metrics. Unfortunately, we cannot easily construct a rule-based F for being on-topic. Addi-6 We define F using somewhat narrow criteria (Appendix A), which capture only a subset of what Shakespeare considered to be well-written couplets. The purpose of this task is to evaluate FUDGE 's ability to satisfy a difficult well-formedness constraint compared to automated baselines, rather than to perfectly capture the human notion of an iambic pentameter couplet. Thus Shakespeare is marked wrong when he (1) uses archaic pronunciations, (2) uses loose rhymes, (3) elides syllables to fit meter, or (4) uses words missing from the CMU Pronouncing Dictionary. See Appendix A.1 for details. Of course, Shakespeare is only included as a whimsical point of reference; our generations obviously do not hold a candle to Shakespeare's originals. 7 All models and baselines use GPT2 tokenization. tionally, use rate of words in W is a poor metric, because a model can score highly by e.g., simply returning the words in W , without generalizing to the full topic that W approximates. Instead, we adopt a notion of success which requires the model to generalize the bag W to the full topic. The remaining metrics are measures of quality and diversity. 1. Success , the average number of distinct words in a heldout bag W (cid:48) which appear in the model output. Specifically, for each word in W , we add to W (cid:48) the closest GloVe (Pennington et al., 2014) word by cosine similarity, such that the new word does not contain (and is not contained by) any word in W . (This excludes e.g., most plurals.) Usage of distinct words in W (cid:48) measures the model's ability to generalize W to other on-topic words, of which W (cid:48) is a non-exhaustive set. This is our main metric. 2. Grammaticality , identical to the couplet task. 4. Distinctness , defined as in the couplet task. However, it is calculated separately within the 60 generations for each topic, and then averaged over the 7 topics. Additionally, following the evaluation procedure of prior work such as (Dathathri et al., 2019), we run human evaluations via Amazon Mechanical Turk for FUDGE against each baseline, comparing topic control and fluency. For each pairwise comparison, we ask 3 workers to evaluate each of 420 paired outputs. Workers were asked to mark which generation is more on topic (first, second, both, or neither), and to rate each generation's fluency on a Likert scale from 1 to 5. We report the average fraction of outputs marked as on-topic as well as the average fluency rating for each method. FUDGE Instantiation. Since we model topics as bags of words, FUDGE uses a binary predictor B ( x 1: i , w ) which takes a prefix x 1: i and word w , and classifies whether w appears in the future x i : n for n  i . (Since it is desirable to stay on topic even after successfully getting on topic, we use x i : n rather than x 1: n .) Training examples ( x 1: i , w ) are sampled from the same dataset of 10 million GPT2-Medium generations used for the couplet task, and B is trained using noise-contrastive estimation. B On-Topic Text Quality Diversity Method Success  Grammar  Perplexity  Dist-1  Dist-2  Dist-3  G 0.22 0.81 37.1  26.9 0.35 0.78 0.92 FINETUNE 0.28 0.74 24.9  13.7 0.29 0.70 0.88 WDEC 0.14 0.59 33.8  33.7 0.16 0.42 0.55 PPLM 0.48 0.78 43.1  23.7 0.35 0.78 0.92 FUDGE 0.59 0.79 40.7  26.3 0.34 0.75 0.91 Table 4: Topic control results. B from the couplet task. At test time, we can compose individual-word constraints if we assume conditional independence between words (although this may be imperfect). Given a bag of N words { w 1 . . . w N } and prefix x 1: i , we could condition on all words in the bag appearing in the future by adding all log-probabilities log P ( w 1 | x 1: i ) . . . log P ( w N | x 1: i ) to G 's logits. However, topic control does not require every word to appear; perhaps some number  of on-topic words is enough to be on-topic. Therefore, we model the topic constraint as selecting a random subset of  words from the original bag, and requiring that only those  words all appear. Since each of the N words is selected with probability N , the quantity we add to the base G logits is N (cid:80) Nj =1 log P ( w j | x 1: i ) in expectation. In our experiments we use  = 4 , based on a fantasy-topic bag of words used for validation (Appendix C). Baselines. We compare to four baselines. 1. G , the original GPT2-Medium. 2. FINETUNE , which finetunes G on the same inputs used for FUDGE . The future word is given as a prefix for conditioning. At test time, we compute logits for each prefix in the given W and use the average as the true logits, as an ad hoc way to condition on the full W . 3. WDEC , a simple weighted decoding implementation which greedily considers only the immediate next token when optimizing for a . Instead of using B , WDEC just adds a fixed  WDEC to the logit for each word in W . Note WDEC requires a to be well-defined at the token level, so it is not easily transferable to certain tasks (e.g., couplet completion). 4. PPLM (Dathathri et al., 2019), which modifies the activations of G to make the desired bag of words more likely at the immediate next position. We use their method without reranking for fair comparison. All methods use topk sampling with k = 10 , following Dathathri et al. (2019)'s setup. FUDGE achieves the highest success by a substantial margin (Table 4), and outperforms all baselines on human evaluations in both topic relevance and fluency (Table 5). FUDGE simultaneously preserves high quality and diversity according to automated metrics. Table 6 shows two examples. Unsurprisingly, G performs poorly on success. WDEC and FINETUNE also perform poorly, in success and especially in distinctness. WDEC frequently degenerates into repeating the given words in the bag W , despite tuning  WDEC (Appendix C). Space: The issue focused on the original plot, which was about a mysterious ship that would land on Earth, and would lead to humanity's first interstellar expedition. The original plan called for humanity to use the spacecraft to colonize outer space and build the first city on Mars. But this idea fell by the wayside in the final drafts.\n\n"It was just not a very popular idea and it wasn' Politics: The issue focused on whether the two institutions were operating within the bounds set by the constitution and the law.\n\nThe Constitutional Court said that both governments "have a duty to ensure the integrity of the electoral process and its effective administration, especially in light of the current political climate that is threatening the functioning of elections" Table 6: The first output from FUDGE when using the prefix The issue focused on for two topics. Our fine-tuning dataset was built by sampling directly from the original P ( X ) modeled by G to mitigate distribution shift, but it is well-known that language model generations are more repetitive than natural language (Holtzman et al., 2018, 2019). We hypothesize that FINETUNE , being fine-tuned on language model generations rather than natural language, amplifies this repetitiveness. This repetition is reflected in the poor grammaticality for both FINETUNE and especially WDEC . In contrast, FUDGE does not touch the original P ( X ) , largely avoiding FINETUNE 's distribution shift problem on this task. Finally, FUDGE outperforms the strong gradient-based PPLM method, despite requiring access only to G 's output logits. Non-reliance on gradients means FUDGE is also many times faster than PPLM , which takes a few hours compared to FUDGE 's 15 minutes for the full set of 420 generations on our hardware. Sometimes we do not even have gradients: for example, gradients are unavailable in the API for GPT3 at time of writing. Finally, we turn to a somewhat more challenging task, changing formality in machine translation  specifically, from informal to formal. Given a source sentence written in an informal and conversational style, the goal is to output a translation which is also more formal. We test on the Fisher and CALLHOME SpanishEnglish Speech Translation Corpus (Post et al., 2013), a collection of transcribed Spanish conversations with English translations. Both the source Spanish and target English are highly informal and disfluent. Salesky et al. (2019) augment the Fisher dataset with additional parallel English translations, rewritten to be more fluent (and hence more formal); see Table 7 for an example. Our task is to translate the original informal Spanish to into more formal English. However, we assume that Salesky et al. (2019)'s fluent references are unavailable during training. Metrics. The desired attribute a is formality, but we cannot sacrifice the source sentence's meaning. The latter requirement makes generation more constrained than in the couplet and topic tasks, so perplexity and distinctness are less relevant. Instead, we use the following: 1. BLEU Score (Papineni et al., 2002), using two of Salesky et al. (2019)'s fluent references per test example. This is our main metric. 2. Formality , the average probability that the model's outputs are formal, according to an evaluator trained on the Family/Relationships domain of the GYAFC formality dataset (Rao and Tetreault, 2018). The evaluator is an LSTM followed by a linear layer. FUDGE Instantiation. We assume that the attribute a , formality, is conditionally independent from the original conditioning in G , i.e., the meaning of the Spanish input. FUDGE uses a binary predictor B ( x 1: n ) which classifies whether the text starting with prefix x 1: n is written in a formal style. B is an LSTM followed by a linear layer, trained on the Entertainment/Music domain of GYAFC. At test time, FUDGE directly augments G 's logits using log-probabilities from B . G is a pretrained Marian (Junczys-Dowmunt et al., 2018) transformer model for Spanish-English. We evaluate both when G is fine-tuned on the original Fisher training dataset (i.e., using the original targets, not Salesky et al. (2019)'s more fluent targets) as well as zero-shot with no fine-tuning, which is challenging due to the highly informal and disfluent text. Baselines. We compare to two baselines. 1. G , the original machine translation model. 2. G + ST , a pipeline consisting of G followed by a style transfer model. Our style transfer model is T5 (Raffel et al., 2020), fine-tuned on the same GYAFC Entertainment/Music domain that we used to train B in FUDGE . Since we do not assume access to Salesky et al. (2019)'s more formal targets during training, it is difficult to apply PPLM to this task: PPLM 's predictor would operate on the pretrained translation model's hidden states, thus requiring a Spanish-English translation dataset with both formal and informal English. 8 We omit FINETUNE for the same reason. In contrast, FUDGE requires only the original English dataset with formality annotations. All methods use greedy decoding. As shown in Table 8, FUDGE increases the formality of outputs compared to G , even though the test-time formality predictor is trained on a different domain (Family/Relationships, rather than Entertainment/Music). Note that formality unsurprisingly decreases after fine-tuning G , simply due to the informality of the fine-tuning dataset. As in 8 We nevertheless ran PPLM in a somewhat convoluted setup, but found that it performed poorly (Appendix B). the couplet task, one could adjust the strength of the formality control in FUDGE , although this is unprincipled from the view of modeling P ( X | a ) . Moreover, while FUDGE and G achieve similar BLEU after fine-tuning G , FUDGE achieves higher BLEU compared to G when G is not fine-tuned on the Fisher training set. In the latter case, controlling for formality somewhat remedies the struggles of G when not fine-tuned on such disfluent text. In contrast, the G + ST baseline achieves near-perfect formality but less than half the BLEU of G , due to the style transfer model overfitting to the GYAFC Entertainment/Music dataset. This is similar to the distribution shift issue that we observed in topic control for FINETUNE , an issue which FUDGE largely avoids. Nevertheless, there remains substantial room for improvement on this difficult task. FUDGE achieves strong performance on a wide range of different tasks: poetry couplet completion, topic control, and informal-to-formal machine translation. Additionally, FUDGE can easily compose different attributes in a modular fashion: the meter, rhyme, and end-of-sentence constraints for couplet completion, and the individual words within each topic bag for topic control. In principle, FUDGE is applicable to any controlled generation task where we can train discriminators for the desired attribute or attributes. We recognize that strong controlled generation methods have the potential to produce harmful outputs and/or misinformation when used adversari-ally (Wallace et al., 2019, 2020). However, such methods can also be a powerful tool for mitigating harmful biases learned by large pretrained language models (Radford et al., 2019; Brown et al., 2020), for example by detoxifying language (Dathathri et al., 2019; Krause et al., 2020). Overall, we believe it is still beneficial to continue research into general controlled text generation methods such as FUDGE . We thank Daniel Fried, David Gaddy, Eric Wallace, Kevin Lin, Nicholas Tomlin, Ruiqi Zhong, and the three anonymous reviewers for their helpful comments and feedback, which aided us in greatly improving the paper. We also thank the authors of Dathathri et al. (2019) for clarifying our questions about their topic control setup. This work was supported by Berkeley AI Research, DARPA under agreement HR00112020054, and the NSF through a fellowship to the first author. The content does not necessarily reflect the position or the policy of the government, and no official endorsement should be inferred.
objective abstain abstain result abstain result method abstain method abstain objective abstain method abstain objective abstain abstain result objective result other other method other other other other other other other other other other other other other other abstain abstain method method abstain abstain abstain abstain abstain abstain other method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain method method abstain result method method abstain method abstain abstain method result abstain method method abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method method abstain abstain abstain method method abstain method method method abstain method abstain abstain abstain method abstain abstain abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain method abstain method abstain abstain method method method abstain abstain abstain abstain result abstain abstain abstain abstain result abstain abstain abstain method method abstain method other other other other