Skip to text

1 Introduction

This short note provides a new explicit example of failure of the ADAM algorithm [3], one of the most popular training methods in machine learning. Given the problem

(13.1)minx∈Rnf(x)

where f is continuously differentiable function from Rn into R with the Lipschitz continuous gradient, and a starting iterate x0, the ADAM sequence of iterates is defined (see [4]), for i∈{1,…,n} and k≥0, by the recurrences

(13.2)[mk]i=β1[mk−1]i+(1−β1)[gk]i,
(13.3)[vk]i=β2[vk−1]i+(1−β2)[gk]i2,
(13.4)[xk+1]i=[xk]i−α[mk]i[vk]i,

where [v]i is the ith component of the vector v∈Rn, mk is the kth “momentum,” xk is the kth iterate, gk=∇x1f(xk), β1∈[0,1) is the momentum parameter and β2∈[0,1) is the “forgetting” parameter, and α>0 is a (fixed) steplength/learning-rate parameter. The recurrences (13.2) and (13.3) are initialized by setting, for i∈{1,…,n}, [m−1]i=[g0]i and [v−1]i=[g0]i2, respectively. ADAM is intended to find first-order points for problem (13.1), in the sense that, for each i∈{1,…,n}, |[gk]i| should converge to zero when k tends to infinity. In practice, this algorithm is most often used in a stochastic context where the gradient gk is contaminated by noise (typically resulting from sampling) and has generated a considerable interest in the machine learning community.

Despite its widespread use, difficulties with this algorithm are not new. In the noiseless (deterministic/full batch) case, obstacles for proving convergence were in particular mentioned in [2], essentially pointing out the possibility that second-order terms in the Taylor’s expansion of the objective function could not vanish quickly enough. In [4, Theorem 1], an example of nonconvergence on a convex function was produced in the online-learning stochastic context, but this example crucially depends on the nonzero variance of the noise. In a recent discussion at the June 2023 Thematic Einstein Semester on Optimization and Machine Learning in Berlin, it was suggested that, although likely, no explicit example of failure of Adam with fixed stepsize was available for the deterministic case (where the variance is zero). This prompted the author to produce the (very simple) one which is, for the record, detailed in the next section. We note that an again convex but deterministic example had already been provided in the comprehensive analysis of ADAM’s behaviour (with decreasing stepsize) detailed in [5] (see Propositions 3.3 and E1). This analysis describes conditions, which delineate a region strictly included in [0,1)2 such that ADAM with parameters β1 and β2 chosen in this region generates a diverging sequence on this example. In contrast, the simple example we are about to discuss is nonconvex and applies to the entire [0,1)2, but requires constant stepsize. It can therefore be seen as complementing the analysis of [5].