Skip to main content
QUICK REVIEW

[Paper Review] CTRL: A Conditional Transformer Language Model for Controllable Generation

Nitish Shirish Keskar, Bryan McCann|arXiv (Cornell University)|Sep 11, 2019
Topic Modeling84 references787 citations
TL;DR

CTRL trains a 1.63B parameter Transformer language model conditioned on control codes to steer domain, style, and task-specific generation, enabling controllable text synthesis and model-based source attribution.

ABSTRACT

Large-scale language models show promising text generation capabilities, but users cannot easily control particular aspects of the generated text. We release CTRL, a 1.63 billion-parameter conditional transformer language model, trained to condition on control codes that govern style, content, and task-specific behavior. Control codes were derived from structure that naturally co-occurs with raw text, preserving the advantages of unsupervised learning while providing more explicit control over text generation. These codes also allow CTRL to predict which parts of the training data are most likely given a sequence. This provides a potential method for analyzing large amounts of data via model-based source attribution. We have released multiple full-sized, pretrained versions of CTRL at https://github.com/salesforce/ctrl.

Motivation & Objective

  • Provide a language model that can be explicitly controlled via control codes.
  • Preserve unsupervised training advantages while enabling domain- and task-aware generation.
  • Demonstrate that control codes can be derived from natural data structure (domains, URLs, etc.).
  • Show how CTRL enables source attribution by linking generated content to training data subsets.
  • Explore task-specific control codes for questions answering and machine translation.

Proposed method

  • Train a large Transformer language model conditioned on a control code c, learning p(x|c) with a cross-entropy loss.
  • Prepend each training sequence with a domain control code to propagate it across the domain’s text.
  • Use a sizable vocabulary (roughly 250K tokens) and sequence lengths of 256 or 512 with a sliding-window generation approach.
  • Incorporate domain, content, and task-specific control codes derived from data structure such as domains, URLs, and links.
  • Propose a near-greedy penalized sampling method to balance truthfulness and repetition during generation.
  • Demonstrate complex control codes for tasks like question answering and translation and show zero-shot code-mixing capabilities.

Experimental results

Research questions

  • RQ1Can explicit control codes steer generation across domain, style, and content while preserving general language modeling capabilities?
  • RQ2How do control codes derived from natural data structure enable predictable, domain-specific generation without heavy prompting?
  • RQ3What is the impact of control codes on task-specific generation such as QA and translation?
  • RQ4Can CTRL support source attribution by linking outputs to subsets of training data via control codes?
  • RQ5What sampling and training choices best support controllable, coherent generation at scale?

Key findings

  • CTRL can generate text conditioned on control codes specifying domain, style, topics, dates, entities, and relationships.
  • Control codes enable domain-specific variation even with identical prompts, as shown in examples across domains and templates.
  • A penalized sampling method reduces repetition while maintaining adherence to model distribution, improving factuality and coherence.
  • Control codes for Q&A and translation provide straightforward access to task-specific capabilities within CTRL.
  • URLs and other data structure used during training enable inference-time specification of domain, subdomain, entities, relations, and dates.
  • CTRL enables zero-shot code-mixing, demonstrating cross-domain and cross-task controllability.

Better researchstarts right now

From paper design to paper writing, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.