Stable Style Transformer: Delete and Generate Approach with Encoder-Decoder for Text Style Transfer (2020)

Abstract: Text style transfer is the task that generates a sentence by preserving the content of the input sentence and transferring the style. Most existing studies are progressing on non-parallel datasets because parallel datasets are limited and hard to construct. In this work, we introduce a method that follows two stages in non-parallel datasets. The first stage is to delete attribute markers of a sentence directly through a classifier. The second stage is to generate a transferred sentence by combining the content tokens and the target style. We experiment on two benchmark datasets and evaluate context, style, fluency, and semantic. It is difficult to select the best system using only these automatic metrics, but it is possible to select stable systems. We consider only robust systems in all automatic evaluation metrics to be the minimum conditions that can be used in real applications. Many previous systems are difficult to use in certain situations because performance is significantly lower in several evaluation metrics. However, our system is stable in all automatic evaluation metrics and has results comparable to other models. Also, we compare the performance results of our system and the unstable system through human evaluation.

## introduction text style transfer is a task that generates a sentence while preserving the content in a given sentence but changing the source style. the style of the sentence refers to a predefined class (e.g. sentiment, formality, tense) and the content refers to the rest of the sentence except for the style. lack of parallel data makes text style transfer task difficult. this problem cannot be solved by supervised learning because there are no right sentences. one previous method @xcite @xcite @xcite ) of text style transfer is to learn latent representations to separate style and content from sentences. first, these approaches try adversarial training to learn a disentangled latent representation of the content and style. secondly, a transferred sentence is generated from the decoder by combining the disentangled latent representation and the target style. however, the experimental results of @xcite report that disentangled latent representation through adversarial training is hard to get and not necessary. also, adversarial training is not effective to encode a sentence of various lengths into a vector representation of fixed length. other methods of text style transfer do not depend on disentanglement. @xcite ; @xcite ; @xcite do not attempt to find the disentangled latent representation in the sentence. therefore, sentences with different styles are mapped to the same space. @xcite ; @xcite ; @xcite ; @xcite neutralize sentences by deleting style-dependent attribute markers. remaining tokens resulting from the deletion of attribute markers are style independent, and then the content tokens and a style attribute are combined to generate the transferred sentence. we propose an approach with two stages using delete and generate without adversarial training for disentanglement. (1) attribute markers of a sentence are extracted by using a pre-trained classifier as a delete model. our method is model-agnostic and is not affected by the design of the classifier. attribute markers found in a sentence are deleted. in the method of deleting attribute markers, @xcite deletes attribute markers via a statistical manner using a frequency ratio and @xcite ; @xcite delete attribute markers using attention weights of a classifier. @xcite deletes attribute markers by fusion of the frequency ratio and the attention weights. we introduce an intuitive delete method that uses a change in classifier probability. if a change in classifier probability is significant when limiting certain tokens in a sentence, the token is considered an attribute marker. our method does not need to build attribute dictionaries or define attention weights like previous methods and easily control the tradeoff between content and style. we test our methods on two text style transfer datasets: sentiment of yelp reviews and amazon reviews. evaluation metrics are conducted in terms of content, fluency, style accuracy, and semantic. the content and style accuracy are measured similarly to previous studies. fluency is measured in two ways: general-fluency using pre-trained gpt-2 @xcite and data-fluency using finetuned gpt-1 @xcite . semantic is newly evaluated using bertscore @xcite in this paper. the goal of bertscore is to evaluate semantic equivalence between two sentences. in this paper, we use a pre-trained model gpt and bert @xcite that perform well in natural language processing/generation to evaluate transferred sentences with various automatic evaluations. since automatic evaluations are not perfect evaluations of generated sentences, it is hard to know which system is the best, but we can determine which system has a problem. comparative models are unstable in some evaluation metrics. but our proposed model has stable results for all automatic evaluations and is called sst (stable style transformer). in addition, we first observe a point that can enhance the style controlling ability by generating sentences through latent space walking in the vector space of the style attribute token. ## related work one line of text style transfer research @xcite @xcite @xcite is to separate content and style from sentences through disentangled learning. @xcite uses the vae model to derive the disentanglement of the content between the generated sentence and the original sen-tence through kl loss. @xcite introduce the aligned auto-encoder and the cross aligned autoencoder using learning discriminators. fu et al. (2018) the second line of text style transfer research is not to rely on learning for latent representation. the first approach @xcite @xcite is to find and delete tokens called attribute markers that are highly related to style. @xcite uses the delete method of attribute markers as a statistical method based on frequency ratio, and @xcite ; @xcite use the attention scores of the transformer classifier and lstm classifier, respectively. wu et al. (2019) deletes attribute markers by fusion of the frequency ratio and attention scores. the second approach @xcite @xcite does not attempt to control content and style separately. therefore, sentences with different styles are encoded to gather in the same latent representation space. @xcite ; @xcite are based on the learning method using cycle reconstruction loss. @xcite reported that disentanglement is not easy and that latent representations learned through adversarial training are unnecessary because learned latent representations depend on style. unlike the previous models, @xcite learns dual models in two directions: style1 (e.g. negative) to style2 (e.g. positive) and style2 (e.g. positive) to style1 (e.g. negative) by reinforcement learning. in language model research, the rnn-based language model is weak in long dependency. therefore, the recent study of text style transfer @xcite @xcite has been conducted with transformer @xcite which is known to have good performance in language modeling. @xcite uses a method of using the encoder and the decoder of the transformer, and @xcite uses a method of fine-tuning the decoder to the style transfer datasets with the pre-trained gpt-1 as an initial state. @xcite solved the problem of text style transfer in a similar way to text infilling or cloze by presenting attribute conditional masked language model (ac-mlm) using pretrained bert. in this paper, we chose the first approach (delete and generate) that does not rely on latent representations in the second research line, referring to the results of @xcite . our system has a transformer encoder and decoder because the style transfer task is given input text. if the system uses only a decoder such as @xcite , there is a disadvantage that it cannot include bidirectional encoding of the content token. or, if only bidirectional encoders are used, such as ac-mlm, the position and length of the masking tokens to be filled in a sentence is not flexible. ## approach in this section, we introduce our proposed method. the style transfer problem definition is described in section 3.1. an overview of the model is shown in section 3.2. the proposed generation process is introduced in sections 3.3 and 3.4. the learning mechanism is described in section 3.5. ## conclusion and future work we propose stable style transformer (sst) that rewrites the sentences with delete and generate. sst is a system that can be used in the real world with overall stable results compared to other comparable systems. we show that filtering out unstable systems through human evaluation is expensive, so selecting a stable system through automatic evaluation can be helpful. the proposed direct and model-agnostic deletion method allows the classifier to intuitively delete attribute markers and easily handle the trade-off of content and style. in future work, we will study solutions for the case where attribute markers also contain content in the deletion and generation framework.