CoCon: A Self-Supervised Approach for Controlled Text Generation

Alvin Chan, Yew-Soon Ong, Bill Pung, Aston Zhang, Jie Fu
6/5/2020
cs.CLcs.LGcs.NE
contrastive-ssl

Official code: alvinchangw/COCON_ICLR2021 (92 stars, Python, Apache-2.0, last commit 2021-06-03).

Abstract

Pretrained Transformer-based language models (LMs) display remarkable natural language generation capabilities. With their immense potential, controlling text generation of such LMs is getting attention.

Show full abstract

While there are studies that seek to control high-level attributes (such as sentiment and topic) of generated text, there is still a lack of more precise control over its content at the word- and phrase-level. Here, we propose Content-Conditioner (CoCon) to control an LM's output text with a content input, at a fine-grained level. In our self-supervised approach, the CoCon block learns to help the LM complete a partially-observed text sequence by conditioning with content inputs that are withheld from the LM. Through experiments, we show that CoCon can naturally incorporate target content into generated texts and control high-level text attributes in a zero-shot manner.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Pytorch implementation of CoCon: A Self-Supervised Approach for Controlled Text Generation

9224Python, ShellMar 9, 20215 years agoApache-2.0

Similar Papers

Cite this paper

@article{chan2020cocon,
  title  = {CoCon: A Self-Supervised Approach for Controlled Text Generation},
  author = {Alvin Chan and Yew-Soon Ong and Bill Pung and Aston Zhang and Jie Fu},
  year   = {2020},
  eprint = {2006.03535},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2006.03535}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2006.03535.svg)](https://codeofpaper.com/paper/2006.03535)

Discussion