In the previous article, Making Model Training More Scientific, Part 9: Classical Adaptive Gradient Algorithms, we established a convergence framework for general update rules of the form , and using it as a starting point, reinterpreted classical adaptive gradient algorithms such as AdaGrad. However, the complete conclusion back then relied on two premises: first, that the learning rate is constant; second, the preconditioning matrix , with respect to , is monotonically non-decreasing (in the positive semidefinite sense).
The former restricts the freedom of learning rate schedules, while the latter excludes moving-average algorithms like RMSProp and Adam from the theory. This article attempts to dismantle these two pieces of "scaffolding" one by one and extend the convergence theory to more general settings.
First, let us review the core conclusion of the previous article. For the general update rule
where is the stochastic gradient computed at sample , and is a (possibly data-dependent) positive-definite preconditioning matrix; the convergence conclusion obtained previously is
Here, is the minimizer of the loss function, and is the maximum distance from the optimization trajectory to the optimum; a more practical interpretation is: assuming that the optimization process always takes place within a hypersphere of diameter at most , which can be guaranteed via projection operations if necessary.
Equation also has a key premise for it to hold: for any , is positive semidefinite, denoted for short as , meaning that is monotonically non-decreasing in the positive semidefinite order. Under this premise, the previous article further assumed that is a constant , yielding upon rearrangement:
Then, by minimizing the right-hand side with respect to , we gain an understanding of the optimal preconditioning matrix—AdaGrad is precisely the product of this optimization. However, if the sum is replaced by a moving average, we can derive optimizers such as RMSProp and Adam, but this cannot guarantee that , so the convergence theory above no longer holds automatically.
Then, two questions naturally follow: 1. If is not constant, what should the conclusion become? 2. If the monotonicity does not hold universally, what should we do?
Let us first consider a general dynamic learning rate . Fortunately, dynamic learning rates introduce no difficulties in the proof, and we can reuse almost all the techniques from the previous posts. First, following the idea in Making Model Training More Scientific, Part 2: Extending the Results to Unbounded Domains, we take expectations of both sides of Eq. , with
Here are a few remarks: 1. We assume that is independent of the data ; 2. Other than that, almost all variables are data-dependent; for example, depends on , and may also depend on the data (such as in AdaGrad); 3. is shorthand for , so it is naturally no exception; 4. If is defined via , then it is data-dependent, but if understood via a bounded ball, then it is independent; we usually prefer the latter.
Now, dividing both sides by , we obtain
This yields the weighted-average version of the convergence result for dynamic learning rates. On the other hand, inequality has a more fundamental prototype:
That is, in fact, we first obtain the above equation, and then assume the convexity of and take to obtain Equation . Repeating the proof of this section based on , we have
This is an inequality that will be used in the next section. Note that here can actually be replaced by any vector, because the only role of taking to be the gradient at the current point is to connect it to the loss function via convexity; however, we do not involve the loss here, so as far as this inequality alone is concerned, is also arbitrary.
In practice, final-point convergence is often more informative than average convergence. To obtain the final-point convergence result, we directly invoke an inequality proved in Making Model Training More Scientific, Part 6: An Ingenious Top-Down Construction:
where . Assuming readers have been following this series post by post, we will not reintroduce most of the notation. The only condition for inequality is the convexity of ; that is, as long as we assume the convexity of and the aforementioned relation between and , then inequality holds, regardless of the specific optimizer.
Inequality serves an intuitive purpose: it converts final convergence into average convergence, thereby connecting directly to the conclusions of the previous section. Now, let , and set . Then, from the relationship between the two, we can deduce:
For Inequality , applying Equation to its right-hand side, we obtain
Strictly speaking, the here should be an upper bound on the distance from the trajectory to ; under the "bounded ball" interpretation, as long as both trajectories remain within the same ball (guaranteed via projection if necessary), they can be represented by the same . Thus, as long as in , can be expressed as , then the above convergence result holds for it, which extends our previous final convergence result for scalar learning rates to matrix learning rates.
From this, we can immediately obtain a practically consistent corollary: according to the experience in Making Model Training More Scientific, Part 5: Fine-Tuning Learning Rates Based on Gradients, if we assume that is close to a constant (or bounded above by some constant to further relax the right-hand side), then the minimum of the right-hand side of the above equation is attained when is a constant, while being constant corresponds to decaying linearly, which confirms the generality of the linear decay LR schedule for general adaptive learning rate optimizers.
In addition to the above implicit result, following the reasoning in the section "Explicit Version", we can also obtain an explicit result:
Now let us turn to the second question: when the monotonicity does not always hold, how should we "remedy" it? A naive idea is to make minimal modifications to the original optimizer so that it satisfies the desired monotonicity. Specifically, suppose we have a positive semidefinite matrix sequence , and we hope to find a new sequence closest to it, , which always satisfies . The new sequence is constructed as
where denotes taking the real symmetric matrix and replacing all of its eigenvalues with to obtain a new matrix. This construction is very intuitive; it is easy to see that necessarily holds, and at the same time, we can prove its optimality under the trace metric.
Proposition: For the two simultaneous requirements and , among all positive semi-definite matrices satisfying them, the stated has the minimal trace.
Proof: Let the eigenvalue decomposition of be , and let . Then the two conditions yield and , which in turn respectively imply and , or equivalently . Thus,
Setting precisely attains equality. This completes the proof.
Corollary: If it already holds identically that , then .
With , we use to replace the original , which changes the update rule to
This guarantees monotonicity and allows us to reuse the earlier convergence results, simply by replacing with , while minimizing modifications to the original optimizer. In particular, when is a diagonal matrix, the update rule for can be simplified to the more intuitive
Here, refers to taking the elementwise maximum. If we use this to replace the second moment in Adam, we obtain the classic AMSGrad optimizer. Its convergence properties are better, at the cost of an additional set of state variables. At the same time, just like with AdaGrad, optimizers that guarantee the monotonicity of often raise concerns of being overly conservative in practice, so AMSGrad did not really become popular either.
If we insist on not modifying the optimizer, then our only option is to work from the conclusions. In this section, we return to the source and re-examine the proof from the previous article to see where exactly the monotonicity of is actually used. The answer is that we used the positive semi-definiteness of to establish the bound , and then
and subsequently,
However, the bound is actually quite loose, and it relies on being positive semi-definite. The reason we used it is that is a linear function, which allows the terms in the final summation to cancel out, leaving a clean , which facilitates analysis. In fact, a tighter bound that does not require assuming is
where , which is equivalent to saying that , where denotes the largest eigenvalue. Using this result, we obtain
Note that is not a linear function, so we cannot cancel terms any further. However, although this result is not as clean as , it is actually always no worse than (and usually strictly better than) when monotonicity holds, so this is actually a stronger and more general result.
Looking back at the entire derivation, the only place where the monotonicity was used is the bound in the previous section. Therefore, after replacing it with the version, all the previous convergence conclusions can be generalized to the general case without any modifications, simply by uniformly replacing with , where
Specifically, the general version of Equation is:
The weighted-average convergence conclusion is
The two final-iterate convergence conclusions are, respectively,
Notice that has two basic properties: first, it is obvious that is always non-negative, so the new upper bound has no risk of degradation; second, when the monotonicity of holds, we have , and thus , meaning that the new conclusions indeed encompass the old ones.
At this point, the second piece of scaffolding has also been removed. Looking at it this way, the non-monotonicity of does not fundamentally impede the convergence proof. Does this mean that optimizers like RMSProp and Adam have no convergence issues?
Not at all. Being able to write down a convergence result does not mean convergence is guaranteed. Taking Eq. as an example, if we treat both as constants independent of and , then the minimum of the right-hand side is attained when is constant, at which point grows with linearly, and if also grows with linearly or even superlinearly, then the right-hand side cannot tend to zero as , which means convergence cannot be guaranteed.
As can be seen from this line of reasoning, it actually has no direct relationship with whether is monotonic or not; as long as the growth rate of with respect to is linear or faster, non-convergence may occur. For AdaGrad, under the assumption of bounded gradients, it can be proven that , meaning that grows at a rate of at most , which is sublinear, so convergence is guaranteed.
However, for the moving-average preconditioners of optimizers like RMSProp and Adam, although itself is smoother, the eigenvalues of may alternate signs repeatedly, while accumulates the of each step's change. In extreme cases, if there is a persistent, steady positive direction among the changes, it will grow at a uniform rate, resulting in a linear , leading to convergence failure.
However, thinking about it the other way around, this also argues to some extent for why RMSProp, Adam, and the like are effective in practice: generally, the growth rate of is not that bad, and instead, likely due to the smoothness of , their grows even more mildly than that of AdaGrad, thereby yielding better empirical results. In addition, the most important point is that we are currently only discussing the convergence of an upper bound on the loss; non-convergence of an upper bound cannot, in principle, assert that the loss itself fails to converge.
Building upon the convergence framework of the previous post, this article dismantles two 'scaffolds': first, allowing the learning rate to vary dynamically, deriving the corresponding average convergence and final convergence results, which provides a preliminary explanation for the general applicability of LR decay across optimizers; second, for non-monotonic , discussing a modification scheme under the idea of minimal changes, and deriving a more general convergence result without requiring the monotonicity assumption.
Overall, this article has a relatively high information density, and we skipped quite a few proof details because the key proof techniques were already presented in detail in the earlier series of posts on SGD; hence, this article focuses more on directly providing the key steps and results.