{"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/arxiv-2606-14259","title":"Beyond a Single Explanation of the Adam--SGD Gap","arxiv_id":"2606.14259","date":"2026-06-12","proceeding":null,"authors":["Chenxiang Zhang","Rustem Islamov","Enea Monzio Compagnoni","Jun Pang","Aurelien Lucchi","Antonio Orvieto"],"abstract":"Prior work has identified several factors that can contribute to the performance gap between Adam and SGD, spanning data aspects, architecture design, and optimization properties. Yet these explanations are often studied in isolation, leaving their relative importance unclear. In this work, we revisit these hypotheses through a controlled empirical study across vision, language, genomics, and graph tasks, spanning modern and classical architectures, and carefully designed training setups. Our results suggest that no single factor consistently explains the Adam--SGD gap. For instance, the Adam advantage can (1) persist under a uniform vocabulary distribution yet nearly disappear under a heavy-tailed one; (2) reverse in favor of SGD in softmax-attention models; and (3) become larger under soft architectural modifications, e.g., when ReLU is replaced by a GeLU nonlinearity. This suggests that the gap arises from nontrivial data and architecture interactions, rather than from a single common factor. Yet, we observe a pattern across our settings: a \\emph{crossover batch size} at which the relative advantage shifts from SGD to Adam as the batch size scales. These empirical results are captured by our theoretical gap model, which predicts this batch-size-dependent crossover. Our perspective helps reconcile several existing hypotheses while offering practical insights across domains.","url_abs":"https://arxiv.org/abs/2606.14259","url_pdf":"https://arxiv.org/pdf/2606.14259","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2606.14259","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.14259"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/lucidrains/vit-pytorch","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/LiamMa/GRIT","reach":{"status":"ok","spdx":"MIT"}},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/orientino/gap","reach":null}],"summary":{"ran":22,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":25,"ran":22,"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":"ecf14287d3465c48","entry":"accuracy_SBM","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/logger.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/logger.py","link_basis":"first_harvest_node","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":"ecf14287d3465c48"}},{"code_sha256_prefix":"9ca8f33fe86bb265","entry":"add_aggregate_loss","repo":"orientino/gap","repo_kind":"found_in_text","path":"_plot_utils.py","file_url":"https://github.com/orientino/gap/blob/HEAD/_plot_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9ca8f33fe86bb265"}},{"code_sha256_prefix":"c400816c9ec79f9f","entry":"apply_rotary_emb","repo":"orientino/gap","repo_kind":"found_in_text","path":"language/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/language/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c400816c9ec79f9f"}},{"code_sha256_prefix":"85a782a793e8ffe1","entry":"compute_axial_cis","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"85a782a793e8ffe1"}},{"code_sha256_prefix":"2d81ed4b2a99020d","entry":"convnext_tiny","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model_convnext.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model_convnext.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2d81ed4b2a99020d"}},{"code_sha256_prefix":"9dc78001d467fc9d","entry":"eval_spearmanr","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/logger.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/logger.py","link_basis":"first_harvest_node","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":"9dc78001d467fc9d"}},{"code_sha256_prefix":"ca1f47b2a6e190ce","entry":"gcnn_small","repo":"orientino/gap","repo_kind":"found_in_text","path":"language/model_gcnn.py","file_url":"https://github.com/orientino/gap/blob/HEAD/language/model_gcnn.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ca1f47b2a6e190ce"}},{"code_sha256_prefix":"4740a336be8375d0","entry":"get_dataloaders","repo":"orientino/gap","repo_kind":"found_in_text","path":"genomics/data.py","file_url":"https://github.com/orientino/gap/blob/HEAD/genomics/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4740a336be8375d0"}},{"code_sha256_prefix":"1bb331bf70a78136","entry":"get_final_pretrained_ckpt","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/finetuning.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/finetuning.py","link_basis":"first_harvest_node","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":"1bb331bf70a78136"}},{"code_sha256_prefix":"2e17c467e6e1c07f","entry":"get_hg38_char_dataloaders","repo":"orientino/gap","repo_kind":"found_in_text","path":"genomics/data.py","file_url":"https://github.com/orientino/gap/blob/HEAD/genomics/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2e17c467e6e1c07f"}},{"code_sha256_prefix":"cb48934d64099708","entry":"get_hg38_kmer_dataloaders","repo":"orientino/gap","repo_kind":"found_in_text","path":"genomics/data.py","file_url":"https://github.com/orientino/gap/blob/HEAD/genomics/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cb48934d64099708"}},{"code_sha256_prefix":"b5c9e7acf599a98a","entry":"get_log_deg","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/layer/grit_layer.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/layer/grit_layer.py","link_basis":"first_harvest_node","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":"b5c9e7acf599a98a"}},{"code_sha256_prefix":"3896a13d569e632c","entry":"gpt_small","repo":"orientino/gap","repo_kind":"found_in_text","path":"language/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/language/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3896a13d569e632c"}},{"code_sha256_prefix":"9e4db46ba20af98e","entry":"init_model_from_pretrained","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/finetuning.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/finetuning.py","link_basis":"first_harvest_node","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":"9e4db46ba20af98e"}},{"code_sha256_prefix":"27d774f9c3ee1a49","entry":"init_t_xy","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"27d774f9c3ee1a49"}},{"code_sha256_prefix":"0ab15fea2bec5aaf","entry":"posemb_sincos_1d","repo":"orientino/gap","repo_kind":"found_in_text","path":"language/model_gcnn.py","file_url":"https://github.com/orientino/gap/blob/HEAD/language/model_gcnn.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0ab15fea2bec5aaf"}},{"code_sha256_prefix":"07d78260ee121828","entry":"precompute_freqs_cis","repo":"orientino/gap","repo_kind":"found_in_text","path":"language/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/language/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07d78260ee121828"}},{"code_sha256_prefix":"2a42dbf54fd0d1fe","entry":"reshape_for_broadcast","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a42dbf54fd0d1fe"}},{"code_sha256_prefix":"8d60dd66630e993f","entry":"resnet18","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model_resnet.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model_resnet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8d60dd66630e993f"}},{"code_sha256_prefix":"b592361a494969d3","entry":"resnet50","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model_resnet.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model_resnet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b592361a494969d3"}},{"code_sha256_prefix":"f4248ba076d7cd2b","entry":"resnet_transition","repo":"orientino/gap","repo_kind":"found_in_text","path":"vision/model_transition.py","file_url":"https://github.com/orientino/gap/blob/HEAD/vision/model_transition.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f4248ba076d7cd2b"}},{"code_sha256_prefix":"47e492109e6d308f","entry":"subtoken_cross_entropy","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/loss/subtoken_prediction_loss.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/loss/subtoken_prediction_loss.py","link_basis":"first_harvest_node","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":"47e492109e6d308f"}},{"code_sha256_prefix":"dc82c18c9d42c1c1","entry":"adj_l1_losses","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/loss/adj.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/loss/adj.py","link_basis":"first_harvest_node","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":"dc82c18c9d42c1c1"}},{"code_sha256_prefix":"d59c374db2cf64ae","entry":"l1_losses","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/loss/l1.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/loss/l1.py","link_basis":"first_harvest_node","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":"d59c374db2cf64ae"}},{"code_sha256_prefix":"f1cbbbc857d8b871","entry":"multilabel_cross_entropy","repo":"LiamMa/GRIT","repo_kind":"found_in_text","path":"grit/loss/multilabel_classification_loss.py","file_url":"https://github.com/LiamMa/GRIT/blob/HEAD/grit/loss/multilabel_classification_loss.py","link_basis":"first_harvest_node","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":"f1cbbbc857d8b871"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}