{"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/linguistic-collapse-neural-collapse-in-large","title":"Linguistic Collapse: Neural Collapse in (Large) Language Models","arxiv_id":"2405.17767","date":"2024-05-28","proceeding":null,"authors":["Robert Wu","Vardan Papyan"],"abstract":"Neural collapse ($\\mathcal{NC}$) is a phenomenon observed in classification tasks where top-layer representations collapse into their class means, which become equinorm, equiangular and aligned with the classifiers. These behaviours -- associated with generalization and robustness -- would manifest under specific conditions: models are trained towards zero loss, with noise-free labels belonging to balanced classes, which do not outnumber the model's hidden dimension. Recent studies have explored $\\mathcal{NC}$ in the absence of one or more of these conditions to extend and capitalize on the associated benefits of ideal geometries. Language modelling presents a curious frontier, as \\textit{training by token prediction} constitutes a classification task where none of the conditions exist: the vocabulary is imbalanced and exceeds the embedding dimension; different tokens might correspond to similar contextual embeddings; and large language models (LLMs) in particular are typically only trained for a few epochs. This paper empirically investigates the impact of scaling the architectures and training of causal language models (CLMs) on their progression towards $\\mathcal{NC}$. We find that $\\mathcal{NC}$ properties that develop with scale (and regularization) are linked to generalization. Moreover, there is evidence of some relationship between $\\mathcal{NC}$ and generalization independent of scale. Our work thereby underscores the generality of $\\mathcal{NC}$ as it extends to the novel and more challenging setting of language modelling. Downstream, we seek to inspire further research on the phenomenon to deepen our understanding of LLMs -- and neural networks at large -- and improve existing architectures based on $\\mathcal{NC}$-related properties. Our code is hosted on GitHub at https://github.com/rhubarbwu/linguistic-collapse .","url_abs":"https://arxiv.org/abs/2405.17767v3","url_pdf":"https://arxiv.org/pdf/2405.17767v3.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":"linguistic-collapse-neural-collapse-in-large","repo_url":"https://github.com/rhubarbwu/linguistic-collapse","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"linguistic-collapse-neural-collapse-in-large","repo_url":"https://github.com/rhubarbwu/neural-collapse","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.17767","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.17767"}},"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":"deterministic:regex_extraction","url":"https://github.com/huggingface/transformers","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/rhubarbwu/linguistic-collapse","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rhubarbwu/neural-collapse","reach":null}],"summary":{"ran_fixture":2,"ran":9,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":14,"ran":12,"repositories":2}},"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":11,"samples":[{"code_sha256_prefix":"23ee2dc74782210f","entry":"covariance_ratio","repo":"rhubarbwu/neural-collapse","repo_kind":"official","path":"neural_collapse/measure.py","file_url":"https://github.com/rhubarbwu/neural-collapse/blob/HEAD/neural_collapse/measure.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23ee2dc74782210f"}},{"code_sha256_prefix":"2630c6d4643a1419","entry":"create_df","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/statistics.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/statistics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2630c6d4643a1419"}},{"code_sha256_prefix":"ef684a857d2c2e99","entry":"get_config","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/model.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/model.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":"ef684a857d2c2e99"}},{"code_sha256_prefix":"cc0336c0a472132a","entry":"is_float","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/utils.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/utils.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":"cc0336c0a472132a"}},{"code_sha256_prefix":"7bfc97afc567d6e7","entry":"mean_norms","repo":"rhubarbwu/neural-collapse","repo_kind":"official","path":"neural_collapse/measure.py","file_url":"https://github.com/rhubarbwu/neural-collapse/blob/HEAD/neural_collapse/measure.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7bfc97afc567d6e7"}},{"code_sha256_prefix":"95008376dc4e1a67","entry":"numerate","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/utils.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/utils.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":"95008376dc4e1a67"}},{"code_sha256_prefix":"8ef531ec328be202","entry":"process_batch","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/collection.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/collection.py","link_basis":"harvester_set","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":"8ef531ec328be202"}},{"code_sha256_prefix":"e24bcfffa5b6a278","entry":"select_ckpt","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/model.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e24bcfffa5b6a278"}},{"code_sha256_prefix":"509e214fe73e4295","entry":"select_int_type","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/utils.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/utils.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":"509e214fe73e4295"}},{"code_sha256_prefix":"07dd1a4ae14651c9","entry":"shuffle","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"count.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/count.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":"07dd1a4ae14651c9"}},{"code_sha256_prefix":"cc361c2f7b68b11d","entry":"truncate_and_pad","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/collection.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/collection.py","link_basis":"harvester_set","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":"cc361c2f7b68b11d"}},{"code_sha256_prefix":"238be78502fd3fae","entry":"variability_cdnv","repo":"rhubarbwu/neural-collapse","repo_kind":"official","path":"neural_collapse/measure.py","file_url":"https://github.com/rhubarbwu/neural-collapse/blob/HEAD/neural_collapse/measure.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"238be78502fd3fae"}},{"code_sha256_prefix":"db4e45385bfd12df","entry":"get_data_as_chunks","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/data.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"db4e45385bfd12df"}},{"code_sha256_prefix":"46a83c0ef5d4338f","entry":"get_tokenizer","repo":"rhubarbwu/linguistic-collapse","repo_kind":"official","path":"lib/model.py","file_url":"https://github.com/rhubarbwu/linguistic-collapse/blob/HEAD/lib/model.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"46a83c0ef5d4338f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}