{"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/the-complexity-dynamics-of-grokking","title":"The Complexity Dynamics of Grokking","arxiv_id":"2412.09810","date":"2024-12-13","proceeding":null,"authors":["Branton DeMoss","Silvia Sapora","Jakob Foerster","Nick Hawes","Ingmar Posner"],"abstract":"We investigate the phenomenon of generalization through the lens of compression. In particular, we study the complexity dynamics of neural networks to explain grokking, where networks suddenly transition from memorizing to generalizing solutions long after over-fitting the training data. To this end we introduce a new measure of intrinsic complexity for neural networks based on the theory of Kolmogorov complexity. Tracking this metric throughout network training, we find a consistent pattern in training dynamics, consisting of a rise and fall in complexity. We demonstrate that this corresponds to memorization followed by generalization. Based on insights from rate--distortion theory and the minimum description length principle, we lay out a principled approach to lossy compression of neural networks, and connect our complexity measure to explicit generalization bounds. Based on a careful analysis of information capacity in neural networks, we propose a new regularization method which encourages networks towards low-rank representations by penalizing their spectral entropy, and find that our regularizer outperforms baselines in total compression of the dataset.","url_abs":"https://arxiv.org/abs/2412.09810v1","url_pdf":"https://arxiv.org/pdf/2412.09810v1.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":"the-complexity-dynamics-of-grokking","repo_url":"https://github.com/brantondemoss/GrokkingComplexity","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"generalization-bounds","task_name":"Generalization Bounds"},{"task_slug":"memorization","task_name":"Memorization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2412.09810","atlas_url":"https://app.syntology.ai/?focus=2412.09810","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.09810"}},"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/brantondemoss/GrokkingComplexity","reach":{"status":"ok"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"ran":0,"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":3,"samples":[{"code_sha256_prefix":"8a0d42057492f51b","entry":"generate_modular_arithmetic_data","repo":"brantondemoss/GrokkingComplexity","repo_kind":"official","path":"data_gen.py","file_url":"https://github.com/brantondemoss/GrokkingComplexity/blob/HEAD/data_gen.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":"8a0d42057492f51b"}},{"code_sha256_prefix":"8c4cfdec281721af","entry":"generate_modular_arithmetic_data2","repo":"brantondemoss/GrokkingComplexity","repo_kind":"official","path":"data_gen.py","file_url":"https://github.com/brantondemoss/GrokkingComplexity/blob/HEAD/data_gen.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":"8c4cfdec281721af"}},{"code_sha256_prefix":"3777318563fec7f7","entry":"modular_inverse","repo":"brantondemoss/GrokkingComplexity","repo_kind":"official","path":"data_gen.py","file_url":"https://github.com/brantondemoss/GrokkingComplexity/blob/HEAD/data_gen.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":"3777318563fec7f7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}