In the previous article, Making Model Training More Scientific, Part 7: Step-Size Scheduling and Weight Averaging, we briefly introduced work on schedule-free learning rates, which attempts to replace learning rate scheduling with a form of weight averaging, achieving the effect of training an optimal model with a constant learning rate. However, as also mentioned in that post, without introducing additional assumptions, this optimal constant learning rate still depends on the number of training steps, so it cannot achieve truly schedule-free training.
In this article, we rethink this problem from the perspective of multi-stage training. The central idea is to compromise on the scheduling objective to 'being close to optimal at the end of each stage,' making it simpler and more feasible in practice.
A Classical Result #
We start from a classical convergence result to understand why the optimal learning rate depends on the number of training steps. We first introduced this convergence result in Making Model Training More Scientific, Part 2: Extending the Results to Unbounded Domains:
We will not repeat the specific meanings of the notation. This convergence result is representative, as the subsequent Making Model Training More Scientific, Part 6: An Ingenious Top-Down Construction and the previous Making Model Training More Scientific, Part 7: Step-Size Scheduling and Weight Averaging both build upon it.
What we want to do now is, given
The condition for equality to hold simultaneously in both parts is
A Shift in Perspective #
Now let us return to reflect on the motivation behind schedule-free methods. Ideally, schedule-free training seeks to train continuously in a way that does not require knowing the total number of training steps
However, this ideal goal seems nearly impossible. Even under the convex optimization assumptions of schedule-free methods, where we can equate LR decay with weight averaging to achieve training with a constant learning rate, as analyzed in the previous section, the optimal value of this constant learning rate also depends on
That being the case, we might as well reconsider what we really want from schedule-free training. First, a constant learning rate is not a strict necessity; if a time-varying learning rate yields good results, we can certainly accept it. Second, 'stopping at any time yields optimality' is undeniably an attractive property, but it is not a hard requirement either; our primary hope is that during multi-stage training, the end of each stage comes as close to optimal as possible.
In other words, when our training is divided into multiple stages, we want to obtain a model that is as close to optimal as possible at the end of each stage. The number of stages will not be very large, so for simplicity, let us first consider two-stage training, where the first stage trains for
Here, we can further distinguish between two cases: 'unplanned' and 'planned.' The 'unplanned' case refers to situations where there was originally no plan to continue training, so the first stage is tuned to be as optimal as possible; once the decision to continue training is made, the second stage seeks to optimize as much as possible on top of the existing foundation, which yields a greedy solution—the downside being that no matter how the second stage is tuned, the result is relatively suboptimal. As for the 'planned' case, multi-stage training is planned in advance, allowing us in theory to strike a better balance between the performance across both stages.
Greedy Decisions #
Let's first look at the greedy version. To achieve the optimum in the first stage, it is naturally the constant learning rate
Based on the same inequality
This can be done by constructing an inequality or by direct differentiation; the minimizing point is
where
Equivalent Steps #
Here we introduce the notation
Without the constraint of the first stage, we could use the constant learning rate
That is to say, two-stage greedy training is in effect equivalent to losing some steps. Taking
Why abstract this concept? Because the concept of "steps" is universal, which makes the conclusions easier to transfer. The above conclusions were derived based on SGD, but actual training typically uses non-SGD optimizers like Adam and Muon, and hyperparameter settings like the learning rate are not directly calculated using the formulas above, but are usually determined based on empirically found scaling laws.
Therefore, the various conclusions given by SGD cannot be directly used, but if we can extract the relative changes through the concept of "equivalent steps", then the step count input in practical scaling laws can similarly be replaced with equivalent steps to obtain a heuristic correction. This is the key idea for bringing SGD conclusions into practice.
The Planned Case #
Next, let us look at the "planned" case. Here,
It aims to make the ratio of each stage's actual performance to its ideal value as small as possible. The advantage of this optimization objective is that it introduces no extra hyperparameters, while being easy to extend to multi-stage training. Introducing a new variable
Nondimensionalizing the problem: let
That is, the feasible set of
Solution Process #
For the two-stage case, this problem can be solved analytically. Note that the first constraint only involves
Both spheres have radius
The two spheres intersect if and only if the distance between their centers does not exceed twice the radius, namely,
The corresponding solution can be taken as the midpoint of the line segment connecting the two centers, namely,
Analysis of Results #
Restoring
Interestingly,
That is to say, the first stage only needs to be trained for
Taking
Another limit is when
Extension to Multiple Stages #
Whether it is the greedy solution under the "unplanned" scenario or the minimax solution under the "planned" scenario, both can theoretically be easily extended to multi-stage training. The greedy solution goes without saying; here we mainly elaborate on the minimax solution. Suppose there are
The same non-dimensionalization yields
Although there are theoretically
Summary #
This post revisits 'schedule-free learning rates' from the perspective of multi-stage training. By changing the scheduling objective to 'being close to optimal at the end of each stage', we make it simpler and more feasible in practice. Furthermore, we distill the concept of 'equivalent steps', potentially allowing the conclusions to transfer to practical optimizers and scaling laws.