{"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/explore-spurious-correlations-at-the-concept","title":"Explore Spurious Correlations at the Concept Level in Language Models for Text Classification","arxiv_id":"2311.08648","date":"2023-11-15","proceeding":null,"authors":["YuHang Zhou","Paiheng Xu","Xiaoyu Liu","Bang An","Wei Ai","Furong Huang"],"abstract":"Language models (LMs) have achieved notable success in numerous NLP tasks, employing both fine-tuning and in-context learning (ICL) methods. While language models demonstrate exceptional performance, they face robustness challenges due to spurious correlations arising from imbalanced label distributions in training data or ICL exemplars. Previous research has primarily concentrated on word, phrase, and syntax features, neglecting the concept level, often due to the absence of concept labels and difficulty in identifying conceptual content in input texts. This paper introduces two main contributions. First, we employ ChatGPT to assign concept labels to texts, assessing concept bias in models during fine-tuning or ICL on test data. We find that LMs, when encountering spurious correlations between a concept and a label in training or prompts, resort to shortcuts for predictions. Second, we introduce a data rebalancing technique that incorporates ChatGPT-generated counterfactual data, thereby balancing label distribution and mitigating spurious correlations. Our method's efficacy, surpassing traditional token removal approaches, is validated through extensive testing.","url_abs":"https://arxiv.org/abs/2311.08648v4","url_pdf":"https://arxiv.org/pdf/2311.08648v4.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":"explore-spurious-correlations-at-the-concept","repo_url":"https://github.com/tonyzhou98/concept-spurious-correlation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"text-classification","task_name":"Text Classification"},{"task_slug":null,"task_name":"counterfactual"},{"task_slug":"text-classification-1","task_name":"text-classification"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2311.08648","atlas_url":"https://app.syntology.ai/?focus=2311.08648","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.08648"}},"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/tonyzhou98/concept-spurious-correlation","reach":{"status":"ok"}}],"summary":{"ran":6},"by_repo_kind":{"official":{"samples":6,"ran":6,"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":6,"samples":[{"code_sha256_prefix":"91628dd70a053ee2","entry":"clean_newsgroup_data","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"LLM-Finetuning/llama2/prompts.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/LLM-Finetuning/llama2/prompts.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"91628dd70a053ee2"}},{"code_sha256_prefix":"6eb13383c674fa55","entry":"evaluate_llm","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"LLM-Finetuning/llama2/llama2_classification.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/LLM-Finetuning/llama2/llama2_classification.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6eb13383c674fa55"}},{"code_sha256_prefix":"af6f5e5d99e7b536","entry":"get_newsgroup_instruction_data","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"LLM-Finetuning/llama2/prompts.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/LLM-Finetuning/llama2/prompts.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"af6f5e5d99e7b536"}},{"code_sha256_prefix":"1c135e401dbd9771","entry":"high_association_word","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"train_bert.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/train_bert.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1c135e401dbd9771"}},{"code_sha256_prefix":"0bdcb58337e74143","entry":"mask_out_name","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"train_bert.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/train_bert.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0bdcb58337e74143"}},{"code_sha256_prefix":"e7476b81a2377075","entry":"mask_words","repo":"tonyzhou98/concept-spurious-correlation","repo_kind":"official","path":"train_bert.py","file_url":"https://github.com/tonyzhou98/concept-spurious-correlation/blob/HEAD/train_bert.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e7476b81a2377075"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}