{"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/prompt-gating-a-parameter-efficient-tuning","title":"An Extensible Plug-and-Play Method for Multi-Aspect Controllable Text Generation","arxiv_id":"2212.09387","date":"2022-12-19","proceeding":null,"authors":["Xuancheng Huang","Zijun Liu","Peng Li","Tao Li","Maosong Sun","Yang Liu"],"abstract":"Recently, multi-aspect controllable text generation that controls the generated text in multiple aspects (e.g., sentiment, topic, and keywords) has attracted increasing attention. Although methods based on parameter efficient tuning like prefix-tuning could achieve multi-aspect controlling in a plug-and-play way, the mutual interference of multiple prefixes leads to significant degeneration of constraints and limits their extensibility to training-time unseen aspect combinations. In this work, we provide a theoretical lower bound for the interference and empirically found that the interference grows with the number of layers where prefixes are inserted. Based on these analyses, we propose using trainable gates to normalize the intervention of prefixes to restrain the growing interference. As a result, controlling training-time unseen combinations of aspects can be realized by simply concatenating corresponding plugins such that new constraints can be extended at a lower cost. In addition, we propose a unified way to process both categorical and free-form constraints. Experiments on text generation and machine translation demonstrate the superiority of our approach over baselines on constraint accuracy, text quality, and extensibility.","url_abs":"https://arxiv.org/abs/2212.09387v2","url_pdf":"https://arxiv.org/pdf/2212.09387v2.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":"prompt-gating-a-parameter-efficient-tuning","repo_url":"https://github.com/thunlp-mt/promptgating4mctg","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"translation","task_name":"Translation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2212.09387","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2212.09387"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/thunlp-mt/promptgating4mctg","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"ran_violates":1,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":6,"ran":3,"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":"874a42377fa0659f","entry":"invert_mask","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/thumt/models/modeling_bart.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/thumt/models/modeling_bart.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"874a42377fa0659f"}},{"code_sha256_prefix":"f20c9b1aead27fea","entry":"make_padding_mask","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/thumt/models/modeling_bart.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/thumt/models/modeling_bart.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"f20c9b1aead27fea"}},{"code_sha256_prefix":"e00ccf7847d12b59","entry":"shift_tokens_right","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/thumt/models/modeling_bart.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/thumt/models/modeling_bart.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"e00ccf7847d12b59"}},{"code_sha256_prefix":"c7fda9edb0a825ac","entry":"classify_sentence","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/exp_tense/tense_detector_t.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/exp_tense/tense_detector_t.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c7fda9edb0a825ac"}},{"code_sha256_prefix":"cb76fc23dc68c244","entry":"fetch","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/exp_tense/tense_detector_t.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/exp_tense/tense_detector_t.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"cb76fc23dc68c244"}},{"code_sha256_prefix":"40ababf4a5b7509f","entry":"import_params","repo":"thunlp-mt/promptgating4mctg","repo_kind":"official","path":"codes/thumt/bin/scorer.py","file_url":"https://github.com/thunlp-mt/promptgating4mctg/blob/HEAD/codes/thumt/bin/scorer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"40ababf4a5b7509f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}