{"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/grokking-generalization-beyond-overfitting-on","title":"Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasets","arxiv_id":"2201.02177","date":"2022-01-06","proceeding":null,"authors":["Alethea Power","Yuri Burda","Harri Edwards","Igor Babuschkin","Vedant Misra"],"abstract":"In this paper we propose to study generalization of neural networks on small algorithmically generated datasets. In this setting, questions about data efficiency, memorization, generalization, and speed of learning can be studied in great detail. In some situations we show that neural networks learn through a process of \"grokking\" a pattern in the data, improving generalization performance from random chance level to perfect generalization, and that this improvement in generalization can happen well past the point of overfitting. We also study generalization as a function of dataset size and find that smaller datasets require increasing amounts of optimization for generalization. We argue that these datasets provide a fertile ground for studying a poorly understood aspect of deep learning: generalization of overparametrized neural networks beyond memorization of the finite training dataset.","url_abs":"https://arxiv.org/abs/2201.02177v1","url_pdf":"https://arxiv.org/pdf/2201.02177v1.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":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/openai/grok","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/danielmamay/grokking","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/ironjr/grokfast","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/kindxiaoming/omnigrok","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/Sea-Snell/grokking","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"grokking-generalization-beyond-overfitting-on","repo_url":"https://github.com/teddykoker/grokking","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"memorization","task_name":"Memorization"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2201.02177","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2201.02177"}},"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/Sea-Snell/grokking","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/openai/grok","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/teddykoker/grokking","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/danielmamay/grokking","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ironjr/grokfast","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kindxiaoming/omnigrok","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":2,"unverified":12},"by_repo_kind":{"official":{"samples":9,"ran":0,"repositories":1},"listed":{"samples":5,"ran":2,"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":0,"samples":[{"code_sha256_prefix":"b1849c24fbb69bfa","entry":"gradfilter_ema","repo":"ironjr/grokfast","repo_kind":"listed","path":"grokfast.py","file_url":"https://github.com/ironjr/grokfast/blob/HEAD/grokfast.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b1849c24fbb69bfa"}},{"code_sha256_prefix":"2617e928ebfb8675","entry":"gradfilter_ma","repo":"ironjr/grokfast","repo_kind":"listed","path":"grokfast.py","file_url":"https://github.com/ironjr/grokfast/blob/HEAD/grokfast.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2617e928ebfb8675"}},{"code_sha256_prefix":"8e9ee805c0204396","entry":"compute_measure","repo":"openai/grok","repo_kind":"official","path":"grok/metrics.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/metrics.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":"8e9ee805c0204396"}},{"code_sha256_prefix":"e95fa4ee731c03ea","entry":"factor_expts","repo":"openai/grok","repo_kind":"official","path":"grok/visualization.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/visualization.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":"e95fa4ee731c03ea"}},{"code_sha256_prefix":"ab942b3fd9d96975","entry":"get_data_loaders","repo":"danielmamay/grokking","repo_kind":"listed","path":"grokking/data.py","file_url":"https://github.com/danielmamay/grokking/blob/HEAD/grokking/data.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":"ab942b3fd9d96975"}},{"code_sha256_prefix":"c1c618e180dfc666","entry":"get_device","repo":"danielmamay/grokking","repo_kind":"listed","path":"grokking/training.py","file_url":"https://github.com/danielmamay/grokking/blob/HEAD/grokking/training.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":"c1c618e180dfc666"}},{"code_sha256_prefix":"61f1915864fc4345","entry":"get_loss_and_grads","repo":"openai/grok","repo_kind":"official","path":"grok/measure.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/measure.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":"61f1915864fc4345"}},{"code_sha256_prefix":"739eddc60be1c197","entry":"get_sharpness","repo":"openai/grok","repo_kind":"official","path":"grok/measure.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/measure.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":"739eddc60be1c197"}},{"code_sha256_prefix":"269ed6282c593f2f","entry":"get_weights","repo":"openai/grok","repo_kind":"official","path":"grok/measure.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/measure.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":"269ed6282c593f2f"}},{"code_sha256_prefix":"7564745b254db80c","entry":"load_metric_data","repo":"openai/grok","repo_kind":"official","path":"grok/visualization.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/visualization.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":"7564745b254db80c"}},{"code_sha256_prefix":"ecac6edaeb33872c","entry":"most_interesting","repo":"openai/grok","repo_kind":"official","path":"grok/visualization.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/visualization.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":"ecac6edaeb33872c"}},{"code_sha256_prefix":"458780ffac6c9c58","entry":"norm","repo":"openai/grok","repo_kind":"official","path":"grok/metrics.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/metrics.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":"458780ffac6c9c58"}},{"code_sha256_prefix":"7a0e73ebc4aab88f","entry":"op_norm","repo":"openai/grok","repo_kind":"official","path":"grok/metrics.py","file_url":"https://github.com/openai/grok/blob/HEAD/grok/metrics.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":"7a0e73ebc4aab88f"}},{"code_sha256_prefix":"f02ef440c5bcd946","entry":"operation_mod_p_data","repo":"danielmamay/grokking","repo_kind":"listed","path":"grokking/data.py","file_url":"https://github.com/danielmamay/grokking/blob/HEAD/grokking/data.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":"f02ef440c5bcd946"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}