All models

ctrl

A causal transformer language model that generates sequences conditioned on a leading control code.

Language · 1,356 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (103 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
ctrl
Parameters
1.6B
Operations
1,356
Framework
PyTorch
Recurrent
No
Published
2019
Cited by
1,753 (as of 29 November 2026)
Authors
Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3994
Graph hash
536119d377428a42fb8d6bf8b3d2dac547d26c0662062ef279c5cd612887dd10
Skeleton hash
86144cc40f15bf98019fbb3a07574987ad5367f9f0eda389e463c34a0fc826dd
Architecture hash
6197f64c6cddf094ffc5e7ddad3ea1975c81c788269a5b8896a23bdcaccf6cd2
Diagram SHA-256
0def7143762d9a18875bc08febb5601e2260e437df75483352663087b38e21fb
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

transformers.AutoModelForCausalLM.from_config()

What it is

This model is CTRL itself, with the 48 layers and 16 heads per layer that the paper describes.

About this model's family

CTRL is a language model whose output can be steered by a control code placed at the start of the text. The codes govern style, content and task-specific behavior, and they come from structure that already accompanies raw text, so the training stays unsupervised. In training, each sequence has its domain control code prepended as the first token. Because of the codes, the model can also predict which parts of the training data are most likely given a sequence, which the paper proposes as a method of source attribution.

The network is a Transformer with causal masking, and positions are added as sinusoidal embeddings. The paper gives a model dimension of 1280, an inner dimension of 8192, 48 layers and 16 heads per layer, and reports 1.63 billion parameters. Token embeddings are tied with the final output embedding layer. Training used 140 GB of text from a wide variety of domains.

ZymCTRL carries the same conditioning idea to proteins. Its card describes it as based on the CTRL Transformer architecture, with 36 layers and a model dimensionality of 1280. It was pre-trained on raw enzyme sequences with the Enzyme Commission (EC) classes prepended to each sequence. Given an EC number, it generates protein sequences meant to carry out that catalytic reaction.

Key idea. The paper released CTRL, a 1.63 billion-parameter transformer language model trained to condition on control codes that govern style, content and task-specific behavior.

  • CTRL
  • Conditional Transformer Language Model
  • controllable generation
  • control codes
  • conditional language model
  • text generation
  • ZymCTRL
  • enzyme generation
  • protein language model
  • Salesforce CTRL

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{keskar2019ctrlconditionaltransformerlanguage,
      title={CTRL: A Conditional Transformer Language Model for Controllable Generation}, 
      author={Nitish Shirish Keskar and Bryan McCann and Lav R. Varshney and Caiming Xiong and Richard Socher},
      year={2019},
      eprint={1909.05858},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/1909.05858}, 
}