Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer
What it is about
The paper transfers an attribute such as sentiment or style without parallel data. It assumes that a sentence's attribute shows up as a few distinctive phrases, such as a comparative phrase for a negative review. The method has three steps. Delete: score each n-gram by how much more often it appears in one attribute class than in the other, using smoothed relative frequencies, and remove those above a threshold, leaving the content words. Retrieve: find the sentence in the target class whose content is most similar to the remaining words, by TF-IDF overlap or embedding distance. Generate: combine the content with the target phrases, either by a fixed template or by a small neural model. The threshold can be changed at test time to control how many markers are removed. On human ratings the best variant yields grammatical and appropriate outputs on about 22 percent more inputs than the best earlier system, averaged over three datasets: Yelp and Amazon reviews, and image captions.
Ideas
- I1. Find the author's markers by salience. For an author against the standard, compute the smoothed ratio of n-gram counts and keep the top ones (thou, hath, unto). This gives the candidate list for the author delta without a hand-written list, and a threshold tuned on dev sets the cut.
- I2. Report a curve, not one number. Vary the marker threshold and report content match against style match. The curve fits exact mode (strict) and normal mode (loose) better than a single score.
- I3. Retrieve then fill for unseen concepts. For a slot with no known chunk, retrieve a sentence from the target author with similar meta tokens and take its chunk. This is a count-based answer to open problem 3, which asks for trees rather than strings.
- I4. Keep the template fill as a deterministic route to compare against the encoder. The paper's template baseline is cheap to build and gives a floor for each delta.
For Mova
The code is tools/translate (profile.rs for the chunk choice, measure.rs for the threshold curve) and en/src/morph.rs for marker morphology. The neural generator is not for Mova. The marker-salience step and the threshold curve are count-based and fit the author delta directly, addressing open problem 6.
Library summary
Written for the Research library (claude-opus-5-5) from the paper text, in our own words: the license "arXiv — non-exclusive license to distribute" does not allow redistributing the text itself. Original — arxiv.org/pdf/1804.06437
Summary
The paper tackles text attribute transfer: rewriting a sentence so that one property, such as sentiment or style, changes while everything else stays the same. The training data contains only sentences labeled with their attribute, with no paired examples. Earlier adversarial approaches were hard to train and produced weak outputs. The authors' key observation is that an attribute usually lives in a few telltale n-grams. They score n-grams by smoothed relative frequency across the labeled corpora and delete those that strongly signal the source attribute. They then fetch a target-attribute sentence with similar remaining content and produce the output. The output step comes in four variants: returning the retrieved sentence, slot-filling, or one of two RNN encoder-decoder models trained as auto-encoders. They evaluate on YELP and AMAZON reviews (sentiment) and on CAPTIONS (romantic vs. humorous). In human judgments, their best neural system succeeds far more often than adversarial baselines. This shows that a simple, interpretable inductive bias can beat more complex unsupervised disentanglement.
Key points
- Four systems are proposed: RetrieveOnly, TemplateBased, DeleteOnly and DeleteAndRetrieve. They are compared against CrossAligned, StyleEmbedding and MultiDecoder.
- On human evaluation averaged over the three datasets, outputs judged fully successful were:
- 12% for the best adversarial model
- 23% for the simple baseline
- 34% for the best neural model
- On YELP, DeleteAndRetrieve reaches 88.7% classifier accuracy with BLEU 8.4, versus 73.7% and BLEU 3.1 for CrossAligned.
- Changing the deletion threshold γ at test time trades attribute strength against content preservation, with no retraining needed.
- Automatic metrics are imperfect. On AMAZON, the classifier barely correlates with human attribute judgments (Spearman −0.036), and BLEU does not reflect grammaticality. The authors release code, data and new human references for YELP and AMAZON on GitHub and CodaLab.
Cite
@misc{li2018delete,
title = {{Delete, Retrieve, Generate: A Simple Approach to Sentiment and Style Transfer}},
author = {Li, Juncen and Jia, Robin and He, He and Liang, Percy},
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). find
- 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). find
- 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). find
- 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). find
- 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. find
- 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. find
- 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. find 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). find
- 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). find 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). find
- 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 . ↗
- 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. find
- E. Pavlick and J. Tetreault. 2017. An empirical analysis of formality in online communication. Transactions of the Association for Computational Linguistics (TACL) 4. find 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). find
- 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). find 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). find
- 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). find 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). find
- S. Wang and C. D. Manning. 2012. Baselines and bigrams: Simple, good sentiment and topic classification. In Association for Computational Linguistics (ACL). find
- 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. Le-Cun. 2018. Adversarially regularized autoencoders. In International Conference on Learning Representations (ICLR). find