{"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-tuning-for-discriminative-pre-trained-1","title":"Prompt Tuning for Discriminative Pre-trained Language Models","arxiv_id":"2205.11166","date":"2022-05-23","proceeding":"Findings (ACL) 2022 5","authors":["Yuan YAO","Bowen Dong","Ao Zhang","Zhengyan Zhang","Ruobing Xie","Zhiyuan Liu","Leyu Lin","Maosong Sun","Jianyong Wang"],"abstract":"Recent works have shown promising results of prompt tuning in stimulating pre-trained language models (PLMs) for natural language processing (NLP) tasks. However, to the best of our knowledge, existing works focus on prompt-tuning generative PLMs that are pre-trained to generate target tokens, such as BERT. It is still unknown whether and how discriminative PLMs, e.g., ELECTRA, can be effectively prompt-tuned. In this work, we present DPT, the first prompt tuning framework for discriminative PLMs, which reformulates NLP tasks into a discriminative language modeling problem. Comprehensive experiments on text classification and question answering show that, compared with vanilla fine-tuning, DPT achieves significantly higher performance, and also prevents the unstable problem in tuning large PLMs in both full-set and low-resource settings. The source code and experiment details of this paper can be obtained from https://github.com/thunlp/DPT.","url_abs":"https://arxiv.org/abs/2205.11166v1","url_pdf":"https://arxiv.org/pdf/2205.11166v1.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-tuning-for-discriminative-pre-trained-1","repo_url":"https://github.com/thunlp/dpt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"text-classification","task_name":"Text Classification"},{"task_slug":"text-classification-1","task_name":"text-classification"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-prediction-transformer","method_name":"DPT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"electra","method_name":"ELECTRA"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2205.11166","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.11166"}},"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":"deterministic:regex_extraction","url":"https://github.com/thunlp/DPT","reach":null}],"summary":{"ran":5,"ran_draft_wrong":2,"unverified":5},"by_repo_kind":{"official":{"samples":12,"ran":7,"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":"b5904cd2cd0fafdc","entry":"AGNewsProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","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":"b5904cd2cd0fafdc"}},{"code_sha256_prefix":"f7230cfb9b36d3c4","entry":"CoLAProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","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":"f7230cfb9b36d3c4"}},{"code_sha256_prefix":"ce45acf0ec906436","entry":"IMDbProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","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":"ce45acf0ec906436"}},{"code_sha256_prefix":"0a817115675763c5","entry":"TrecProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","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":"0a817115675763c5"}},{"code_sha256_prefix":"daf59baccdb52ea8","entry":"YahooProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","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":"daf59baccdb52ea8"}},{"code_sha256_prefix":"3fc1b95381f8ad18","entry":"tokenize_all_data_with_labels","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3fc1b95381f8ad18"}},{"code_sha256_prefix":"73ef3b2bed4d1799","entry":"tokenize_sentence_pair","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"73ef3b2bed4d1799"}},{"code_sha256_prefix":"d983d14088d5f77c","entry":"BeginWithLabels","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d983d14088d5f77c"}},{"code_sha256_prefix":"cab60337b12ac588","entry":"DBpediaProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cab60337b12ac588"}},{"code_sha256_prefix":"ebe613d902d97b5a","entry":"Sst2Processor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ebe613d902d97b5a"}},{"code_sha256_prefix":"8f91276efd0d5efa","entry":"Sst5Processor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8f91276efd0d5efa"}},{"code_sha256_prefix":"c5167763b85b8da8","entry":"YelpProcessor","repo":"thunlp/DPT","repo_kind":"official","path":"src/TextClassification/textcls/models/prompt_model.py","file_url":"https://github.com/thunlp/DPT/blob/HEAD/src/TextClassification/textcls/models/prompt_model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5167763b85b8da8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}