PCFG -Based Natural Language Interface Improves Generalization for Controlled Text Generation (2023)

Abstract: Existing work on controlled text generation (CTG) assumes a control interface of categorical attributes. In this work, we propose a natural language (NL) interface, where we craft a PCFG to embed the control attributes into natural language commands, and propose variants of existing CTG models that take commands as input. In our experiments, we design tailored setups to test the model’s generalization abilities. We find our PCFG-based command generation approach is effective for handling unseen commands compared to fix-set templates. Further, our proposed NL models can effectively generalize to unseen attributes (a new ability enabled by the NL interface), as well as unseen attribute combinations. Interestingly, in model comparisons, the simple conditional generation approach, enhanced with our proposed NL interface, is shown to be a strong baseline in those challenging settings.

## introduction with the advancement of large-scale pretraining, language models (lm) are now able to generate increasingly more realistic text @xcite @xcite @xcite . therefore, how to control the generation of lms has become an important research topic. in controlled text generation (ctg), a series of works @xcite @xcite @xcite @xcite propose model frameworks to generate text conditioned on some desired (user-specified) attribute a. these attributes, which depend on the datasets of interest, could be topic, formality, sentiment, etc. an important assumption behind this controlled generation setting is that the attributes are chosen from a fixed set (i.e., they are treated as categorical random variables). although this setting is convenient, it seriously limits the applications of the figure 1 : we explore generation models that take natural language commands as input. for training, we use pcfg to embed categorical control attributes into natural language commands. ctg system: (1) since the attribute set is fixed during training, it would be impossible for the model to generalize to unseen options if used as-is. (2) this interface is not very human-friendly, because it could be difficult for users to navigate through the (possibly long) lists of options. motivated by these limitations, in this work we propose a natural language interface for ctg, illustrated in figure 1 . with this change of interface, the input to the ctg model changes from one-hot vectors to natural language commands (for short, commands). to efficiently train this system and enable it to generalize, we design a probabilistic context-free grammar (pcfg) to embed categorical attributes into a diverse set of natural language commands. using natural language instruction has been explored in recent work @xcite @xcite @xcite . our work differs from theirs in (1) we focus on the task of ctg as opposed to the performance on cross-task generalization, and design tailored scenarios for evaluation. (2) we introduce pcfg for command generation, which has not been explored by previous work. we discuss this relationship in more detail in section 2. the change of interface brings several immediate benefits: (1) natural language inputs enable the system to generalize to unseen attribute options (as long as they can be expressed in natural language). (2) unlike fixed-set template sentences in previous works, the pcfg can generate diverse natural language variation during training, which we will show is crucial for generalization. (3) the input process becomes more natural and interactive to a human user, and it can be linked with, for example, a speech recognition module. with this new interface, we propose variants of several existing ctg systems that take commands as input, and design experiments to compare different ctg models under tailored scenarios. we briefly summarize our main contributions below: ## framework the goal of controlled text generation is to model the conditional distribution p px|aq so that the generated text x satisfies the desired attributes a. a could include multiple attributes (e.g., topic and length), and we will use a i to denote the ith attribute. in the standard categorical setting, the attribute a i are from a fixed set of pre-defined options. we assume there are m attributes of interest (m ď 2 in our experiments). in the next few sections, we describe the pcfg that we craft to embed the categorical attributes, and our proposed nl variants of several existing ctg systems. ## experiments we design experiments to test natural language ctg models' generalization capabilities, where the models need to generalize to (1) unseen commands (2) unseen attribute options (3) unseen combinations of attribute options. additionally, we compare natural language ctg models with their categorical counterparts under the standard full-data setting to test whether the nl interface would degrade the model's performance. ## conclusion in this work, we propose a natural language interface for ctg, where we craft a pcfg to embed categorical attributes into natural language commands. we propose variants of existing ctg models that take commands as input. we design tailored experiments to test the natural language ctg model's generalization capabilities. we show that our pcfg-based command generation approach is effective for handling unseen commands compared to fix-set templates. additionally, our proposed nl models can effectively generalize to unseen attributes, an ability newly enabled by the nl interface. finally, we find the simple prefixlm approach shows robust generalization ability with the nl interface and outperforms fudge-based models, demonstrating significant modeling challenges and potentials with this new interface. we hope our work could motivate further research into this challenging interface for ctg.