CTRL: A CONDITIONAL TRANSFORMER LANGUAGE MODEL FOR CONTROLLABLE GENERATION

- 7 mins

Authors : Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, Richard Socher by Salesforce Research

Paper : https://arxiv.org/pdf/1909.05858.pdf
Code : https://github.com/salesforce/ctrl


Summary

Control Code 를 이용하여 Language model 에 Condition을 주어 도메인, 스타일, 토픽 등과 같이 생성 되는 문장의 내용 및 스타일을 컨트롤 하여 생성 함


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.

1. Introduction

2. Language Modeling

3. LANGUAGE MODELING WITH CTRL


\[\text{Attention}(X,Y,Z) = \text{softmax}(\frac{\text{mask}(XY^T)}{\sqrt{d}})Z\] \[\text{MultiHead}(X, k) = [h_1; ... ;h_k]W_o\] \[\text{where } h_j=\text{Attention}(XW_j^1,XW_j^2,XW_j^3)\] \[FF(X) = \text{max}(0, XU)V\]


\[\text{Block 1}\] \[\bar{X_i} = \text{LayerNorm}(X_i)\] \[H_i = \text{MultiHead}(\bar{X_i}) + \bar{X_i}\]


\[\text{Block 2}\] \[\bar{H_i} = \text{LayerNorm}(H_i)\] \[X_{i+1} = FF(\bar{H_i}) + \bar{H_i}\] \[\text{Scores}(X_0) = \text{LayerNorm}(X_l)W_{vocab}\]

3.1 DATA



3.2 EXPERIMENTAL SETTINGS

4. CONTROLLABLE GENERATION

4.1 SAMPLING

\[p_i = \frac{\text{exp}(x_i/T)}{\sum_j\text{exp}(x_j/T)}\] \[\sum_i\text{sort}(p_i) > p_t\] \[p_i = \frac{\text{exp}(x_i/T\cdot I(i{\displaystyle \in }g))}{\sum_j\text{exp}(x_j/T\cdot I (j{\displaystyle \in }g))}\] \[I(c) = \theta \text{ if c is True else 1}\]

4.2 CONTROL CODES

Toggle

Table 1


Table 2


Table 3


Table 4


Table 5


5. SOURCE ATTRIBUTION

\[p_\theta(c|x) \propto p_\theta(x|c)p(c)\]

7. FUTURE DIRECTIONS

8. CTRL-ALT-DEL: THE ETHICS OF LARGE LANGUAGE MODELS

생략

9. CONCLUSION

With 1.63 billion parameters, CTRL is the largest publicly released language model to date. It is trained with control codes so that text generation can be more easily controlled by human users. These codes allow users to explicitly specify domain, subdomain, entities, relationships between entities, dates, and task-specific behavior. We hope that the release of this model at https://github.com/salesforce/ctrl pushes towards more controllable, general models for natural language processing, and we encourage future discussion about artificial generation with our team by emailing ctrl- monitoring@salesforce.com.

Dongju Park

Dongju Park

Research Scientist / Engineer @ NAVER CLOVA

comments powered by Disqus
rss facebook twitter github gitlab googlescholar youtube mail spotify lastfm instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora quora