How to Control Sentiment in Text Generation: A Survey of the State-of-the-Art in Sentiment-Control Techniques (2023)

Abstract: Recent advances in the development of large Pretrained Language Models, such as GPT, BERT and Bloom, have achieved remarkable performance on a wide range of different NLP tasks. However, when used for text generation tasks, these models still have limitations when it comes to controlling the content and style of the generated text, often producing content that is incorrect, irrelevant, or inappropriate in the context of a given task. In this survey paper, we explore methods for controllable text generation with a focus on sentiment control. We systematically collect papers from the ACL Anthology, create a categorisation scheme based on different control techniques and controlled attributes, and use the scheme to categorise and compare methods. The result is a detailed and comprehensive overview of state-of-the-art techniques for sentiment-controlled text generation categorised on the basis of how the control is implemented and what attributes are controlled and providing a clear idea of their relative strengths and weaknesses.

## introduction in recent years, there has been a surge of interest in developing algorithms and models for controllable text generation @xcite . this research field aims to enable users to generate text with specific attributes, controlling e.g. the text's sentiment, topic, or level of formality. in this survey paper, we focus on stateof-the-art ctg techniques that control sentiment. we provide a comprehensive overview of the existing literature and categorise approaches based on their implementation of control, and which specific attributes they control. our main contributions are as follows: the paper is structured as follows. section 2 summarises two previous related survey papers, while section 3 outlines the scope of the present survey, the method we used for systematic paper selection, and some high-level statistics for the selected papers. the proposed categorisation scheme is described in section 4, consisting of (i) different types of controlled attributes (section 4.1), and (ii) different types of control implementation techniques (section 4.2). section 5 describes the ctg techniques from the surveyed papers in terms of the categorisation scheme, including which attributes are controlled. section 6 compares the different techniques in terms of their generality, performance, and efficiency. we conclude with suggested future directions (section 7), some discussion (section 8) and final remarks (section 9). as part of a general introduction and overview of techniques in pretrained language model (plm) based ctg and evaluation methods, @xcite propose a set of control conditions (semantic, structural, lexical), and broadly group together methods for ctg into finetuning, retraining/refactoring, and postprocessing. the work addresses only transformer-based plms, and distinguishes seven subtypes of methods, based on how the control signal works with the plm. in this survey, we consider all types of methods that have been used for sentiment-controlled text generation, not just transformer-based plms, and we conduct a systematic paper selection process. we provide a categorisation scheme based on control attribute types and control implementation techniques that we use to characterise and compare the selected methods. finally, we provide comparisons in terms of performance and efficiency. ## survey scope and paper selection this paper aims to fill a gap in the current literature by surveying recent models applied to controllable text generation (ctg) with a specific focus on sentiment control. furthermore, we propose a categorisation of the selected papers based on controlled attributes, and how the control is implemented. we conducted an otherwise unrestricted search on the acl anthology using the keywords "controllable text generation," "controlled text generation" and "controlling text generation," as shown in figure 1 . after removing duplicates, authors' profiles, and non-paper resources, we obtained 270 papers. from this original pool, we discard papers that are not strictly related to ctg, such as papers that mention ctg but do not explore the task. next we only retain papers which present a new model or control method, discarding those that e.g. only present a new dataset or perform a comparative study. after filtering, we are left with 88 papers from which for the present survey we select all papers implementing sentiment control, thus giving us 18 papers. we add one more relevant paper @xcite not present in the acl anthology that was cited in our pool of papers. the 19 papers span the period 2019 (1 paper), 2020 (4 papers), 2021 (3 papers), and 2022 (11 papers), illustrating the rapidly growing interest in this topic, as shown in figure 2 . papers report work using complete training techniques (3 papers), model fine-tuning (3), disentanglement (1), modification of token distribution (6), and hybrid techniques (6). in 10 of the papers, multiple attributes are controlled simultaneously, whereas in 9, single attributes are controlled one at a time. 14 papers are designed for free text generation (rather than a specific task), 2 methods are for story generation, 2 for conversational agents, and one for topic to essay generation. we return to properties of techniques in more detail in section 6 and ## categorisation scheme we collect all selected papers and annotate them based on different aspects, such as control attributes addressed and architecture used to solve the control problem with a specific focus on how the control is implemented and embedded in the proposed architecture. using the collected information, we cluster control attributes and models to create a categorisation scheme for sentiment-controlled text generation in which we specify types of controlled attributes and types of control implementation. the created categorisation scheme will be used to categorise and describe the studied papers. ## characterisation of ctg techniques in the remainder of this section, we summarise each of the 19 papers in our survey in more detail, grouped together in terms of the control implementation technique used. @xcite propose a text gan composed of one generator and two discriminators. the generator is a relational memory with self-attention @xcite with the objective to generate text consistent with the specified control attribute. the syntax discriminator distinguishes between real and generated sentences, while the semantic discriminator assesses whether the generated sentence expresses the control attribute, e.g. positive sentiment. to solve the well-known problem of differentiation in gans applied to text, the gumbel-softmax trick @xcite is applied. this approach enables control only for one attribute at a time and it has been evaluated on sentiment and topic control. ## comparison of different techniques in this section, we compare the methods from the last section in terms of performance, efficiency, and generality. ## discussion in this section, we discuss issues and trends observed in the studied techniques, which suggest possible future directions for the field. lack of a standard evaluation procedure. we observe that it is difficult to directly compare the performance of models evaluated on the same dataset using the same metrics, due to the usage of different methods for the metrics' evaluation. in fact, considering the six methods evaluated with pplm prompts (section 6.1), we observe that each method has been evaluated using a different classifier to calculate the ar metric. the usage of different classifiers affects the final result of the metric, thus requiring that every work recomputes all the evaluations to have a fair comparison with previous work. furthermore, we observe that the papers use different datasets for the evaluation, making the comparison between papers even more difficult. lack of combination of different control attribute types. we observe that it is mainly topic and toxicity that are explored in combination with sentiment. while topic is a content control attribute, other content control attributes, such as data or set of words, are not explored in combination with sentiment, suggesting that a possible future direction is to investigate the combination of such control attributes. furthermore, we see that syntactic control is not explored in combination with sentiment. moreover, there are not many combinations of different attributes in the same category. for example, sentiment and toxicity (polarity control) are used together to enable multiple control in just two papers @xcite ), but not many other attributes are widely explored. ## conclusion we have reported a systematic survey of sentiment-control text generation techniques spanning the years 2019-2022. we proposed a categorisation scheme to analyse the studied papers based on the control attributes used and on how the control is implemented. we compared the papers based on their performance, generality and efficiency. while analysing the selected papers, we observed some issues and trends, such as the lack of a standard evaluation procedure and the lack of combinations between different control attribute types. hanqing zhang, haolin song, shaoyu li, ming zhou, and dawei song. 2022. a survey of controllable text generation using transformer-based pre-trained language models. arxiv preprint arxiv:2201.05337. xiang zhang, junbo zhao, and yann lecun. 2015. character-level convolutional networks for text classification. in advances in neural information processing systems, volume 28. curran associates, inc. yukun zhu, ryan kiros, rich zemel, ruslan salakhutdinov, raquel urtasun, antonio torralba, and sanja fidler. 2015. aligning books and movies: towards story-like visual explanations by watching movies and reading books. in proceedings of the ieee international conference on computer vision, pages 19-27.