[Paper Review] Mixing ADAM and SGD: a Combined Optimization Method
This paper proposes MAS (Mixing ADAM and SGD), a novel optimization method that simultaneously combines stochastic gradient descent (SGD) and ADAM by weighting their parameter updates with learnable hyperparameters λₐ and λₛ. Experiments across image and text classification tasks show MAS consistently outperforms both individual optimizers in generalization, achieving state-of-the-art accuracy on CIFAR-10, CIFAR-100, CoLA, and AG’s News datasets with diverse CNN and BERT-based models.
Optimization methods (optimizers) get special attention for the efficient training of neural networks in the field of deep learning. In literature there are many papers that compare neural models trained with the use of different optimizers. Each paper demonstrates that for a particular problem an optimizer is better than the others but as the problem changes this type of result is no longer valid and we have to start from scratch. In our paper we propose to use the combination of two very different optimizers but when used simultaneously they can overcome the performances of the single optimizers in very different problems. We propose a new optimizer called MAS (Mixing ADAM and SGD) that integrates SGD and ADAM simultaneously by weighing the contributions of both through the assignment of constant weights. Rather than trying to improve SGD or ADAM we exploit both at the same time by taking the best of both. We have conducted several experiments on images and text document classification, using various CNNs, and we demonstrated by experiments that the proposed MAS optimizer produces better performance than the single SGD or ADAM optimizers. The source code and all the results of the experiments are available online at the following link https://gitlab.com/nicolalandro/multi\_optimizer
Motivation & Objective
- To address the limitation of existing optimizers like ADAM and SGD, which generalize poorly in different problems despite strong performance on specific tasks.
- To overcome the instability and poor generalization of adaptive optimizers like ADAM by integrating them with the robustness of SGD.
- To develop a unified optimization framework that leverages the strengths of multiple optimizers simultaneously, rather than switching between them.
- To demonstrate that combining optimizers via weighted averaging can yield better generalization than using any single optimizer in diverse deep learning tasks.
- To provide open-source code and experimental setups to enable reproducibility and further research in hybrid optimization methods.
Proposed method
- MAS integrates SGD and ADAM updates in parallel by computing their respective parameter updates and combining them using fixed, learnable weights λₛ and λₐ.
- The final parameter update is computed as a weighted average: θₜ₊₁ = θₜ - λₛ * Δθₛₜ - λₐ * Δθₐₜ, where λₛ + λₐ = 1.
- The method applies both optimizers from the start of training, avoiding the need for dynamic switching strategies like in SWATS.
- The hyperparameters λₛ and λₐ are tuned via grid search to balance the contributions of SGD and ADAM.
- The approach is applied to ResNet and BERT models on image and text classification benchmarks with fixed learning rates and batch sizes.
- The method is evaluated on CIFAR-10, CIFAR-100, CoLA, and AG’s News, comparing MAS against SGD, ADAM, and AdamW.
Experimental results
Research questions
- RQ1Can combining ADAM and SGD through a fixed-weighted average improve generalization across diverse deep learning tasks compared to using either optimizer alone?
- RQ2Does the MAS optimizer consistently outperform SGD and ADAM in terms of test accuracy on both computer vision and natural language processing benchmarks?
- RQ3What is the optimal balance between ADAM and SGD contributions (i.e., λₐ and λₛ) for achieving superior generalization in different datasets and models?
- RQ4Can a static combination of optimizers at training start provide better performance than dynamic switching strategies like SWATS?
- RQ5Does the MAS method generalize well across different architectures and datasets without requiring task-specific hyperparameter tuning?
Key findings
- On CIFAR-10 with ResNet18, MAS with λₐ=0.3 and λₛ=0.7 achieved 93.8% test accuracy, surpassing ADAM (93.2%) and SGD (92.6%).
- On CIFAR-100 with ResNet18, all MAS configurations outperformed both ADAM and SGD, with the best configuration reaching 78.9% accuracy compared to 77.1% for ADAM.
- On CoLA with BERT, MAS with λₐ=0.3 and λₛ=0.7 achieved a maximum accuracy of 86.91%, exceeding AdamW (85.96%) and ADAM (83.30%).
- On AG’s News with BERT, MAS with λₐ=0.3 and λₛ=0.7 reached 93.99% maximum accuracy, outperforming AdamW (92.93%) and ADAM (92.67%).
- The best-performing MAS configuration (λₐ=0.4, λₛ=0.6) achieved the highest average accuracy on all datasets, indicating robustness across tasks.
- Even suboptimal λ settings for MAS consistently yielded better results than ADAM or SGD alone, demonstrating the method’s stability and generalization advantage.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.