{"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/controlling-conditional-language-models-with","title":"Controlling Conditional Language Models without Catastrophic Forgetting","arxiv_id":"2112.00791","date":"2021-12-01","proceeding":null,"authors":["Tomasz Korbak","Hady Elsahar","German Kruszewski","Marc Dymetman"],"abstract":"Machine learning is shifting towards general-purpose pretrained generative models, trained in a self-supervised manner on large amounts of data, which can then be applied to solve a large number of tasks. However, due to their generic training methodology, these models often fail to meet some of the downstream requirements (e.g., hallucinations in abstractive summarization or style violations in code generation). This raises the important question of how to adapt pre-trained generative models to meet all requirements without destroying their general capabilities (\"catastrophic forgetting\"). Recent work has proposed to solve this problem by representing task-specific requirements through energy-based models (EBMs) and approximating these EBMs using distributional policy gradients (DPG). Despite its effectiveness, this approach is however limited to unconditional distributions. In this paper, we extend DPG to conditional tasks by proposing Conditional DPG (CDPG). We evaluate CDPG on four different control objectives across three tasks (translation, summarization and code generation) and two pretrained models (T5 and GPT-Neo). Our results show that fine-tuning using CDPG robustly moves these pretrained models closer towards meeting control objectives and -- in contrast with baseline approaches -- does not result in catastrophic forgetting.","url_abs":"https://arxiv.org/abs/2112.00791v2","url_pdf":"https://arxiv.org/pdf/2112.00791v2.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":"controlling-conditional-language-models-with","repo_url":"https://github.com/naver/gdc","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"controlling-conditional-language-models-with","repo_url":"https://github.com/google/t5patches","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"abstractive-text-summarization","task_name":"Abstractive Text Summarization"},{"task_slug":"code-generation","task_name":"Code Generation"}],"methods":[{"method_slug":"adafactor","method_name":"Adafactor"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dpg","method_name":"DPG"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-neo","method_name":"GPT-Neo"},{"method_slug":"glu","method_name":"Gated Linear Unit"},{"method_slug":"inverse-square-root-schedule","method_name":"Inverse Square Root Schedule"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sentencepiece","method_name":"SentencePiece"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"t5","method_name":"T5"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2112.00791","atlas_url":"https://app.syntology.ai/?focus=2112.00791","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2112.00791"}},"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":"deterministic:regex_extraction","url":"https://github.com/naver/gdc","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/PyCQA/pycodestyle","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google/t5patches","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":3,"repositories":1},"listed":{"samples":4,"ran":1,"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":4,"samples":[{"code_sha256_prefix":"4e11394481ba47b3","entry":"BaseTrainer","repo":"naver/gdc","repo_kind":"official","path":"cdpg/cdpg/pointwise_gdc.py","file_url":"https://github.com/naver/gdc/blob/HEAD/cdpg/cdpg/pointwise_gdc.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"4e11394481ba47b3"}},{"code_sha256_prefix":"499346faba26ea21","entry":"entropy_from_logits","repo":"naver/gdc","repo_kind":"official","path":"cdpg/cdpg/pointwise_gdc.py","file_url":"https://github.com/naver/gdc/blob/HEAD/cdpg/cdpg/pointwise_gdc.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"499346faba26ea21"}},{"code_sha256_prefix":"84ee976a4b8362c9","entry":"get_first_diff_mask","repo":"google/t5patches","repo_kind":"listed","path":"t5patches/feature_converters_utils.py","file_url":"https://github.com/google/t5patches/blob/HEAD/t5patches/feature_converters_utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"84ee976a4b8362c9"}},{"code_sha256_prefix":"fdebc86ab591bd34","entry":"logprobs_from_logits","repo":"naver/gdc","repo_kind":"official","path":"cdpg/cdpg/pointwise_gdc.py","file_url":"https://github.com/naver/gdc/blob/HEAD/cdpg/cdpg/pointwise_gdc.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":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"fdebc86ab591bd34"}},{"code_sha256_prefix":"da3e3fa9219ccd85","entry":"PointwiseGDCTrainer","repo":"naver/gdc","repo_kind":"official","path":"cdpg/cdpg/pointwise_gdc.py","file_url":"https://github.com/naver/gdc/blob/HEAD/cdpg/cdpg/pointwise_gdc.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"da3e3fa9219ccd85"}},{"code_sha256_prefix":"dac0288079ac279f","entry":"dot_product_attention","repo":"google/t5patches","repo_kind":"listed","path":"t5patches/layers.py","file_url":"https://github.com/google/t5patches/blob/HEAD/t5patches/layers.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dac0288079ac279f"}},{"code_sha256_prefix":"1184cae8ca10c644","entry":"make_attention_mask","repo":"google/t5patches","repo_kind":"listed","path":"t5patches/layers.py","file_url":"https://github.com/google/t5patches/blob/HEAD/t5patches/layers.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1184cae8ca10c644"}},{"code_sha256_prefix":"94c13ffc5f28dfba","entry":"make_causal_mask","repo":"google/t5patches","repo_kind":"listed","path":"t5patches/layers.py","file_url":"https://github.com/google/t5patches/blob/HEAD/t5patches/layers.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"94c13ffc5f28dfba"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}