{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/ctrl-a-conditional-transformer-language-model-1","title":"CTRL: A Conditional Transformer Language Model for Controllable Generation","arxiv_id":"1909.05858","date":"2019-09-11","proceeding":"Preprint 2019 9","authors":["Nitish Shirish Keskar","Bryan McCann","Lav R. Varshney","Caiming Xiong","Richard Socher"],"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.","url_abs":"https://arxiv.org/abs/1909.05858v2","url_pdf":"https://arxiv.org/pdf/1909.05858v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/NohTow/PPL-MCTS","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/UKPLab/controlled-argument-generation","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":null},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/dig-team/hanna-benchmark-asg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/lashoun/hanna-benchmark-asg","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/ctrl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/JunnYu/paddle_ctrl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":{"status":"ok"}},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/MindCode-4/code-3/tree/main/ctrl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"ctrl-a-conditional-transformer-language-model-1","repo_url":"https://github.com/PaddlePaddle/PaddleNLP/tree/develop/paddlenlp/transformers/ctrl","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[{"method_slug":"adagrad","method_name":"AdaGrad"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"ctrl","method_name":"CTRL"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gradient-clipping","method_name":"Gradient Clipping"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup","method_name":"Linear Warmup"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1909.05858","atlas_url":"https://app.syntology.ai/?focus=1909.05858","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.05858"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/2024-MindSpore-1/Code2/tree/main/model-1/ctrl","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/NohTow/PPL-MCTS","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/UKPLab/controlled-argument-generation","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dig-team/hanna-benchmark-asg","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lashoun/hanna-benchmark-asg","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/PaddlePaddle/PaddleNLP/tree/develop/paddlenlp/transformers/ctrl","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-3/tree/main/ctrl","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/JunnYu/paddle_ctrl","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/salesforce/ctrl","reach":null}],"summary":{"ran":7,"ran_honours":3,"ran_draft_wrong":3,"ran_violates":1},"by_repo_kind":{"listed":{"samples":8,"ran":8,"repositories":2},"found_in_text":{"samples":6,"ran":6,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"df1758dac76c4f1b","entry":"Encoder","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"df1758dac76c4f1b"}},{"code_sha256_prefix":"ffb87c8bfc0934fc","entry":"Encoder","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"ffb87c8bfc0934fc"}},{"code_sha256_prefix":"0569a605ab9ceff1","entry":"EncoderLayer","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"0569a605ab9ceff1"}},{"code_sha256_prefix":"0e66a2125c9ac5ae","entry":"EncoderLayer","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"0e66a2125c9ac5ae"}},{"code_sha256_prefix":"28afe17f8e7f671f","entry":"MultiHeadAttention","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"28afe17f8e7f671f"}},{"code_sha256_prefix":"6a0d83e892c993b0","entry":"MultiHeadAttention","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"6a0d83e892c993b0"}},{"code_sha256_prefix":"9eb3e1d90aca3c2d","entry":"angle_defn","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"9eb3e1d90aca3c2d"}},{"code_sha256_prefix":"f0e2d39fe65c917d","entry":"false_discovery_control2","repo":"dig-team/hanna-benchmark-asg","repo_kind":"listed","path":"fdr.py","file_url":"https://github.com/dig-team/hanna-benchmark-asg/blob/HEAD/fdr.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f0e2d39fe65c917d"}},{"code_sha256_prefix":"f599625f24576b30","entry":"point_wise_feed_forward_network","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"f599625f24576b30"}},{"code_sha256_prefix":"e3590890c2be1aba","entry":"point_wise_feed_forward_network","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"e3590890c2be1aba"}},{"code_sha256_prefix":"73f58f87df49bccb","entry":"positional_encoding","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"73f58f87df49bccb"}},{"code_sha256_prefix":"217eb8ea438145ad","entry":"positional_encoding","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"217eb8ea438145ad"}},{"code_sha256_prefix":"c37ff914e4e7a62e","entry":"scaled_dot_product_attention","repo":"UKPLab/controlled-argument-generation","repo_kind":"listed","path":"transformer.py","file_url":"https://github.com/UKPLab/controlled-argument-generation/blob/HEAD/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c37ff914e4e7a62e"}},{"code_sha256_prefix":"6da14d7cf9778239","entry":"scaled_dot_product_attention","repo":"salesforce/ctrl","repo_kind":"found_in_text","path":"pytorch_transformer.py","file_url":"https://github.com/salesforce/ctrl/blob/HEAD/pytorch_transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"6da14d7cf9778239"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}