{"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/differentiable-prompt-makes-pre-trained","title":"Differentiable Prompt Makes Pre-trained Language Models Better Few-shot Learners","arxiv_id":"2108.13161","date":"2021-08-30","proceeding":"ICLR 2022 4","authors":["Ningyu Zhang","Luoqiu Li","Xiang Chen","Shumin Deng","Zhen Bi","Chuanqi Tan","Fei Huang","Huajun Chen"],"abstract":"Large-scale pre-trained language models have contributed significantly to natural language processing by demonstrating remarkable abilities as few-shot learners. However, their effectiveness depends mainly on scaling the model parameters and prompt design, hindering their implementation in most real-world applications. This study proposes a novel pluggable, extensible, and efficient approach named DifferentiAble pRompT (DART), which can convert small language models into better few-shot learners without any prompt engineering. The main principle behind this approach involves reformulating potential natural language processing tasks into the task of a pre-trained language model and differentially optimizing the prompt template as well as the target label with backpropagation. Furthermore, the proposed approach can be: (i) Plugged to any pre-trained language models; (ii) Extended to widespread classification tasks. A comprehensive evaluation of standard NLP tasks demonstrates that the proposed approach achieves a better few-shot performance. Code is available in https://github.com/zjunlp/DART.","url_abs":"https://arxiv.org/abs/2108.13161v7","url_pdf":"https://arxiv.org/pdf/2108.13161v7.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":"differentiable-prompt-makes-pre-trained","repo_url":"https://github.com/zjunlp/DART","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"differentiable-prompt-makes-pre-trained","repo_url":"https://github.com/paperspapers/badprompt","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"differentiable-prompt-makes-pre-trained","repo_url":"https://github.com/zhaohan-xi/plm-prompt-defense","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"differentiable-prompt-makes-pre-trained","repo_url":"https://github.com/zhengxiangshi/powerfulpromptft","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"prompt-engineering","task_name":"Prompt Engineering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/few-shot-learning-on-cr","task":"Few-Shot Learning","dataset":"CR","model":"DART","rank_in_archive_order":1,"of":1,"metrics":{"Acc":"91.8(0.5)"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-learning-on-glue-qqp","task":"Few-Shot Learning","dataset":"GLUE QQP","model":"DART","rank_in_archive_order":1,"of":1,"metrics":{"F1-score":"67.8(3.2)"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-learning-on-mr","task":"Few-Shot Learning","dataset":"MR","model":"DART","rank_in_archive_order":1,"of":1,"metrics":{"Acc":"88.2(1.0)"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-learning-on-mrpc","task":"Few-Shot Learning","dataset":"MRPC","model":"DART","rank_in_archive_order":1,"of":1,"metrics":{"F1-score":"78.3(4.5)"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-learning-on-sst-2-binary","task":"Few-Shot Learning","dataset":"SST-2 Binary classification","model":"DART","rank_in_archive_order":1,"of":1,"metrics":{"Acc":"93.5(0.5)"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.13161","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.13161"}},"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/zjunlp/DART","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhengxiangshi/powerfulpromptft","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/paperspapers/badprompt","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhaohan-xi/plm-prompt-defense","reach":null}],"summary":{"ran":3,"unverified":1},"by_repo_kind":{"official":{"samples":2,"ran":2,"repositories":1},"listed":{"samples":2,"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":0,"samples":[{"code_sha256_prefix":"a878fc6c8d69a825","entry":"DiffPET","repo":"zhaohan-xi/plm-prompt-defense","repo_kind":"listed","path":"src/model.py","file_url":"https://github.com/zhaohan-xi/plm-prompt-defense/blob/HEAD/src/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":"a878fc6c8d69a825"}},{"code_sha256_prefix":"fae89cb97e18344e","entry":"DiffPET","repo":"zjunlp/DART","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/zjunlp/DART/blob/HEAD/src/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":"fae89cb97e18344e"}},{"code_sha256_prefix":"f50a2e625707084d","entry":"PET","repo":"zjunlp/DART","repo_kind":"official","path":"src/model.py","file_url":"https://github.com/zjunlp/DART/blob/HEAD/src/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":"f50a2e625707084d"}},{"code_sha256_prefix":"9f8852fc911e2924","entry":"PET","repo":"zhaohan-xi/plm-prompt-defense","repo_kind":"listed","path":"src/model.py","file_url":"https://github.com/zhaohan-xi/plm-prompt-defense/blob/HEAD/src/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":"9f8852fc911e2924"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}