{"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/last-layer-fairness-fine-tuning-is-simple-and","title":"Last-Layer Fairness Fine-tuning is Simple and Effective for Neural Networks","arxiv_id":"2304.03935","date":"2023-04-08","proceeding":null,"authors":["Yuzhen Mao","Zhun Deng","Huaxiu Yao","Ting Ye","Kenji Kawaguchi","James Zou"],"abstract":"As machine learning has been deployed ubiquitously across applications in modern data science, algorithmic fairness has become a great concern. Among them, imposing fairness constraints during learning, i.e. in-processing fair training, has been a popular type of training method because they don't require accessing sensitive attributes during test time in contrast to post-processing methods. While this has been extensively studied in classical machine learning models, their impact on deep neural networks remains unclear. Recent research has shown that adding fairness constraints to the objective function leads to severe over-fitting to fairness criteria in large models, and how to solve this challenge is an important open question. To tackle this, we leverage the wisdom and power of pre-training and fine-tuning and develop a simple but novel framework to train fair neural networks in an efficient and inexpensive way -- last-layer fine-tuning alone can effectively promote fairness in deep neural networks. This framework offers valuable insights into representation learning for training fair neural networks.","url_abs":"https://arxiv.org/abs/2304.03935v2","url_pdf":"https://arxiv.org/pdf/2304.03935v2.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":"last-layer-fairness-fine-tuning-is-simple-and","repo_url":"https://github.com/yuzhenmao/fairness-finetuning","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"last-layer-fairness-fine-tuning-is-simple-and","repo_url":"https://github.com/modar7/the_fairness_stitch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"fairness","task_name":"Fairness"},{"task_slug":"open-question","task_name":"Open-Ended Question Answering"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[{"method_slug":"test","method_name":"Test"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2304.03935","atlas_url":"https://app.syntology.ai/?focus=2304.03935","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2304.03935"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/modar7/the_fairness_stitch","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuzhenmao/fairness-finetuning","reach":{"status":"ok"}}],"summary":{"ran":13,"unverified":1},"by_repo_kind":{"listed":{"samples":14,"ran":13,"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":"b113af2bdb4b7ad0","entry":"accuracy_equality_difference","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/metrics.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/metrics.py","link_basis":"harvester_set","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":"b113af2bdb4b7ad0"}},{"code_sha256_prefix":"3e2bcc37f0d29b39","entry":"ae_constraint","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/fairness_constraints.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/fairness_constraints.py","link_basis":"harvester_set","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":"3e2bcc37f0d29b39"}},{"code_sha256_prefix":"f34aff34be2461e9","entry":"compute_auc","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils_abroca.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils_abroca.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f34aff34be2461e9"}},{"code_sha256_prefix":"5bf52700b6ec83bf","entry":"compute_roc","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils_abroca.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils_abroca.py","link_basis":"harvester_set","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":"5bf52700b6ec83bf"}},{"code_sha256_prefix":"d1f364aa232405ad","entry":"eo_constraint","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/fairness_constraints.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/fairness_constraints.py","link_basis":"harvester_set","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":"d1f364aa232405ad"}},{"code_sha256_prefix":"c691b280c17d59c0","entry":"get_pred","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils.py","link_basis":"harvester_set","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":"c691b280c17d59c0"}},{"code_sha256_prefix":"0f0267a4b0a6ffd7","entry":"get_pred_Stitched_Model","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils.py","link_basis":"harvester_set","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":"0f0267a4b0a6ffd7"}},{"code_sha256_prefix":"833b23ea24be2333","entry":"interpolate_roc_fun","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils_abroca.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils_abroca.py","link_basis":"harvester_set","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":"833b23ea24be2333"}},{"code_sha256_prefix":"33a0eb0cb76eac7a","entry":"max_min_fairness","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/metrics.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/metrics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33a0eb0cb76eac7a"}},{"code_sha256_prefix":"1fda7cb005b7308f","entry":"mmf_constraint","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/fairness_constraints.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/fairness_constraints.py","link_basis":"harvester_set","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":"1fda7cb005b7308f"}},{"code_sha256_prefix":"c700a303a2482780","entry":"prepare_data","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/data_processing.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/data_processing.py","link_basis":"harvester_set","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":"c700a303a2482780"}},{"code_sha256_prefix":"3016678b713de42a","entry":"print_acc_auc_stats","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/utils.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/utils.py","link_basis":"harvester_set","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":"3016678b713de42a"}},{"code_sha256_prefix":"69501a60076aa16a","entry":"valid_per_epoch","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/FDR.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/FDR.py","link_basis":"harvester_set","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":"69501a60076aa16a"}},{"code_sha256_prefix":"77748e5ebfbb1e32","entry":"compute_abroca","repo":"modar7/the_fairness_stitch","repo_kind":"listed","path":"src/compute_abroca.py","file_url":"https://github.com/modar7/the_fairness_stitch/blob/HEAD/src/compute_abroca.py","link_basis":"harvester_set","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":"77748e5ebfbb1e32"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}