{"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/towards-understanding-and-mitigating-social","title":"Towards Understanding and Mitigating Social Biases in Language Models","arxiv_id":"2106.13219","date":"2021-06-24","proceeding":null,"authors":["Paul Pu Liang","Chiyu Wu","Louis-Philippe Morency","Ruslan Salakhutdinov"],"abstract":"As machine learning methods are deployed in real-world settings such as healthcare, legal systems, and social science, it is crucial to recognize how they shape social biases and stereotypes in these sensitive decision-making processes. Among such real-world deployments are large-scale pretrained language models (LMs) that can be potentially dangerous in manifesting undesirable representational biases - harmful biases resulting from stereotyping that propagate negative generalizations involving gender, race, religion, and other social constructs. As a step towards improving the fairness of LMs, we carefully define several sources of representational biases before proposing new benchmarks and metrics to measure them. With these tools, we propose steps towards mitigating social biases during text generation. Our empirical results and human evaluation demonstrate effectiveness in mitigating bias while retaining crucial contextual information for high-fidelity text generation, thereby pushing forward the performance-fairness Pareto frontier.","url_abs":"https://arxiv.org/abs/2106.13219v1","url_pdf":"https://arxiv.org/pdf/2106.13219v1.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":"towards-understanding-and-mitigating-social","repo_url":"https://github.com/pliang279/LM_bias","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"decision-making","task_name":"Decision Making"},{"task_slug":"fairness","task_name":"Fairness"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.13219","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.13219"}},"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/pliang279/LM_bias","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_violates":1,"ran":1,"unverified":8},"by_repo_kind":{"official":{"samples":10,"ran":2,"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":"6799d5b5e14819a0","entry":"dropspace","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/local_bias/utils.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/local_bias/utils.py","link_basis":"plan_row","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6799d5b5e14819a0"}},{"code_sha256_prefix":"c03f38aaa6f139a4","entry":"mean_ds","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/global_bias/generate_full_sentence.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/global_bias/generate_full_sentence.py","link_basis":"plan_row","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":"c03f38aaa6f139a4"}},{"code_sha256_prefix":"f9953b5f99184573","entry":"bias_subspace","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/data_preprocess/data_preprocess.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/data_preprocess/data_preprocess.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":"f9953b5f99184573"}},{"code_sha256_prefix":"9968a9c17ca67ba8","entry":"debias_effect_analysis","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/data_preprocess/context_nullspace_projection.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/data_preprocess/context_nullspace_projection.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":"9968a9c17ca67ba8"}},{"code_sha256_prefix":"5b1c7ec55f83eba3","entry":"doPCA","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/local_bias/utils.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/local_bias/utils.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":"5b1c7ec55f83eba3"}},{"code_sha256_prefix":"47b050cb9d471720","entry":"doPCA","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/data_preprocess/data_preprocess.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/data_preprocess/data_preprocess.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":"47b050cb9d471720"}},{"code_sha256_prefix":"80c3111674e64a2c","entry":"drop","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/global_bias/generate_full_sentence.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/global_bias/generate_full_sentence.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":"80c3111674e64a2c"}},{"code_sha256_prefix":"470a1bb6e1c053aa","entry":"drop_bias","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/local_bias/utils.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/local_bias/utils.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":"470a1bb6e1c053aa"}},{"code_sha256_prefix":"992ba37e8f011975","entry":"split_dataset","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/data_preprocess/context_nullspace_projection.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/data_preprocess/context_nullspace_projection.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":"992ba37e8f011975"}},{"code_sha256_prefix":"cf42150195c933b4","entry":"top_k_top_p_filtering","repo":"pliang279/LM_bias","repo_kind":"official","path":"src/global_bias/generate_full_sentence.py","file_url":"https://github.com/pliang279/LM_bias/blob/HEAD/src/global_bias/generate_full_sentence.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":"cf42150195c933b4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}