Anyone well-versed in deep learning knows that step-size scheduling—or learning rate scheduling (LR schedule)—is crucial to a model's final performance. In previous posts, we already showed that even considering SGD alone, the optimal learning rate function for final convergence takes the form of warmup-decay, which is commonly used in practice. Recently, however, several works, such as Schedule-Free, have attempted to replace learning rate schedules with certain kinds of model weight averaging, and they have achieved some progress.
How can we theoretically analyze the connection between learning rate scheduling and weight averaging? To what extent can they substitute for each other? In this post, we will try to answer these questions.
Weight Averaging #
Regarding weight averaging, in fact, back in Making Model Training More Scientific, Part 3: Convergence of the Final Loss in SGD, we already gave a basic result
where
where
Nevertheless, if we change
How to theoretically explain this moving average trick, or more generally, explain the feasibility of arbitrary weight averaging, is the core task ahead.
A Further Generalization #
In the article Making Model Training More Scientific, Part 4: A New Identity, a New Learning Rate, in order to extend the results on the average loss to the final loss, we introduced the identity
where
Intuitively, this provides a way to transform one weighted sum into another. When
The third equality holds because directly adding the two parenthesized terms from the second equality yields 0, meaning the two terms are additive inverses of each other. Now, summing both sides over
Bounding Transformations #
Next, following the ideas from the previous post, Making Model Training More Scientific, Part 6: An Ingenious Top-Down Construction, we derive more general convergence results. Let
To facilitate subsequent derivations, we add the assumption:
Then we can use the convexity of
where
and direct verification shows that
Therefore, if we let
General Conclusion #
The next steps are relatively straightforward. Applying to the right-hand side of Eq.
where
Putting them together gives
The minimum of the right-hand side is attained at
, which implies that the optimal learning rate has the form
Interpretation of the Results #
The final convergence result given in the previous post, Making Model Training More Scientific, Part 6: An Ingenious Top-Down Construction, is
The right-hand side is consistent with Eq.
Let us consider some concrete examples. First is the simplest case,
Reviewing the entire derivation, we can guess that the problem likely lies in the "convex function" assumption. This series of articles actually relies on the assumption that "the objective function is convex," but the real-world situation is often non-convex, and the conclusions of convex optimization cannot be reproduced exactly. A compromise is to assume local approximate convexity, in which case we can perform equal-weight averaging over a finite window, or directly consider its smoothed version—exponential moving average (EMA), where
It maintains an averaging window of
Related Work #
To address the issue of suboptimal performance of Eq.
Intuitively, the original averaging operation was completely independent of the training process, and the model never sensed whether
However, as training scales increased, Schedule-Free gradually showed signs of fatigue. The authors recently proposed ScheduleFree+, applying quite a few "patches" to the original Schedule-Free to make it SOTA once again. However, the Plus version adds relatively many additional operations, making the overall algorithm somewhat complex and considerably more difficult to understand, so we will not expand on it in detail here; we will return to discuss it later.
It is worth mentioning that the authors of Schedule-Free and its Plus version are precisely the authors of the classic paper introduced in our previous articles, 《Optimal Linear Decay Learning Rate Schedules and Further Refinements》. These works have all successfully applied classical convex optimization theory to practical training, rather than remaining mere "armchair strategizing" on toy models—they truly deserve our respect!
Further Thoughts #
What is truly worth pondering is: can the premise of Schedule-Free really hold? The so-called Schedule-Free has two goals: first, to train with a constant learning rate from start to finish, and second, to make the various hyperparameters independent of the total training steps
However, both of these goals are open to debate. First, for practical training, there is no fundamental difference between a constant learning rate and dynamic schedules like cosine decay or linear decay; in both cases, one simply tunes hyperparameters and compares runs to choose the best one, so pursuing a constant learning rate has little practical significance. Moreover, even Schedule-Free and its Plus version have not freed themselves from reliance on warmup, meaning that in practice they still depend to some extent on a manually crafted LR schedule.
Second, hoping that various hyperparameters do not depend on the total number of training steps
We can also observe this from Equation
To this end, ScheduleFree+ and several concurrent works have gradually shifted from thinking about "Schedule-Free" toward "LR-Free." Overall, however, this area is still in an "emerging" stage and awaits more fundamental exploration.
Summary #
In this post, we introduced a new identity to further generalize the results of the previous post, allowing us to quantitatively reveal the connection between weight averaging and learning rate decay from a theoretical perspective. In addition, we discussed issues such as why equal-weight averaging is not as effective as moving average, and why Schedule-Free still cannot completely get rid of schedules.