Table of Contents
Fetching ...

HomeAdam: Adam and AdamW Algorithms Sometimes Go Home to Obtain Better Provable Generalization

Feihu Huang, Guanyi Zhang, Songcan Chen

TL;DR

This paper restudy generalization of Adam and AdamW via algorithmic stability, and proves that Adam and AdamW without square-root have a generalization error and proposes a class of efficient clever Adam algorithms via sometimes returning momentum-based SGD, which have a smaller generalization error than the existing HomeAdam(W).

Abstract

Adam and AdamW are a class of default optimizers for training deep learning models in machine learning. These adaptive algorithms converge faster but generalize worse compared to SGD. In fact, their proved generalization error $O(\frac{1}{\sqrt{N}})$ also is larger than $O(\frac{1}{N})$ of SGD, where $N$ denotes training sample size. Recently, although some variants of Adam have been proposed to improve its generalization, their improved generalizations are still unexplored in theory. To fill this gap, in the paper, we restudy generalization of Adam and AdamW via algorithmic stability, and first prove that Adam and AdamW without square-root (i.e., Adam(W)-srf) have a generalization error $O(\frac{\hatρ^{-2T}}{N})$, where $T$ denotes iteration number and $\hatρ>0$ denotes the smallest element of second-order momentum plus a small positive number. To improve generalization, we propose a class of efficient clever Adam (i.e., HomeAdam(W)) algorithms via sometimes returning momentum-based SGD. Moreover, we prove that our HomeAdam(W) have a smaller generalization error $O(\frac{1}{N})$ than $O(\frac{\hatρ^{-2T}}{N})$ of Adam(W)-srf, since $\hatρ$ is generally very small. In particular, it is also smaller than the existing $O(\frac{1}{\sqrt{N}})$ of Adam(W). Meanwhile, we prove our HomeAdam(W) have a faster convergence rate of $O(\frac{1}{T^{1/4}})$ than $O(\frac{\breveρ^{-1}}{T^{1/4}})$ of the Adam(W)-srf, where $\breveρ\leq\hatρ$ also is very small. Extensive numerical experiments demonstrate efficiency of our HomeAdam(W) algorithms.

HomeAdam: Adam and AdamW Algorithms Sometimes Go Home to Obtain Better Provable Generalization

TL;DR

This paper restudy generalization of Adam and AdamW via algorithmic stability, and proves that Adam and AdamW without square-root have a generalization error and proposes a class of efficient clever Adam algorithms via sometimes returning momentum-based SGD, which have a smaller generalization error than the existing HomeAdam(W).

Abstract

Adam and AdamW are a class of default optimizers for training deep learning models in machine learning. These adaptive algorithms converge faster but generalize worse compared to SGD. In fact, their proved generalization error also is larger than of SGD, where denotes training sample size. Recently, although some variants of Adam have been proposed to improve its generalization, their improved generalizations are still unexplored in theory. To fill this gap, in the paper, we restudy generalization of Adam and AdamW via algorithmic stability, and first prove that Adam and AdamW without square-root (i.e., Adam(W)-srf) have a generalization error , where denotes iteration number and denotes the smallest element of second-order momentum plus a small positive number. To improve generalization, we propose a class of efficient clever Adam (i.e., HomeAdam(W)) algorithms via sometimes returning momentum-based SGD. Moreover, we prove that our HomeAdam(W) have a smaller generalization error than of Adam(W)-srf, since is generally very small. In particular, it is also smaller than the existing of Adam(W). Meanwhile, we prove our HomeAdam(W) have a faster convergence rate of than of the Adam(W)-srf, where also is very small. Extensive numerical experiments demonstrate efficiency of our HomeAdam(W) algorithms.
Paper Structure (26 sections, 18 theorems, 174 equations, 5 figures, 1 table, 3 algorithms)

This paper contains 26 sections, 18 theorems, 174 equations, 5 figures, 1 table, 3 algorithms.

Key Result

Lemma 2.2

(Generalization via Stability) shalev2010learnabilityhardt2016train. Let algorithm $A$ be $\epsilon$-uniformly stable in function values, then we have

Figures (5)

  • Figure 1: Illustration of different stepsize function $R(\hat{v}_t)$: (a) Adam(W)-srf uses $R(\hat{v}_t)=\frac{1}{\hat{v}_t}$ and Adam(W) uses $R(\hat{v}_t)=\frac{1}{\sqrt{\hat{v}_t}}$; (b) SGD(M) uses $R(\hat{v}_t)=1$; (c) our HomeAdam(W) uses $R(\hat{v}_t)=\frac{1}{\hat{v}_t}$ when $\min_{1\leq j\leq d} (\hat{v}_t)_j \geq \tau>0$, otherwise $R(\hat{v}_t)=1$.
  • Figure 2: Results of image classification at Cifar-10 dataset.
  • Figure 3: Results of image classification at tiny-ImageNet dataset.
  • Figure 4: Results of language modeling task at Wikitext-2 dataset.
  • Figure 5: Results of language modeling task at Wikitext-103 dataset.

Theorems & Definitions (35)

  • Definition 2.1
  • Lemma 2.2
  • Lemma 4.4
  • Theorem 4.5
  • Remark 4.6
  • Theorem 4.7
  • Remark 4.8
  • Lemma 5.3
  • Theorem 5.4
  • Remark 5.5
  • ...and 25 more