{"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-epochal-sawtooth-effect-unveiling","title":"The Epochal Sawtooth Effect: Unveiling Training Loss Oscillations in Adam and Other Optimizers","arxiv_id":"2410.10056","date":"2024-10-14","proceeding":null,"authors":["Qi Liu","Wanjing Ma"],"abstract":"In this paper, we identify and analyze a recurring training loss pattern, which we term the \\textit{Epochal Sawtooth Effect (ESE)}, commonly observed during training with adaptive gradient-based optimizers, particularly Adam optimizer. This pattern is characterized by a sharp drop in loss at the beginning of each epoch, followed by a gradual increase, resulting in a sawtooth-shaped loss curve. Through empirical observations, we demonstrate that while this effect is most pronounced with Adam, it persists, although less severely, with other optimizers such as RMSProp. We provide an in-depth explanation of the underlying mechanisms that lead to the Epochal Sawtooth Effect. The influences of factors like \\(\\beta\\), batch size, data shuffling on this pattern have been studied. We quantify the influence of \\(\\beta_2\\) on the shape of the loss curve, showing that higher values of \\(\\beta_2\\) result in a nearly linear increase in loss, while lower values create a concave upward trend. Our analysis reveals that this behavior stems from the adaptive learning rate controlled by the second moment estimate, with \\(\\beta_1\\) playing a minimal role when \\(\\beta_2\\) is large. To support our analysis, we replicate this phenomenon through a controlled quadratic minimization task. By incrementally solving a series of quadratic optimization problems using Adam, we demonstrate that the Epochal Sawtooth Effect can emerge even in simple optimization scenarios, reinforcing the generality of this pattern. This paper provides both theoretical insights and quantitative analysis, offering a comprehensive understanding of this ubiquitous phenomenon in modern optimization techniques.","url_abs":"https://arxiv.org/abs/2410.10056v1","url_pdf":"https://arxiv.org/pdf/2410.10056v1.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-epochal-sawtooth-effect-unveiling","repo_url":"https://github.com/qiliuchn/training-loss-pattern","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"rmsprop","method_name":"RMSProp"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.10056","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.10056"}},"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/qiliuchn/training-loss-pattern","reach":null}],"summary":{"ran_fixture":1,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"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":"9969036731dc9e9b","entry":"accuracy_mlm","repo":"qiliuchn/training-loss-pattern","repo_kind":"official","path":"bert.py","file_url":"https://github.com/qiliuchn/training-loss-pattern/blob/HEAD/bert.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9969036731dc9e9b"}},{"code_sha256_prefix":"a5443ceaf074583c","entry":"accuracy_nsp","repo":"qiliuchn/training-loss-pattern","repo_kind":"official","path":"bert.py","file_url":"https://github.com/qiliuchn/training-loss-pattern/blob/HEAD/bert.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a5443ceaf074583c"}},{"code_sha256_prefix":"d58b94187f8d45ba","entry":"create_object","repo":"qiliuchn/training-loss-pattern","repo_kind":"official","path":"bert.py","file_url":"https://github.com/qiliuchn/training-loss-pattern/blob/HEAD/bert.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":"d58b94187f8d45ba"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}