{"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/co-2-pt-mitigating-bias-in-pre-trained","title":"Co$^2$PT: Mitigating Bias in Pre-trained Language Models through Counterfactual Contrastive Prompt Tuning","arxiv_id":"2310.12490","date":"2023-10-19","proceeding":null,"authors":["Xiangjue Dong","Ziwei Zhu","Zhuoer Wang","Maria Teleki","James Caverlee"],"abstract":"Pre-trained Language Models are widely used in many important real-world applications. However, recent studies show that these models can encode social biases from large pre-training corpora and even amplify biases in downstream applications. To address this challenge, we propose Co$^2$PT, an efficient and effective debias-while-prompt tuning method for mitigating biases via counterfactual contrastive prompt tuning on downstream tasks. Our experiments conducted on three extrinsic bias benchmarks demonstrate the effectiveness of Co$^2$PT on bias mitigation during the prompt tuning process and its adaptability to existing upstream debiased language models. These findings indicate the strength of Co$^2$PT and provide promising avenues for further enhancement in bias mitigation on downstream tasks.","url_abs":"https://arxiv.org/abs/2310.12490v1","url_pdf":"https://arxiv.org/pdf/2310.12490v1.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":"co-2-pt-mitigating-bias-in-pre-trained","repo_url":"https://github.com/dongxiangjue/co2pt","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.12490","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.12490"}},"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/dongxiangjue/co2pt","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":3,"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":"fa01b5b8e01b77d4","entry":"get_dataset_bias_sts","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"eval_stsb_bias.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/eval_stsb_bias.py","link_basis":"first_harvest_node","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":"fa01b5b8e01b77d4"}},{"code_sha256_prefix":"21d57ae08cc22eae","entry":"predict_bias_sts","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"eval_stsb_bias.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/eval_stsb_bias.py","link_basis":"first_harvest_node","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":"21d57ae08cc22eae"}},{"code_sha256_prefix":"1274041025ba5fa3","entry":"rms_diff","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"eval_bios.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/eval_bios.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1274041025ba5fa3"}},{"code_sha256_prefix":"c59d7bc602a19b78","entry":"eval_model","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"eval_bios.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/eval_bios.py","link_basis":"first_harvest_node","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":"c59d7bc602a19b78"}},{"code_sha256_prefix":"25a3833a09960a7b","entry":"evaluate","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"run_base_bios.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/run_base_bios.py","link_basis":"first_harvest_node","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":"25a3833a09960a7b"}},{"code_sha256_prefix":"e88f5ae373011d6c","entry":"process_data","repo":"dongxiangjue/co2pt","repo_kind":"official","path":"eval_bios.py","file_url":"https://github.com/dongxiangjue/co2pt/blob/HEAD/eval_bios.py","link_basis":"first_harvest_node","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":"e88f5ae373011d6c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}