Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer
Paper · 2018 · Juncen Li, Robin Jia, He He et al.
Summary
Changing a review from favorable to unfavorable should leave the reader able to tell what the reviewer was discussing. A complaint about a product’s screen and a compliment about its screen can share a subject even when they disagree about whether its size is suitable. The difficulty is teaching a system to make that particular change from collections of ordinary reviews. The collections supply sentiment labels, but they supply no corresponding rewrite for each review. Can a system use those labels to learn how to alter the requested attribute and still leave the rest of the message recognizable? That is the question the paper poses.
The authors start with a clue that is visible in the text. Often a small stretch of words carries much of the evidence for a sentence’s label. They count n-grams, or contiguous stretches of words, across labeled collections to identify phrases associated with each attribute. Removing phrases associated with the original label leaves an ordered sequence of words that serves as a working representation of the content. That sequence can guide a search for a sentence with a different label that discusses similar things. The search matters because a negative description of food requires different wording from a negative description of someone’s behavior, even though both descriptions would satisfy the same sentiment label.
The paper compares several ways to use these ingredients. RetrieveOnly returns a sentence from the desired collection. TemplateBased borrows its marked phrases and puts them into the source sentence. DeleteOnly uses a recurrent generator guided by the surviving words and the requested label. DeleteAndRetrieve gives a recurrent generator actual phrases from a retrieved example, alongside the surviving source words. Both learned systems train by reconstructing existing sentences. DeleteAndRetrieve sometimes receives slightly altered phrases during reconstruction, giving it practice producing a fluent sentence when its inputs do not fit together exactly.
The authors test sentiment reversal on Yelp business reviews and Amazon product reviews, and rewrite factual image captions in romantic or humorous styles. Human judges look for fluency, preservation of source content, and the requested attribute in the same output. Averaged across the datasets, the strongest previous adversarial system succeeds on 12% of inputs, the paper’s simple retrieval baseline on 23%, and its best learned system on 34%. DeleteAndRetrieve leads the automatic systems in the human comparison on each dataset, while human rewrites receive substantially stronger judgments. On Yelp, changing the phrase deletion threshold at test time moves the system along a tradeoff between stronger measured attribute change and greater overlap with human rewrites.
The automatic scores offer an incomplete picture of that progress. The Amazon attribute classifier can mistake a product category’s usual sentiment for the sentiment of a newly written review, and BLEU gives little indication of whether the resulting sentence is grammatical. The authors release code and data, including human rewrites newly collected for Yelp and Amazon, and make the experiments available through CodaLab.
Deep dive: Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer
Delete, Retrieve, Generate rewrites sentiment and style by removing telltale phrases, finding relevant examples, and using them to guide a new sentence. · about 36 minutes to read
The problem and its context
What a successful rewrite must preserve
Text attribute transfer places a preservation requirement on text generation. The input already says something, and the requested attribute tells the system which aspect of its expression to change. A generator capable of writing plausible positive reviews has solved only part of the problem. If the input concerns the taste of the food, a polished compliment about the service would be a poor rewrite. The system must keep track of the entity or property being discussed while changing what the original wording communicates about it.
The boundary between an attribute and the remaining content is easiest to see when a short expression carries an evaluation. The paper uses a review of chicken to illustrate this. An evaluation of its flavor can change while the sentence continues to discuss the same dish. Yet the evaluative word also tells the reader which property of the dish is at issue. Removing it may therefore discard evidence about both sentiment and topic. What remains in the sentence can help recover the missing distinction. A phrase about flavor will generally fit that context more naturally than a criticism of someone’s manners. The approach rests in part on how often the surrounding words supply such evidence.
The task also includes attributes that are less easily described as a reversal. A factual caption can acquire humorous or romantic language without ceasing to describe the same scene. The direction of editing in that setting differs from the direction in a review. Sentiment reversal starts with an attribute the system wants to remove or redirect. A factual caption can be treated as content to which stylistic material will be added. Both tasks call for control over the output, with different assumptions about how much of the source is already suitable for reuse.
Attribute preservation and content preservation are therefore questions about a particular input and output together. A sentence can be fluent and express the requested attribute while disappointing on fidelity. It can also remain close to its source and carry over the attitude it was supposed to change. The paper’s formulation makes these distinct failure modes possible from the outset. A useful system needs some way to address both during generation, and a useful evaluation needs a way to recognize each.
Learning from separate collections
A parallel training collection would give a system examples of the desired operation. Each source would come with an alternative that discusses the same material under a different attribute. A learner could then observe where human writers made edits, how they adjusted surrounding words, and which parts they left alone. The paper works with a weaker form of evidence. Given a sentence and its label, a system knows which kind of writing it exemplifies. A sentence elsewhere in the opposite collection could concern an entirely different subject.
That difference makes the transfer underdetermined. The fact that a phrase appears often in positive reviews gives some reason to use it in a positive rewrite, but does little by itself to show where it belongs. Similarly, a positive and a negative sentence that share a product name may make judgments about different features of that product. The paper’s method supplies a preference for local edits and uses the words around those edits to narrow the choices. This preference is an inductive bias, an assumption that steers learning when the labels alone admit several explanations.
The authors use unaligned to describe the training situation. The label tells them what attribute a sentence exhibits. An alignment would tell them which sentence in another collection expresses corresponding content. That distinction explains how they can learn from labeled data while treating the separation of content and attribute as an unsupervised part of the task. It also explains how human rewrites can be used for evaluation. A reference available after training can help assess the output even when the learning procedure has received only separate collections of labeled sentences.
Earlier ways of steering generation
The authors describe adversarial training as a common way to approach unaligned transfer. An encoder maps the sentence to a vector, a list of numbers intended to represent it. A discriminator tries to recover the original attribute from that representation, and training pushes the encoder to make that prediction difficult. A generator is still expected to recover enough from the vector to produce a sentence about the original subject. The training objective thereby asks a learned representation to carry one kind of information and suppress another.
These studies differ in where they apply that pressure. In Style Transfer in Text, the discriminator examines the representation of the input sentence. A generator can use a learned attribute representation, or the system can use a separate decoder for each attribute. In Style Transfer from Non-Parallel Text by Cross-Alignment, the discriminator examines states inside the decoder. Its training signal encourages generated text to resemble writing from the target collection at the population level. The paper also points to earlier work on the difficulty of training adversarial systems. Improved Techniques for Training GANs
The authors describe other ways to provide a training signal. Toward Controlled Generation of Text uses a classifier to guide generation towards attributes such as sentiment or tense within a variational autoencoder. Work on unsupervised machine translation suggests another way to constrain a rewrite. If a sentence is converted into another language and then converted back, a training objective can reward recovering the original. The paper describes methods that begin with bilingual word vectors and use back-translation to improve those initial correspondences. The authors raise this line of work as a possible source of improvements to their own approach. Unsupervised Neural Machine Translation · Unsupervised Machine Translation Using Monolingual Corpora Only
Earlier work also gives the authors reasons to look directly at words and short phrases. The paper draws a connection to the use of simple word features in sentiment classification, where how often an expression appears under different labels can be informative. It also cites linguistic studies in which characteristic expressions help distinguish kinds of writing. The transfer method turns that evidence into a decision about what to edit: an expression useful for identifying a label is a candidate for removal when the goal is to change that label. The remaining words supply a starting point for reconstruction. Baselines and Bigrams · Linguistic Models for Analyzing and Detecting Biased Language · The Effect of Different Writing Tasks on Linguistic Style
The method, step by step
Deciding what to keep before deciding what to write
Consider the review about chicken. Once the evaluation has been removed, the surviving words provide a frame for a new description. A search among negative reviews can look for related frames and find how reviewers have criticized similar food. That search offers possible wording, while the original sentence still says which dish is under discussion. Each system in the paper decides how much to trust the example it finds. One adopts the entire example, another puts its phrases into fixed locations, and the most flexible uses those phrases as evidence while composing a sentence.
This division of labor is important. The deletion step can make a useful decision even when it leaves an incomplete sentence. Retrieval can find an informative expression even when the rest of the retrieved sentence talks about something else. Generation is where those pieces must become a grammatical, appropriate output. Only some variants perform all these operations. DeleteAndRetrieve, the complete version, follows the path below.
How DeleteAndRetrieve rewrites a sentence
The steps in order.
The labeled collection
The training corpus can be written as a collection of sentence and label pairs.
𝒟 = {(x₁, v₁), …, (xₘ, vₘ)}
Here 𝒟 is the labeled corpus and m is its number of examples. The subscript identifies an example, with xᵢ its sentence and vᵢ its label for any index i. The labels belong to 𝒱, the set of attribute values. In a sentiment corpus, those values can be positive and negative. The braces describe the collection, and the ellipsis stands for the intervening examples. The indices distinguish examples and do not align sentences across attributes.
The authors use a label to select the sentences available for estimating phrase counts and retrieving examples.
𝒟ᵥ = {x : (x, v) ∈ 𝒟}
In this expression, 𝒟ᵥ is the collection associated with label v, and x is any sentence. The braces gather the sentences that satisfy the condition after the colon. Membership, written ∈, means that the sentence and label pair occurs in 𝒟. At inference, x denotes the particular source sentence to rewrite. Its source attribute is written vₛᵣ꜀ and the requested target is vₜ𝓰ₜ. The output sentence is y. The preservation requirement concerns the material in x that is independent of the change from the source to the target value.
Deleting phrases associated with the source label
The authors identify candidate markers by counting occurrences, taking into account the label of the collection in which the phrase occurs. The intuition applies to a single word and to a short sequence. A multiword candidate can capture an expression whose components would be less revealing by themselves. Conversely, a frequent phrase used throughout the collections is less useful for explaining why a sentence received one particular label. The comparison is between the count within that label and the total count under the other labels.
s(u, v) = (count(u, 𝒟ᵥ) + λ) / (Σᵥ′∈𝒱, ᵥ′≠ᵥ count(u, 𝒟ᵥ′) + λ)
The score s(u, v) is the salience of candidate phrase u for attribute v. The function count takes a phrase and a collection and returns how many times the phrase occurs in that collection. The numerator uses 𝒟ᵥ, the collection for v. In the denominator, Σ adds counts over labels v′ in 𝒱 such that v′ differs from v, as indicated by ≠. The plus signs add λ, the smoothing constant, to the numerator and to the summed denominator. The slash denotes division. Smoothing keeps the ratio defined when a phrase has no count outside the selected label and tempers the effect of small counts. The formula uses occurrence counts directly. Corpus sizes do not appear as additional divisors.
A phrase qualifies as a marker for v when its salience is strictly greater than γ, the chosen threshold. The authors search spans up to 4 words and use λ equal to 1. The threshold depends on the dataset. The reported values are 15 for Yelp, 5.5 for Amazon, and 5 for Captions. The authors look at the resulting markers and make some adjustments using the development sets. The threshold regulates how readily the procedure treats a phrase as indicative of an attribute. Lowering it makes less distinctive expressions eligible for deletion, while raising it reserves deletion for stronger count imbalances.
Let a(x, vₛᵣ꜀) denote the markers of the source attribute found in x. Let c(x, vₛᵣ꜀) denote the words left in their original order when those markers have been deleted. In the chicken example, the flavor judgment is a deletion candidate, while the name of the dish and the surrounding construction remain available. Calling the remainder content gives the system a practical representation. It is the outcome of a count and a threshold, and can include sentiment evidence the procedure missed. Similarly, the deleted words can have carried information about the dish that the surrounding context only partly recovers.
The authors relate the scores to features a Naive Bayes classifier could use. A phrase that strongly favors one label is useful evidence for a classifier trying to choose that label. Removing it deprives such a classifier of a useful clue. Here the scoring rule is established from corpus counts before the sentence generator is trained. The generator receives a surface separation already made for it, and its reconstruction objective does not tune the counts in order to hide attributes from a jointly trained discriminator.
Retrieving an example with related content
A search through the target collection can narrow the choice of phrases. The source’s surviving words provide the query. For a candidate in the target collection, the system also isolates the words that remain after removing markers of that candidate’s own label. The comparison is thus between content sequences derived on both sides. The label determines which collection can supply a sentence, and the distance determines which sentences in that collection are useful neighbors.
xₜ𝓰ₜ = argminₓ′∈𝒟₍ᵥₜ𝓰ₜ₎ d(c(x, vₛᵣ꜀), c(x′, vₜ𝓰ₜ))
The retrieved sentence is xₜ𝓰ₜ. The notation argmin selects the candidate x′ with the smallest distance. Candidates belong to 𝒟₍ᵥₜ𝓰ₜ₎, the collection labeled with the desired attribute vₜ𝓰ₜ. The distance function d takes the content of source x under vₛᵣ꜀ and the content of candidate x′ under vₜ𝓰ₜ. The function c is the deletion-based content extraction just described. The result is a sentence from the target collection, so the method can subsequently recover its markers or simply return that sentence.
The paper tries two ways to compare the sequences. In one, shared words contribute to a weighted overlap score. TF-IDF gives a word credit for its occurrence while reducing the influence of words common across the collection. This helps distinguish shared words that identify a subject from words likely to occur in unrelated sentences. TemplateBased and DeleteAndRetrieve use this overlap approach. The other way compares content vectors using Euclidean distance, the straight-line distance between the vectors in their coordinate space. RetrieveOnly uses this option. The authors report similar results from the two scoring functions without giving a numerical comparison in their account of that choice.
A close content match is evidence about the relevance of the retrieved sentence. It does not certify that each marker from that sentence belongs in the source. For example, retrieving a negative review that discusses chicken can yield a word applicable to flavor, but the word’s grammatical role still depends on the construction in which it appears. Retrieval addresses which expressions are plausible enough to consider. The method chosen for the final step determines how rigidly the system uses them.
Four ways to produce the output
RetrieveOnly makes the retrieved sentence the final answer. Every word in the result comes from an example written under the desired label. There is no new sentence construction to introduce an awkward splice. The cost of that simplicity is giving up direct control of which source details survive. A good neighbor may be an adequate rewrite. If the collection offers only loosely related material, the output can read naturally and express the requested sentiment while discussing something different. As a baseline, RetrieveOnly shows how far a surface separation followed by search can go by itself.
TemplateBased treats the source as an editable frame. It replaces the deleted spans with markers from the retrieved example, taking the missing locations and replacements in left-to-right order. If a location has no remaining replacement, it is filled with an empty string. The surrounding source words are retained. Some phrases can occupy the same grammatical position, as the authors show with love and don’t like. A marker might also have been extracted from a different construction and fail to fit the available slot. Whole-sentence similarity can help find useful words, but the overlap score does not establish that a replacement has the appropriate syntax for a particular gap.
DeleteOnly keeps the surviving words and supplies the requested attribute as a label. Its recurrent neural network reads the content sequence in order, updating a hidden state as it processes each word. The final state is a vector representing the sequence for the decoder. The label also has a learned vector, called an embedding. The system concatenates the content vector and the label embedding, placing their coordinates together in a single input to the decoder. The recurrent decoder then produces an output sequence. It can reconstruct missing function words or choose a different phrasing when the surviving words would make a literal splice awkward. Its lexical choice for the attribute comes from what it learned to generate with that label and content.
DeleteAndRetrieve replaces the label embedding with a representation of the phrases supplied by a retrieved example. One recurrent encoder processes the source content, and another processes the retrieved sequence of attribute markers. The decoder receives their combined vectors. It can use evidence from the markers where it fits, revise surrounding words, and decide where in the output to express the attribute. It is also free to generate words that did not appear in either input sequence. The retrieved material is a condition on generation and does not impose a requirement to copy each phrase.
The paper relates this use of retrieved text to Generating Sentences by Editing Prototypes. What the current method borrows is especially selective. The content input comes from the sentence being rewritten, and the retrieved phrases offer a way to express the new attribute. That makes the identity of the retrieved example a potential control on the wording. The authors illustrate the distinction with good and fantastic: each can convey positive sentiment, but the choice communicates a different degree of approval. A plain positive label supplies neither expression explicitly.
Learning to reconstruct a sentence
The learned variants rely on examples for which the desired complete output is already available: the sentences in the training corpus. Each sentence is split into content and marker information by the deletion rule. The training target is the original sentence. This is an autoencoding setup, meaning that an input derived from the sentence is used to reconstruct that same sentence. The learning problem for DeleteOnly is to make the original wording probable given its surviving words and original label.
L(θ) = Σ₍ₓ,ᵥₛᵣ꜀₎∈𝒟 log p(x ∣ c(x, vₛᵣ꜀), vₛᵣ꜀, θ)
Here L(θ) is the objective to maximize and θ is the collection of trainable parameters. The summation Σ runs over the sentence x and its original attribute vₛᵣ꜀ in the corpus 𝒟. The function p assigns a probability to the original sentence x, conditional on the quantities after the vertical bar ∣. Those quantities are the surviving sequence c(x, vₛᵣ꜀), the original label vₛᵣ꜀, and the parameters θ. The logarithm log turns each conditional probability into the contribution being summed. At test time, the content is obtained from the source, while the label supplied to the decoder is the requested value.
The same training plan needs an adjustment for DeleteAndRetrieve. If both the content and the markers come untouched from the sentence to be reconstructed, the system can succeed by learning to put those pieces back together. At test time the phrases come from another sentence, and their wording may require different surrounding words. A system that learned only how to reconstruct from perfectly compatible parts has received little practice in making that adjustment.
The authors introduce noise into the marker input. Each marker is independently considered for alteration with probability 0.1. An eligible replacement carries the same attribute and is at word-level edit distance 1 from the original marker. If such a replacement exists, one is selected at random when the marker is to be altered. A word-level edit counts a change to a word, so dropping the opening word of was very rude can yield very rude. The original content sequence and complete training target stay fixed. The altered input therefore gives the decoder a reason to recover fluent wording even when the supplied pieces are slightly different from those found in the original.
L(θ) = Σ₍ₓ,ᵥₛᵣ꜀₎∈𝒟 log p(x ∣ c(x, vₛᵣ꜀), a′(x, vₛᵣ꜀), θ)
The same L and θ denote the reconstruction objective and the parameters of this variant. The summation again runs over labeled examples in 𝒟. The expression a′(x, vₛᵣ꜀) is the marker sequence after the random perturbation, with the prime distinguishing it from the unaltered markers a(x, vₛᵣ꜀). The conditional probability p is for the original x, given the surviving content, perturbed markers, and θ, and log is applied before the contributions are added. The decoder receives marker wording in place of a separate label embedding. At test time, the analogous input comes from retrieval under the requested label. The training noise prepares the system for some mismatch between pieces without simulating a complete transfer to the opposite attribute.
Settings and output selection
The recurrent components use 128-dimensional word embeddings and a single-layer gated recurrent unit, or GRU, with 512 hidden units for each encoder and the decoder. A GRU uses gates to control how information from earlier positions influences its current state. The authors use maxout as the activation function, taking a maximum over candidate activations. Trainable parameters start from a uniform distribution between −0.1 and 0.1. Optimization uses Adadelta with minibatches of 256 training examples. ADADELTA
The learned systems decode with beam search of size 10. During construction, beam search keeps a limited collection of promising partial sentences so that a single early word choice need not determine the output. DeleteAndRetrieve also retrieves the top 10 sentences, a separate use of the same count. It generates with markers from each retrieved example and chooses among the resulting outputs with a separately trained target-domain scorer. That scorer learns from the target-domain training text and assigns a perplexity to the completed sentence. The method chooses the lowest perplexity, favoring wording the scorer finds more predictable in that domain. Ranking retrieved neighbors by content and ranking generated sentences by perplexity are distinct decisions. The latter adds a preference for likely target-domain wording, while the supplied source content remains the generator’s principal evidence about what must be preserved.
Experiments and results
Three datasets with different kinds of supervision
The authors randomly split each dataset into training, development, and test sets. Yelp consists of sentences from business reviews, and Amazon consists of sentences from product reviews. Each review sentence has a positive or negative label. The requested operation on these datasets is to reverse the sentence’s sentiment. For a system that retrieves examples, this means looking in the opposite sentiment collection. It need not find a review of the same business or product to obtain a useful expression, though preserving the relevant subject remains part of the evaluation.
Captions contains descriptions of images with factual, romantic, or humorous labels. Its task begins with a factual sentence and asks for either of the expressive styles. The dataset has descriptions of the same image written in different styles, so it supplies alignments that the review collections lack. The authors reserve those alignments for evaluation. During training, the learned systems reconstruct romantic and humorous sentences, using the same general procedure for deriving content and marker information from existing text. At test time, the authors assume that factual inputs are already content and skip deletion of source markers. The generator is therefore being tested on adding the target style to factual wording.
For Yelp and Amazon, crowdworkers write reference outputs for all test sentences. They are asked to flip the sentiment while preserving what the sentence discusses. These references are used to assess how system outputs compare with the work of human editors. The image caption references come from the existing captions aligned by image. That difference matters when interpreting surface overlap. A person explicitly editing a review has the source wording as a starting point. A styled caption about the same image can express the scene in a different way and still be an appropriate reference.
The previous systems in the comparison
StyleEmbedding, MultiDecoder, and CrossAligned are the published adversarial systems in the evaluation. StyleEmbedding uses a discriminator to predict the input label from an encoded sentence, and learns a representation from which a decoder can reconstruct the original while making the discriminator’s job harder. Its discriminator is a multilayer perceptron, which maps the vector through successive learned transformations. Its decoder is a recurrent network of the long short-term memory type, or LSTM. MultiDecoder uses a similar division by assigning each possible value of the attribute its own decoder.
CrossAligned puts the discriminator on the sequence of decoder states. It compares the states produced during generation with those produced when real target-domain sentences are supplied as the decoder’s outputs. The adversarial signal asks the decoder to make those sequences of states hard to distinguish. It thus applies a constraint on what generated sentences broadly resemble. The comparison with the paper’s variants tests whether making attribute-bearing phrases explicit can yield better rewrites than relying on that kind of learned separation or alignment.
How human judges assessed the outputs
The main evaluation asks crowdworkers to judge every tested system’s output for the same source and requested attribute. The same worker sees the competing outputs for that item. The worker assigns a score from 1 to 5 for grammaticality, a score for preservation of source content, and a score for match to the requested attribute. An output counts as successful only if it receives 4 or 5 on each criterion. Strong performance on a single dimension cannot compensate for a weak rating on another under this rule.
The evaluation uses 400 randomly sampled examples for each dataset, with 200 for each target attribute. For reviews, this design represents both requested sentiments. For Captions, it represents the two style requests starting from factual sentences. The overall success rate measures the fraction of evaluated outputs that meet all the requirements at once. The individual ratings still matter because two systems can arrive at a similar success rate through different weaknesses. A system that returns an intact retrieved sentence, for example, has a different route to failure from a system that copies the source frame and inserts an ill-fitting phrase.
Human-rated overall success averaged across Yelp, Amazon, and Captions
The best learned variant leads the retrieval baseline and the strongest previous adversarial system.
The numbers
| System or setting | success % |
|---|---|
| Best previous adversarial system | 12 |
| RetrieveOnly | 23 |
| DeleteAndRetrieve (this paper) | 34 |
The chart gives the human success figures the authors report averaged across datasets. The best previous adversarial result is 12%, the simple retrieval baseline reaches 23%, and DeleteAndRetrieve reaches 34%. In the dataset-specific human comparisons, both RetrieveOnly and TemplateBased have higher success rates than the previous adversarial systems. DeleteAndRetrieve leads the automatic systems on each dataset. Human references receive substantially better judgments, which puts the best automatic result in perspective. The gain over the earlier systems coexists with many cases in which at least one requirement is still missed.
These averages describe performance under the paper’s rating procedure. The authors observe that a judge’s assessment depends in part on the other outputs in view and the examples used to explain the task. Showing the system outputs together gives the judge a shared basis for comparing them. The instructions and examples differ by dataset, however, so a score in one domain cannot be read as directly equivalent to the same score in another. The pooled figures describe the reported comparison across the tasks. The within-dataset ordering gives a firmer interpretation of which system the judges preferred on a given task.
What the automatic scores measure
The first automatic measure uses a separate text classifier for each dataset. It is trained on the same training data as the systems under evaluation and predicts a sentence’s attribute. A bidirectional LSTM processes the sentence from both directions. Average pooling combines its outputs into a sentence vector, and training minimizes logistic loss to make the correct attribute more probable. The reported classifier score is the percentage of generated sentences assigned the requested label. It measures agreement with that classifier on generated text and has no direct test of whether the sentence retains its original subject.
The second measure compares an output with a human reference using BLEU. The score rewards overlap in wording, so it can register when a system preserves words a human editor also chose to keep. It is sensitive to the particular phrasing in the reference, and it can miss preservation expressed through different wording. Conversely, a sentence may retain much of the reference vocabulary while joining the words poorly. This matters for a copying and slot-filling system, which can have substantial overlap even when the inserted expression makes the result awkward.
The authors compare these scores with human ratings at the system level using Spearman correlation, which assesses whether the ranking by one measure tends to follow the ranking by another. They compare classifier score with human judgments of the attribute and BLEU with human judgments of content and grammar. Some relationships are stronger than others, and their strength varies by dataset. On Amazon the classifier score shows no meaningful relationship to human attribute ratings. The authors find that some product genres are reviewed predominantly under one sentiment in training. When a transfer system writes a negative sentence about a kind of product usually discussed positively, the association learned from the training set can work against recognizing the sentence’s actual sentiment.
BLEU also shows a weak relationship with human grammaticality judgments. This helps explain why automatic scores can give a favorable impression of TemplateBased despite its awkward combinations. The automatic metrics probe different pieces of the task, and the human evaluation supplies the joint test that those metrics lack. The authors treat the scores as aids to development and use the ratings to assess whether a fluent output preserves the source and achieves the requested change together.
What the ablations show
What changes when the generator receives retrieved phrases
The paper offers controlled system comparisons and analyses. The closest comparison to removing a component is DeleteOnly against DeleteAndRetrieve. Both start with the same deletion procedure, encode the surviving words with a recurrent network, and use a recurrent decoder to write the sentence. DeleteOnly conditions the decoder on a learned label embedding. DeleteAndRetrieve supplies an encoding of specific retrieved markers. This comparison asks what happens when the decoder can see examples of attribute wording that are relevant to its input.
The authors report that retrieved markers help particularly when an attribute admits a wide range of expressions, as in Captions. A style label names the requested class but leaves a range of decisions about what detail to add and how to present it. Retrieved words can give the generator a more concrete direction. The paper observes longer outputs with more specific descriptions of the attribute in this setting. The meaningful part of that observation is the specificity: the extra words can express a recognizable style in connection with the scene, rather than merely mark the class in a generic way.
This is a comparison of systems with different conditioning procedures. DeleteAndRetrieve also uses noise during reconstruction and compares candidates produced from different retrieved examples with a target-domain scorer. The reported advantage therefore applies to the complete procedure. The experiment does not furnish an independent numerical estimate of the contribution of retrieved wording, denoising, and final candidate selection. The architecture and example outputs explain how the pieces could help, while the human results establish how well the combination worked.
What copying preserves and what it gives up
RetrieveOnly and TemplateBased show the consequences of putting strict constraints on different parts of the output. RetrieveOnly inherits a whole sentence from the desired collection. Its grammaticality and attribute ratings benefit from returning existing writing, but it depends on the collection containing a comparably relevant sentence. When a close enough neighbor is absent, the best candidate under the distance function can still change a detail the evaluation expects to survive. This failure arises at the level of choosing what sentence to output, even when the chosen sentence is entirely readable.
TemplateBased fixes the words outside the deletion spans. That gives it a direct way to preserve what the method classified as content. It also restricts the possible attachment and placement of the new phrases. If the chosen marker needs a different construction, the system has little room to repair the surrounding language. The authors attribute its grammatical mistakes to this unsmoothed combination. The recurrent variants can change small words or move the expression within the sentence, which lets them negotiate a fit where fixed replacement fails. Their ability to adjust the phrasing also means that content preservation must be measured on the result. It cannot be inferred from the fact that the generator was given the surviving words.
The comparison with adversarial systems exposes a related difficulty from the other direction. In the authors’ analysis, CrossAligned and MultiDecoder tend to produce frequent target-attribute sentences that bear only a weak relationship to the input. StyleEmbedding tends to produce paraphrases of the input, which the authors interpret as evidence that its representation still carries some of the original attribute. These are different ways to satisfy part of the objective and miss the rest. The phrase-based systems give the decoder more direct evidence about the material it is supposed to keep, and their deletion rule makes an explicit attempt to remove the strongest evidence for the original label.
Whether human editors make the predicted kind of change
The human references also let the authors test the assumption behind deletion. For each source and reference, they check how much of the proposed content survives and how much of the proposed attribute wording changes. They average fractions over test items so that the measure describes what happens in a typical example under the paper’s counting rule.
S꜀ = (1 / |𝒟ₜₑₛₜ|) Σ₍ₓ,ᵥₛᵣ꜀,ᵧ*₎∈𝒟ₜₑₛₜ (|c(x, vₛᵣ꜀) ∩ y*| / |c(x, vₛᵣ꜀)|)
Here S꜀ is the average content-word preservation rate and 𝒟ₜₑₛₜ is the test set. In the averaging factor, |𝒟ₜₑₛₜ| is the number of test items, and Σ adds a contribution for each test triple. Each triple contains the source sentence x, its source attribute vₛᵣ꜀, and the human reference y*. The star marks reference wording written by a human. The function c gives the source’s surviving content sequence. In the inner fraction, ∩ denotes overlap with the reference, and vertical bars count non-stopwords, omitting the common words excluded by that counting procedure. The fraction therefore measures what share of the source’s proposed content words also occurs in the rewrite.
Sₐ = 1 − (1 / |𝒟ₜₑₛₜ|) Σ₍ₓ,ᵥₛᵣ꜀,ᵧ*₎∈𝒟ₜₑₛₜ (|a(x, vₛᵣ꜀) ∩ y*| / |a(x, vₛᵣ꜀)|)
In this expression, Sₐ is the average change rate for words in the proposed attribute markers. The function a gives those markers for x and vₛᵣ꜀. The inner fraction counts how many of their non-stopwords also appear in the human reference y*, using ∩ for overlap and bars for the word count. The sum ranges over the same test triples, and division by |𝒟ₜₑₛₜ| averages over test items. Subtracting that average from 1 converts word retention into word change. A high S꜀ indicates that human editors often keep the proposed content words. A high Sₐ indicates that they frequently change words the system identifies as attribute-related.
For the test references, S꜀ is 0.61 on Yelp, 0.71 on Amazon, and 0.50 on Captions. The Sₐ values are 0.72 on Yelp and 0.54 on Amazon. There is no corresponding Sₐ for Captions because the factual source is treated as content and is given no source markers to delete. The review results support a tendency toward local editing, with plenty of room for differing wording. For the captions, the overlap measurement is with another description of the same image, so it also reflects choices about how the scene is described.
The authors investigate departures from the expected pattern in 50 randomly sampled Yelp cases where a content word changed or an attribute-related word survived. Of the changed content words in that analysis, 70% were judged unimportant, 18% were paraphrased, and 12% had been mislabeled as content. The paper uses charge and price to illustrate a change of wording that retains the relevant idea. It also gives old becoming new as a case where a word treated as content was part of the evaluation the editor needed to alter.
Of the attribute-related words retained in those cases, 84% did bear on sentiment, but the surrounding context changed. A human can keep like and remove what negates it. The remaining 16% were attributed to mistagging, with walked out among the paper’s examples. The first group shows why retaining an individual word can be compatible with changing the attribute conveyed by a phrase. The second shows that corpus salience can flag wording whose role in the particular sentence is different from its usual association. The analysis thus tests both the tendency behind the method and the places where a count-based boundary is too coarse.
Changing how much to delete
The authors vary γ at test time on Yelp for DeleteAndRetrieve, DeleteOnly, and TemplateBased. A lower threshold makes a larger class of phrases eligible for deletion. This can remove more evidence for the source sentiment and also take away words a reader would have wanted to keep. A higher threshold protects more of the starting wording, with the possibility of carrying old sentiment into the result. The training parameters remain fixed while the deletion rule produces different inputs to the trained systems.
The resulting curves show a tradeoff in the classifier score for target-attribute match and BLEU for preservation relative to the human references. It is an operating adjustment available at inference, which the authors contrast with changing earlier systems’ training hyper-parameters and retraining them. RetrieveOnly does not show a clear tradeoff in their analysis. Its output is governed by the sentences available in the target collection. A different query can change the nearest neighbor, but it cannot produce the close counterpart a collection does not contain. For the other systems the curves demonstrate control under the two automatic measurements. Establishing how human preferences move along each curve would require human judgments at the different settings.
Limitations
Limits the authors identify
The authors treat localized attribute wording as a useful prior for the tasks they study. They also acknowledge that some attributes resist a clean division along phrase boundaries, citing work on formality as an example. A local marker may tell the reader something about the overall style and have a separate role in the message. Deleting every marked phrase can therefore create a less informative prompt for the decoder. A more general account, in the authors’ view, would still guide a system toward particular evidence while accommodating attributes that extend beyond short spans. An Empirical Analysis of Formality in Online Communication
Retrieval and templating have limits that follow from their rules. An existing target sentence can be fluent and clearly labeled, but finding a genuinely faithful counterpart depends on the contents of the collection. A phrase borrowed from a close example may require changes that a fixed slot cannot express. The learned variants relax those requirements and still depend on the content signal supplied by deletion. The stronger human ratings for human references show that flexibility and retrieval improve the automatic result while leaving substantial problems of fidelity, grammar, or style.
The authors also identify a limitation in how the task is measured. A classifier trained on ordinary reviews can use topics as evidence for sentiment. A generated review can break the associations that made those predictions plausible in training. BLEU, meanwhile, measures surface overlap with an available reference and gives little evidence about the grammatical quality of a new construction. These problems affect interpretation as well as ranking. An apparent gain in target attribute can reflect the classifier’s habits, and an apparent gain in preservation can come from copying many words into a sentence that reads poorly.
The human evaluation has its own conditions. The authors note that ratings are influenced by the set of outputs a worker sees and by instructions specific to a task. That observation supports comparisons among the systems evaluated together, with care when comparing absolute scores across domains. The all-criteria success rule is also demanding in a useful way. A sentence that narrowly misses one aspect and a sentence that fails several aspects both fall outside the successful group. The detailed criterion ratings and qualitative analysis therefore matter alongside the pooled success figures.
Limits of what the setup establishes
The labeled collections provide evidence of association. They do not independently establish what a phrase contributes in a particular sentence. The salience ratio reflects how frequently a phrase occurs in each collection, and the collections can differ in subject matter or in how frequently expressions are used. The Amazon classifier analysis provides a concrete illustration of topic and sentiment moving together in this data. The same distinction is relevant when reading a list of extracted markers: a useful signal about the label can be a poor reason to strip away a specific detail. The threshold changes the frequency with which that distinction matters, but it does not inspect what the phrase means in context.
The method’s representations retain different kinds of information. Deletion preserves an ordered sequence for the generator, yet the overlap search can favor candidates based on shared vocabulary without ensuring that they describe the same relation between the things named. A decoder can rewrite the frame to improve fluency, yet its training objective rewards reconstructing known sentences and its final scorer rewards predictable target-domain wording. Neither objective directly verifies each source detail in the generated result. The criterion that checks the preservation requirement in the experiments is the comparison made by human judges, with lexical overlap serving as an approximate automatic measure.
The Captions experiment tests a specific direction of transfer. It begins from factual text and applies one of the requested styles. A favorable result supports the method’s ability to add stylistic material under that assumption. It does not establish how well the deletion rule could remove humor from a humorous caption while retaining its description, or how the method would deal with a source in which stylistic details and scene details are difficult to separate. The review experiments do test a reversal, but of sentiment in a different kind of text. These settings give evidence about the operations actually evaluated.
The reference analysis verifies tendencies in word retention and change. Its unit is a non-stopword overlap, so the same degree of overlap can arise from different edits. A human can preserve meaning while substituting a synonym, or keep a word while using it in a different claim. Reviews rewritten for the task and captions independently phrased about the same image also offer different opportunities for overlap. The authors’ inspection of Yelp disagreements clarifies some of these cases. Its percentages describe the sampled disagreements, and expanding those interpretations to all outputs or to the other domains would require a corresponding analysis there.
Finally, the comparison establishes performance against the published systems selected for the experiments and under the authors’ training and evaluation choices. The recurrent variants demonstrate the value of combining a phrase-based prior with flexible generation in this setting. Their results leave open how much each part contributes independently, whether a different retrieval collection would change the ranking, and how far the same assumptions apply to attributes beyond the tested sentiment and caption styles. The paper’s strongest evidence is the success of the complete system across its three evaluations, alongside the specific failure patterns the authors document.
What came after
Keeping the stages or changing what gets separated
A direct continuation appears in “Transforming” Delete, Retrieve, Generate Approach for Controlled Text Style Transfer. It takes the named decomposition as the subject of a subsequent approach to controlled transfer. The connection is architectural. Identifying material to remove, finding target wording, and writing a sentence are recognizable responsibilities that another system can revisit independently. The original paper’s comparison between slot filling and recurrent generation already shows how keeping the deletion rule can still leave room for a substantially different way of realizing the output.
Politeness Transfer brings a tag-and-generate approach to a different attribute. Its formulation likewise places an explicit operation on the text ahead of sentence generation. Tagging makes the identification of relevant wording part of the method, giving the generator an input prepared for the requested politeness change. The connection to the earlier paper is the use of a recognizable intermediate step between reading a sentence and rewriting it. Politeness is the property being controlled in this later formulation, extending the question of what language should be marked beyond review sentiment and caption style.
Style Transfer Through Back-Translation makes back-translation part of the transfer route. It addresses the same question of what representation a generator should receive after processing the source. The deletion method makes that representation from the source words left after a targeted count-based operation. The back-translation formulation makes translation an intermediate operation. The common concern is how to give the final writer access to the original content while creating room for a change in expression.
Disentangled Representation Learning for Non-Parallel Text Style Transfer pursues the separation directly at the level of learned representations. The earlier paper supplies a surface division based on phrases, then encodes the resulting pieces for generation. The later work takes learning the separation itself as its subject, while retaining the non-parallel training problem. Style Transformer offers another formulation for unpaired data and removes the requirement for a disentangled latent representation. These lines of work keep the constraint imposed by separate collections while changing what the architecture assumes about the separation of content and style.
Changing the formulation of the rewrite
Reformulating Unsupervised Style Transfer as Paraphrase Generation puts paraphrase generation at the center of the problem. The original paper treats preservation as a consequence to pursue by retaining some words and using them to guide new writing. A paraphrase formulation makes the relationship between the original sentence and the alternative expression the organizing task. The work is connected by the need to hold on to meaning as wording changes, with the later formulation taking a different starting point from a list of localized markers.
ParaDetox studies detoxification with parallel data. It changes a condition that motivates the delete-and-retrieve approach. When examples are paired, a corresponding rewrite can directly show which information survives the change. The unpaired approach has to infer what to keep from patterns across separate collections and any cues available in the source. The link between the papers is the requirement to change a property of text while preserving the message, approached with different forms of evidence during learning.
Moving control to generation and examining the result
Plug and Play Language Models takes up controlled text generation with a plug-and-play formulation. DExperts locates its control at decoding time and frames that control in terms of experts and anti-experts. Both continue the broader question of how to steer output towards a desired property. DeleteAndRetrieve makes its control concrete through the phrases supplied before decoding. DExperts locates the control in the choice of wording during decoding. A connection through controllability leaves the source-preservation requirement as a separate question. Generating in a desired style and rewriting a particular input faithfully call for different evidence about success.
Evaluating Style Transfer for Text makes the assessment problem a subject in its own right. The earlier experiments show why such an inquiry matters. A classifier, a reference-overlap score, and a human rating can respond to different properties of the same sentence. Different system designs can exaggerate those discrepancies, as when a fixed template preserves words but damages grammar. Unifying Human and Statistical Evaluation for Natural Language Generation addresses the relationship between human and statistical assessment for the wider generation problem. The original paper supplies a concrete instance of that relationship: the usefulness of an automatic score depends on what people want the generated text to accomplish and on how the evaluation data differ from the writing used to train the scorer.
Institutions
Fields, topics and concepts
Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksComputer Vision and Pattern Recognition · 3,621 works
Topics 2Research subjects and languages the work is about.Machine translation · 1,109 worksSentiment & emotion · 1,037 works
Cite
Cite as Juncen Li, Robin Jia, He He and Percy Liang. 2018. Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer. arXiv:1804.06437.
@misc{li2018delete,
title = {{Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer}},
author = {Juncen Li, Robin Jia, He He and Percy Liang},
year = {2018},
eprint = {1804.06437},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1804.06437}
}References
- M. Arjovsky and L. Bottou. 2017. Towards principled methods for training generative adversarial networks. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
- M. Artetxe, G. Labaka, E. Agirre, and K. Cho. 2017. Unsupervised neural machine translation. arXiv preprint arXiv:1710.11041 . our card
- K. Bousmalis, N. Silberman, D. Dohan, D. Erhan, and D. Krishnan. 2017. Unsupervised pixel-level domain adaptation with generative adversarial networks. In Computer Vision and Pattern Recognition (CVPR). OpenAlex ↗ · Scholar ↗
- Z. Fu, X. Tan, N. Peng, D. Zhao, and R. Yan. 2018. Style transfer in text: Exploration and evaluation. In Association for the Advancement of Artificial Intelligence (AAAI). our card
- C. Gan, Z. Gan, X. He, J. Gao, and L. Deng. 2017. Stylenet: Generating attractive visual captions with styles. In Computer Vision and Pattern Recognition (CVPR). OpenAlex ↗ · Scholar ↗
- A. Globerson and S. Roweis. 2006. Nightmare at test time: robust learning by feature deletion. In International Conference on Machine Learning (ICML). pages 353–360. OpenAlex ↗ · Scholar ↗
- I. Goodfellow, D. Warde-farley, M. Mirza, A. Courville, and Y. Bengio. 2013. Maxout networks. In International Conference on Machine Learning (ICML). pages 1319–1327. OpenAlex ↗ · Scholar ↗
- K. Guu, T. B. Hashimoto, Y. Oren, and P. Liang. 2018. Generating sentences by editing prototypes. Transactions of the Association for Computational Linguistics (TACL) 0. our card
- R. He and J. McAuley. 2016. Ups and downs: Modeling the visual evolution of fashion trends with one-class collaborative filtering. In World Wide Web (WWW). OpenAlex ↗ · Scholar ↗
- Z. Hu, Z. Yang, X. Liang, R. Salakhutdinov, and E. P. Xing. 2017. Toward controlled generation of text. In International Conference on Machine Learning (ICML). our card
- Z. Jun-Yan, P. Taesung, I. Phillip, and E. A. A. 2017. Unpaired image-to-image translation using cycle-consistent adversarial networks. In International Conference on Computer Vision (ICCV). OpenAlex ↗ · Scholar ↗
- G. Lample, L. Denoyer, and M. Ranzato. 2017. Unsupervised machine translation using monolingual corpora only. arXiv preprint arXiv:1711.00043 . our card
- I. Melnyk, C. N. dos Santos, K. Wadhawan, I. Padhi, and A. Kumar. 2017. Improved neural text attribute transfer with non-parallel data. arXiv preprint arXiv:1711.09395 . OpenAlex ↗ · Scholar ↗
- M. L. Newman, J. W. Pennebaker, D. S. Berry, and J. M. Richards. 2003. Lying words: Predicting deception from linguistic styles. Personality and Social Psychology Bulletin 29. OpenAlex ↗ · Scholar ↗
- E. Pavlick and J. Tetreault. 2017. An empirical analysis of formality in online communication. Transactions of the Association for Computational Linguistics (TACL) 4. our card
- M. Recasens, C. Danescu-Niculescu-Mizil, and D. Jurafsky. 2013. Linguistic models for analyzing and detecting biased language. In Association for Computational Linguistics (ACL). our card
- T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. 2016. Improved techniques for training gans. In Advances in Neural Information Processing Systems (NIPS). our card
- R. Schwartz, M. Sap, Y. Konstas, L. Zilles, Y. Choi, and N. A. Smith. 2017. The effect of different writing tasks on linguistic style: A case study of the ROC story cloze task. In Computational Natural Language Learning (CoNLL). our card
- T. Shen, T. Lei, R. Barzilay, and T. Jaakkola. 2017. Style transfer from non-parallel text by cross-alignment. In Advances in Neural Information Processing Systems (NIPS). our card
- P. Vincent, H. Larochelle, Y. Bengio, , and P. Manzagol. 2008. Extracting and composing robust features with denoising autoencoders. In International Conference on Machine Learning (ICML). OpenAlex ↗ · Scholar ↗
- S. Wang and C. D. Manning. 2012. Baselines and bigrams: Simple, good sentiment and topic classification. In Association for Computational Linguistics (ACL). our card
- M. D. Zeiler. 2012. ADADELTA: an adaptive learning rate method. arXiv preprint arXiv:1212.5701 . our card
- J. Zhao, Y. Kim, K. Zhang, A. M. Rush, and Y. LeCun. 2018. Adversarially regularized autoencoders. In International Conference on Learning Representations (ICLR). OpenAlex ↗ · Scholar ↗
This page in Markdown https://md.research.elamur.ai/free/en/papers/li-2018-delete-retrieve-generate-simple-approach/