---
title: "Improving Generalization Performance by Switching from Adam"
description: "How SWATS switches from Adam to SGD, estimates the new learning rate, and tests whether fast early training can retain good generalization."
canonical: "https://research.elamur.ai/free/en/papers/keskar-2017-improving-generalization-performance-switching-adam/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/keskar-2017-improving-generalization-performance-switching-adam/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Improving Generalization Performance by Switching from Adam to SGD

# Improving Generalization Performance by Switching from Adam to SGD

Paper · 2017 · Nitish Shirish Keskar and Richard Socher

**Authors:** [Nitish Shirish Keskar](https://md.research.elamur.ai/free/en/authors/nitish-shirish-keskar/) and [Richard Socher](https://md.research.elamur.ai/free/en/authors/richard-socher/) · **Year:** 2017 · **Venue:** arXiv (Cornell University) · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**373** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2776855315) · [arXiv (Cornell University)](https://openalex.org/S4306400194) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1712.07628)
- [arXiv 1712.07628](https://arxiv.org/abs/1712.07628)
- [OpenAlex](https://openalex.org/W2776855315)

Citations: OpenAlex, 2026-10-14.

## Deep dive: Improving Generalization Performance by Switching from Adam to SGD

How SWATS switches from Adam to SGD, estimates the new learning rate, and tests whether fast early training can retain good generalization. · about 32 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

An optimizer can make fast progress on training data without producing the best predictions on unseen examples. This paper studies that tension through Adam and stochastic gradient descent, or SGD. Adam adjusts the scale of an update separately for each parameter, which can help training move quickly at the beginning. SGD uses a common learning rate across parameters and, in several experiments discussed by the authors, eventually achieves better generalization. The practical question is whether training can benefit from Adam early and from SGD later, without requiring a researcher to tune a separate switching schedule.

The authors propose SWATS, a procedure that starts with Adam and automatically changes to SGD. It estimates a suitable SGD learning rate from the relationship between the current gradient and the update Adam would make. It then tracks a smoothed version of that estimate. When the current estimate comes sufficiently close to its bias-corrected running average, the procedure switches optimizers. When Adam uses momentum, the destination is SGD with momentum. The averaging and momentum settings reuse Adam’s existing parameters, so the procedure does not introduce additional hyper-parameters.

The experiments cover image classification and word-level language prediction. On the image tasks, Adam usually improves quickly but finishes with poorer generalization than SGD. SWATS closes much of that gap across the tested architectures and datasets. The language experiments provide a useful counterpoint: there, Adam outperforms the tested SGD procedure, while SWATS reaches validation perplexity comparable to Adam. The result is therefore broader than a demonstration that switching always improves on Adam. Across the reported tasks, the hybrid generally approaches whichever of Adam and SGD performs better.

The paper also shows why switching needs care. A manually delayed transition can preserve Adam’s generalization problem, while a very early transition gives up much of its initial advantage. An automatic transition can temporarily damage performance: on Tiny-ImageNet, reported testing accuracy drops from 80% to 52% immediately after the change before recovering. SWATS is thus an empirical argument for adapting the optimizer during training, supported by a lightweight switching rule. It does not establish a general theorem explaining when a hybrid must outperform its components, and the authors explicitly leave the deeper connection between optimization trajectories and generalization open.

### Ideas worth borrowing

Read the update as a measurement. SWATS treats Adam’s proposed parameter change as evidence about the scale of a possible SGD update. The useful information is already available during training: the gradient and the adaptive step. This suggests a broader engineering pattern in which an algorithm’s internal calculations help configure its successor. Where a workflow changes methods midway, measurements from the current method may provide a more informed handoff than an independently chosen default.

Separate the transition questions. Choosing when to switch and choosing how the next optimizer should step are distinct problems. A good transition time can still produce poor training if the replacement learning rate is unsuitable. SWATS addresses both together while giving each its own role: geometric agreement supplies a rate estimate, and agreement with a running average supplies the trigger. This separation is useful whenever an automated training procedure changes its behavior during a run.

Compare current evidence with accumulated evidence. A single learning-rate estimate fluctuates because it depends on a stochastic gradient. The authors smooth that estimate and compare the latest observation with the accumulated history. The broader idea is to detect a change in training behavior through a monitored quantity rather than a predetermined epoch. It applies most naturally when a meaningful internal signal exists, although the success of this particular signal remains an empirical finding.

Reuse existing controls deliberately. The smoothing coefficient comes from Adam’s second-moment averaging parameter, and the destination momentum comes from Adam’s first-moment parameter. This limits the extra search burden and makes the comparison with Adam easier to interpret. Reuse is valuable when the inherited settings have compatible meanings. It should still be accompanied by evaluation, because avoiding a new parameter does not prove that the inherited value suits every task.

Test the proposed mechanism by constraining it. Before introducing the switch, the authors restrict Adam’s coordinatewise learning rates from above or below. The asymmetric outcomes help identify which behavior might matter: preventing very small coordinatewise rates helps more than preventing large ones in the illustrated experiment. This is a reusable experimental strategy. Alter a suspected mechanism directly, observe what changes, and use that result to motivate a more practical intervention.

Include a setting where the preferred baseline wins. The language experiments are valuable because Adam performs better than the tested SGD baseline. They challenge the hybrid with a case where replacing Adam could be harmful. SWATS retaining performance comparable to Adam gives a more informative picture than image experiments alone. An evaluation of a hybrid should include situations favoring each component, rather than only situations that make the proposed transition look attractive.

Treat the handoff as an event worth recording. The Tiny-ImageNet result makes clear that a useful final outcome can conceal a disruptive transition. Recording the switch point, the chosen learning rate, and the behavior immediately afterward helps distinguish a successful recovery from an uneventful handoff. This practice is useful for any training procedure that changes optimizers, update rules, or other important dynamics partway through a run.

### How Mova uses it

For [Mova](https://md.research.elamur.ai/free/en/projects/mova/), the small transparent language system written in Rust, the most relevant contribution is a possible training experiment. The available evidence does not establish that Mova already implements SWATS, uses Adam, or has a trainable component suited to this procedure. Any connection should therefore be stated as a proposal: if Mova trains differentiable parameters, it could compare an adaptive beginning followed by SGD against keeping either optimizer throughout training.

The paper’s language experiments make that proposal more specific. They study predicting the next word from a preceding sequence, using recurrent architectures and held-out perplexity. A Mova experiment would need its own clearly defined prediction task and held-out criterion. The useful lesson is to judge an optimizer by behavior on unseen text as well as by training progress. A rapid fall in training loss would not, by itself, justify choosing Adam, SGD, or their hybrid.

Transparency offers a concrete way to make such an experiment inspectable. A Rust implementation could record the scalar learning-rate estimate derived from each eligible Adam update, its running average, the point at which the trigger succeeds, and the rate passed to SGD. These records would explain the transition in terms of quantities the procedure actually uses. They would also expose whether the switch happens early, late, or alongside a temporary deterioration in held-out performance.

That would be a useful form of explanation with a clear boundary. The log could show why the switching condition fired. It could not establish that the resulting parameters represent language more faithfully, or that the system has reached a particular kind of solution. SWATS supplies a rule about training dynamics. It does not turn those dynamics into a direct account of linguistic knowledge or reasoning.

The paper also argues against assuming that SGD must be the better endpoint for a language system. In its word-prediction experiments, Adam is stronger than the tested SGD procedure. Mova could borrow the comparative discipline rather than inherit a preferred winner: keep the task and evaluation fixed, tune the competing procedures appropriately, and examine the transition as well as the final result. The language evidence supports testing a hybrid, not adopting one without measurement.

An honest implementation claim would therefore require an actual training path, recorded settings, and comparative results. Until those exist, SWATS is a plausible design option for Mova’s experimental training machinery. Its strongest fit with a transparent system is the small, inspectable decision rule: a transition justified by recorded update geometry rather than an unexplained change at an arbitrary point.

### The problem and its context

#### Training progress and generalization answer different questions

Training a neural network involves choosing parameters that reduce a loss function. The loss measures how poorly the current network performs on the examples used for optimization. Generalization asks a different question: how well does the trained network behave on examples outside that training set? The paper begins from the observation that an optimizer can be strong on the first question and weaker on the second.

This distinction matters because optimization procedures do more than determine how quickly a loss decreases. They also determine the path taken through parameter space. Different update rules can arrive at different solutions, even when each makes substantial training progress. The authors connect their study to earlier work arguing that these differences can affect generalization.

SGD is the reference method in this comparison. It estimates a gradient from sampled training data and moves the parameters against that gradient. A learning rate controls the size of the move. The same scalar rate applies across coordinates, so the update preserves the gradient’s relative coordinate scaling. Momentum adds a running contribution from earlier gradients, helping the update carry information across iterations.

The paper describes several reasons for SGD’s established role. Earlier research had supplied analyses of stability, saddle-point avoidance, and connections with Bayesian inference. The authors also point to strong empirical results in vision and language tasks. These references motivate taking SGD seriously as a destination for a hybrid procedure. They do not amount to a guarantee that SGD is best for every task considered.

#### Why adaptive methods are attractive

Uniform scaling can be inconvenient when different parameter directions have very different numerical scales. A learning rate suitable for one direction may be unsuitable for another. The authors describe this as a difficulty with ill-scaled optimization problems and as a reason learning-rate tuning can become laborious.

Adaptive methods address that difficulty by adjusting the update scale separately for each parameter. Adagrad uses accumulated squared gradients. RMSProp uses an exponentially weighted average rather than an ever-growing accumulation. [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) combines an average of gradients with an average of squared gradients and corrects for the effect of initializing those averages at zero.

The appeal is practical. According to the paper, Adam often works well with little tuning and makes rapid early progress. Those properties can matter even if another optimizer eventually produces better held-out performance. A method that is difficult to configure or slow to begin improving may be less convenient to use, regardless of its best achievable endpoint.

The authors’ question grows out of this combination of strengths and weaknesses. They do not try to show that adaptive optimization is unnecessary. They ask whether its advantages are especially useful during an initial phase, after which a different update rule might be preferable.

#### Earlier evidence behind the generalization concern

A central influence is the work by Wilson and colleagues discussed throughout the paper. The authors describe that work as showing that adaptive methods can generalize substantially worse than SGD, including in a constructed quadratic problem. The proposed explanation concerns the unequal coordinate scaling built into adaptive updates.

The argument is not simply that Adam sometimes uses the wrong overall learning rate. An adaptive update can change the relative weighting of parameter directions. Two procedures may therefore move differently even if their update lengths seem similar. From this perspective, tuning a scalar multiplier may fail to remove the behavior responsible for the generalization gap.

The paper also observes an empirical pattern in demanding training tasks: Adam can lead early in both training and held-out performance, then stop improving while SGD continues. That pattern motivates a change of optimizer during a run. If the early and late phases reward different update behavior, selecting one optimizer for the entire run may be unnecessarily restrictive.

This remains a motivation rather than a complete explanation. The fact that adaptive scaling is implicated in earlier analyses does not establish that it causes every observed gap in a deep network. The authors use controlled comparisons and broad experiments to investigate the idea, while leaving a general account of deep-network generalization unresolved.

#### What earlier alternatives had already tried

The authors discuss ND-Adam, a direction-preserving variant that uses a nested optimization procedure. In their account, it introduces another hyper-parameter and loses some of Adam’s characteristic early speed. This gives SWATS a specific design target: retain an ordinary Adam beginning while avoiding a larger tuning problem.

They also discuss AMSGrad, linking its motivation to the non-monotonic behavior of Adam’s effective steps. [On the Convergence of Adam and Beyond](https://md.research.elamur.ai/free/en/papers/reddi-2019-convergence-adam/) is relevant here as the cited work associated with that alternative. The SWATS authors report finding generalization similar to Adam’s on problems where Adam trails SGD. They distinguish convergence guarantees from the held-out performance they want to improve.

Switching optimizers itself was already an established possibility in the paper’s account. Earlier machine-translation training used an adaptive phase followed by SGD, but tuned both the transition point and the later SGD rate. Another image-training strategy combined RMSProp and SGD updates, with tuned contributions and learning rates.

SWATS therefore contributes automation of an existing practical idea. It tries to infer both the transition time and the destination learning rate from the training process. The authors explicitly frame their aim as investigating hybrid training empirically, instead of presenting switching as an completely new concept.

### The method, step by step

SWATS can be understood as an ordinary Adam run with an additional scalar monitor. While Adam proposes updates, the monitor asks what common gradient multiplier would have a particular geometric relationship to the current Adam step. It smooths those estimates and tests for agreement. Once the condition succeeds, training continues with SGD or SGD with momentum.

From adaptive updates to a fixed SGD rate The steps in order.

#### Begin with the optimization problem

The paper represents training as minimizing a loss over a parameter vector:

```
minimize f(w), with w ∈ ℝⁿ
```

Here, (w) is written as a vector in the expression; in plain terms, it contains the trainable parameters. The symbol f denotes the loss, ℝ denotes the real numbers, and n is the number of parameter coordinates. The objective is non-convex in the neural-network setting studied by the authors, so the choice of update path matters beyond simply identifying a unique optimum.

A stochastic gradient estimates how the loss changes with the parameters using the training data sampled for the current update. The paper writes an SGD iteration as:

```
wₖ = wₖ₋₁ − αₖ₋₁ ∇̂f(wₖ₋₁)
```

The index k identifies an iteration. The vector wₖ₋₁ contains the parameters before the update, and wₖ contains them afterwards. The symbol ∇̂f denotes the stochastic gradient of f. The scalar αₖ₋₁ is the learning rate for that update. Subtracting the gradient gives a direction intended to reduce the loss.

Momentum introduces a state that accumulates gradient information:

```
vₖ = βvₖ₋₁ + ∇̂f(wₖ₋₁)
```

Here, vₖ is the momentum state, β controls retention of its previous value, and vₖ₋₁ is the earlier state. The paper initializes this state at zero and takes β in the interval [0,1). The parameter update then uses the accumulated state:

```
wₖ = wₖ₋₁ − αₖ₋₁vₖ
```

The symbols w, k, and α have the same meanings as before. The change is that the current update uses vₖ rather than only the latest gradient. The paper calls this momentum version SGDM.

#### Understand what Adam changes

To explain Adam’s coordinatewise scaling, the paper first introduces Adagrad. Its parameter update divides each gradient coordinate by a quantity derived from earlier squared gradients:

```
wₖ = wₖ₋₁ − αₖ₋₁ ∇̂f(wₖ₋₁) / (√vₖ₋₁ + ε)
```

The vector vₖ₋₁ is an accumulator, and ε is the small stabilizing term in the denominator. Squaring, square roots, and division act coordinate by coordinate. Though the paper also uses v for momentum, its role here is different: it stores squared-gradient information rather than a running update direction.

The Adagrad accumulator is:

```
vₖ₋₁ = ∑ⱼ₌₁ᵏ⁻¹ ∇̂f(wⱼ)²
```

The summation adds squared stochastic gradients from the indexed iterations j. Each coordinate therefore receives a scale determined by its own gradient history. Because this accumulated quantity only grows, the corresponding effective learning rate decreases, which the authors describe as a possible source of slow progress.

RMSProp replaces the cumulative sum with an exponential average:

```
vₖ₋₁ = βvₖ₋₂ + (1 − β)∇̂f(wₖ₋₁)²
```

Here, β controls how much of the preceding accumulator survives. The term multiplied by 1 − β supplies the latest squared-gradient information. This produces an average scale rather than a continually increasing total.

Adam additionally averages the gradients themselves:

```
mₖ₋₁ = β₁mₖ₋₂ + (1 − β₁)∇̂f(wₖ₋₁)
```

The vector m is the first-moment state, and β₁ controls its exponential averaging. It provides a smoothed direction based on gradients. Adam separately maintains the squared-gradient state:

```
vₖ₋₁ = β₂vₖ₋₂ + (1 − β₂)∇̂f(wₖ₋₁)²
```

The parameter β₂ controls the second-moment average. The different subscripts distinguish the two averaging coefficients. Both averages start from zero, so their early values are affected by initialization.

In the notation used by the paper, the Adam update is:

```
wₖ = wₖ₋₁ − αₖ₋₁ · [√(1 − β₂ᵏ)/(1 − β₁ᵏ)] · [mₖ₋₁/(√vₖ₋₁ + ε)]
```

The factors involving powers of β₁ and β₂ provide the bias correction. The vector m supplies the averaged direction, while the denominator involving v changes the scale separately across coordinates. The scalar α remains an overall learning-rate control. SWATS initially follows these Adam updates instead of modifying them into a new adaptive rule.

#### Diagnose the role of unequal learning rates

Before defining the switch, the authors investigate a constrained Adam variant. They take the coordinatewise learning-rate multiplier and clip it between bounds tied to a tuned SGD rate:

```
wₖ = wₖ₋₁ − clip([√(1 − β₂ᵏ)/(1 − β₁ᵏ)] · [αₖ₋₁/(√vₖ₋₁ + ε)], pα_sgd, qα_sgd)mₖ₋₁
```

The function clip restricts each coordinate of its first argument to the interval given by its next arguments. The symbol α_sgd is the tuned SGD learning rate for the same task. Here, p and q specify the lower and upper multipliers. These bound symbols are separate from the later vector pₖ, which denotes an Adam step.

The illustrated settings isolate different possibilities. Adam-Clip(0, 1) limits large effective rates, while Adam-Clip(1, ∞) prevents rates from falling below the SGD-based bound. The authors also identify the coincident-bound setting Adam-Clip(1,1) with SGD in their comparison.

This diagnostic is not the final training procedure. It requires a tuned SGD rate in advance and therefore does not solve the automatic handoff problem. Its purpose is to test whether constraining Adam’s learned scales can alter generalization. The stronger benefit from imposing a lower bound motivates concern about effective steps becoming too small.

#### Estimate the learning rate for the destination optimizer

At a current parameter vector wₖ, let gₖ denote the stochastic gradient and pₖ the parameter change Adam proposes. This notation packages the complete Adam calculation into an update vector. Ordinary Adam would apply it as follows:

```
wₖ₊₁ = wₖ + pₖ
```

The vector wₖ₊₁ is the next parameter state. The plus sign appears because pₖ already includes the direction and sign of the proposed change. In particular, pₖ is not an unsigned step length.

The derivation assumes that the proposed update is non-zero and has a negative inner product with the gradient:

```
pₖ ≠ 0 and pₖᵀgₖ < 0
```

The superscript T denotes transpose, making pₖᵀgₖ the vector inner product. A negative result means the update has a component against the gradient. These assumptions matter because the estimated SGD learning rate uses that inner product in its denominator.

When Adam has no first-moment averaging, its step can be expressed through a positive diagonal scaling:

```
pₖ = −Hₖgₖ
```

Here, Hₖ is the positive diagonal matrix whose diagonal entries are Adam’s coordinatewise learning-rate multipliers. Positive means that its scaling entries are positive. In this case, a non-zero gradient produces the negative inner-product relationship needed by the derivation.

The paper gives the diagonal entries as:

```
diag(Hₖ) = [√(1 − β₂ᵏ⁺¹)/(1 − β₁ᵏ⁺¹)] · [αₖ/(√vₖ + ε)]
```

The operator diag takes the diagonal entries of Hₖ as a vector. The other symbols retain their Adam meanings: αₖ is the overall learning rate, β₁ and β₂ are the averaging coefficients, vₖ is the squared-gradient state, and ε stabilizes the denominator. The absence of first-moment averaging corresponds to β₁ = 0.

SWATS seeks a scalar γₖ for a candidate SGD step. Its geometric condition is that projecting the scaled negative gradient onto the Adam-step direction reproduces the Adam step:

```
proj_onto_pₖ(−γₖgₖ) = pₖ
```

The symbol γₖ is the candidate SGD learning rate. The operator proj_onto_pₖ denotes an orthogonal projection onto the line defined by pₖ. The direction of this projection is crucial. The authors scale the gradient so that its projection matches Adam’s update; they do not simply project Adam’s update onto the gradient.

Expanding the projection gives:

```
pₖ = −γₖ · [(gₖᵀpₖ)/(pₖᵀpₖ)] · pₖ
```

The inner product pₖᵀpₖ is the squared Euclidean length of Adam’s update. The inner product gₖᵀpₖ measures alignment between gradient and update. Solving this scalar relationship yields the rate estimate:

```
γₖ = (pₖᵀpₖ)/(−pₖᵀgₖ)
```

Every quantity on the right is available from the current gradient and Adam calculation. Under the stated assumptions, the numerator is positive and the denominator is positive, so the estimated rate is positive. The monitor therefore does not need a separately tuned SGD run to propose a destination scale.

#### Why this geometric choice matters

An ordinary projection in the other direction would produce an update no longer than Adam’s step. The authors report that this alternative estimated SGD rates too conservatively. Their chosen construction allows the full scaled-gradient step to be larger while retaining the required component along Adam’s direction.

They also report trying a simpler rule based only on update and gradient lengths:

```
γₖ = ‖pₖ‖/‖gₖ‖
```

The double bars denote Euclidean norm, or vector length. This expression matches step length without accounting for the angle between the vectors. The authors found it unsuccessful and argue that it fails to represent the relative importance of coordinates adequately.

The contrast explains why SWATS uses an inner product rather than only norms. Its estimate depends on both update size and gradient alignment. That does not make it an exact reconstruction of an ideal SGD rate, but it gives the handoff a task-dependent scale derived from actual training behavior.

The paper further notes that, without Adam momentum, the estimate has a relationship to a Rayleigh quotient involving the inverse diagonal scaling. This observation clarifies its mathematical structure. The practical algorithm, however, only needs the scalar ratio of inner products; it does not require constructing or inverting a large matrix.

#### Smooth the estimate and detect agreement

A rate computed from one stochastic gradient can fluctuate. SWATS therefore keeps an exponentially weighted estimate:

```
λₖ = β₂λₖ₋₁ + (1 − β₂)γₖ
```

The scalar λₖ is the running average, initialized at zero. The parameter β₂ is reused from Adam’s second-moment average. The latest rate estimate γₖ supplies the new observation. Reusing β₂ avoids introducing another averaging parameter.

The zero initialization initially pulls the running average downward. SWATS corrects for that influence when testing whether to switch:

```
|λₖ/(1 − β₂ᵏ) − γₖ| < ε
```

The vertical bars denote absolute value. The fraction is the bias-corrected running average, and γₖ is the current estimate. The threshold ε determines when their difference is small enough. The authors check this condition at iterations satisfying k > 1.

This condition is best understood as an agreement test. A current observation is compared with a smoothed history. The paper motivates it through stabilization, but the expression itself does not demand that every recent observation remain close, nor does it explicitly measure a full window’s variability. Its usefulness is established through the reported experiments.

When the condition succeeds, the destination learning-rate estimate is fixed as:

```
Λ = λₖ/(1 − β₂ᵏ)
```

The capital Λ denotes the bias-corrected estimate at the switching point. It is the learned scale for the SGD phase. The training schedule can subsequently reduce the learning rate, so fixing this handoff value does not imply that the rate remains unchanged for the rest of training.

When β₁ is positive, the paper uses momentum SGD and applies the usual momentum correction:

```
α_SGDM = (1 − β₁)Λ
```

The scalar α_SGDM is the learning rate used with the momentum accumulator. The destination momentum coefficient is β₁. This correction accounts for the scaling introduced by accumulating gradients in the SGDM convention described earlier.

The resulting procedure is a hard transition. Before the trigger, Adam supplies the updates. Afterward, SGD or SGDM supplies them. The paper does not gradually blend the two directions in its proposed main method, although it discusses that possibility as future research.

### Experiments and results

#### Image tasks and what they measure

The image experiments test whether the hybrid can preserve early progress while improving predictions on held-out images. The CIFAR datasets provide classification tasks with different numbers of target classes. CIFAR-10 uses 10 classes, while CIFAR-100 uses 100. Each has 50,000 training images and 10,000 testing images, with RGB inputs of size 32 × 32.

The tested architectures include DenseNet and SENet, alongside PyramidNet and ResNet-32. The connection to residual architectures comes through [Deep Residual Learning for Image Recognition](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/). Using several architectures helps show that the reported optimizer pattern is not confined to the initial DenseNet example.

The larger image experiment uses ResNet-18 on Tiny-ImageNet. The paper describes this dataset as an ImageNet subset with 200 classes. Its stated training setup contains 500 RGB images per class at 224 × 224, with 50 per class in each of the validation and testing sets. The authors use it as an accessible indicator of behavior relevant to the larger image task.

Classification results are discussed through testing accuracy or testing error. These are complementary descriptions of prediction success, but the paper’s own wording is not perfectly consistent in the clipping discussion. The clearest numerical comparison is the approximate testing-error contrast between SGD and Adam on DenseNet with CIFAR-10.

DenseNet on CIFAR-10, approximate final testing error SGD finishes with lower testing error than Adam in the diagnostic comparison.

**The numbers**

| System or setting | testing error % |
| --- | --- |
| Adam | 7 |
| SGD (this paper) | 5 |

The chart values are approximate, as the authors report them. This experiment illustrates the motivating gap; it does not provide a numerical SWATS endpoint. Adam improves quickly at the beginning but settles at a worse held-out result, while SGD eventually reaches the stronger outcome.

#### Language tasks and their different outcome

The language experiments study [language prediction](https://md.research.elamur.ai/free/en/topics/language-models/) at the word level: a preceding sequence is used to predict the following word. The datasets are Penn Treebank, abbreviated PTB, and WikiText-2, also written as WT-2 or WT2 in the paper. The latter is connected to the dataset discussion in [Pointer Sentinel Mixture Models](https://md.research.elamur.ai/free/en/papers/merity-2016-pointer-sentinel-mixture-models/).

The architectures are AWD-LSTM and AWD-QRNN. The LSTM setup uses recurrent layers and learned [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/). The QRNN alternative replaces the more expensive recurrent layer with one based on convolutions. The authors describe the prediction task as demanding because of dependencies extending over a sequence and as relevant to other sequence tasks.

That connection includes [machine translation](https://md.research.elamur.ai/free/en/topics/machine-translation/), for which the paper cites [Neural Machine Translation by Jointly Learning to Align and Translate](https://md.research.elamur.ai/free/en/papers/bahdanau-2014-neural-machine-translation-jointly-learning/). The connection motivates the choice of language prediction as an evaluation task. It does not mean that SWATS is directly tested on translation in these experiments.

The language networks use substantial regularization. The paper names DropConnect on hidden-to-hidden connections, weight decay, tied embedding and output weights, and penalties on activity and temporal activity. These settings matter because the optimizer operates within a complete training recipe, rather than in isolation.

A further difference concerns gradient clipping. For SGD, the authors limit the gradient norm to 0.25. They do not apply that clipping to Adam or SWATS. They report that removing clipping harms SGD, while adding it harms the adaptive and hybrid procedures. The comparisons therefore use settings selected to work for each optimizer, instead of an identical clipping rule.

The relevant held-out measure is validation perplexity, with lower values indicating better word prediction under the evaluation. The narrative specifically compares the lowest validation perplexity reached during training. It does not provide numerical perplexity endpoints in the available results text, so the outcome should be reported qualitatively.

#### How the optimizers were tuned

The authors tune the overall learning rate for every optimizer and report the configuration with the strongest generalization. For Adam and SWATS, the candidate rates are 0.0005, 0.0007, 0.001, 0.002, 0.003, 0.004, and 0.005. Both use β₁ = 0.9 and β₂ = 0.999.

Those settings mean that the actual SWATS transitions in these experiments go to momentum SGD with momentum 0.9. The experiments therefore support the Adam-to-SGDM procedure under these defaults. They should not be read as equally extensive tests of the momentum-free derivation.

SGD receives a broader, task-sensitive rate search. The authors first search coarsely on a logarithmic scale from 10⁻³ to 10², then refine the rate. They test training with and without momentum, while keeping the momentum coefficient at 0.9 when momentum is used.

The examples show why a single narrow grid would be unsuitable across modalities. For DenseNet on CIFAR-10, the best SGD rate is reported as 0.7. For the LSTM language experiment on PTB, the required SGD rate is 50. These numbers describe different training setups and should not be interpreted as a universal relationship between image and language tasks.

Other settings, including batch size, dropout, and norm-based decay, follow the recommendations for the underlying architectures. The main benchmark runs last 300 epochs. Learning rates are reduced by 10 at epochs 150, 225, and 262. This shared schedule is part of the empirical setting in which the optimizer comparisons succeed.

The implementation uses PyTorch. The authors report running scheduled jobs on 16 NVIDIA Tesla K80 GPUs over roughly 3 weeks. That describes the experimental effort; it is not a controlled measurement of SWATS’s runtime overhead relative to Adam.

#### Main image findings

Across the reported image tasks, Adam makes strong initial progress but finishes with weaker generalization than SGD. The paper presents SWATS as closing the gap on most tasks while retaining useful early improvement. Its conclusion is about approaching the better baseline, rather than consistently exceeding every baseline.

For most CIFAR experiments, the automatic transition occurs within the first 20 epochs. Tiny-ImageNet switches later, at epoch 49. These observations show that the criterion does not impose a common transition epoch across datasets. The learned event depends on the gradient and update behavior of the run.

Tiny-ImageNet also supplies the clearest warning about transition dynamics. Immediately following the switch, test accuracy drops to 52% from 80%. The network then recovers and reaches a better peak testing accuracy than Adam. The authors report observing similar disruption and recovery with other architectures on that dataset.

That result supports the possibility of a useful hybrid in spite of a rough handoff. It does not show that the temporary loss is harmless in every practical setting. A run evaluated immediately after switching would look very different from one allowed to continue under the reported schedule.

The paper’s discussion of the estimated SGD rate adds another piece of evidence. The per-update estimate is noisy, but its average behavior settles toward a scale similar to a separately tuned SGD rate. This is the intended role of the projection calculation: it supplies a plausible destination scale without a second rate search during SWATS training.

#### Main language findings

The language experiments reverse the ordering seen in vision. Adam achieves better final generalization than the tested SGD procedure and reaches strong performance sooner. This is an important boundary on any claim that adaptive optimization necessarily generalizes poorly.

SWATS still transitions to SGD, generally later than in the image experiments, and reaches validation perplexity comparable to Adam. It can also show a temporary decline after switching. The hybrid’s success here is therefore preservation of a strong adaptive baseline’s result, rather than recovery of an SGD advantage.

The authors relate SGD’s weaker showing to the earlier training recipe in [Regularizing and Optimizing LSTM Language Models](https://md.research.elamur.ai/free/en/papers/merity-2017-regularizing-optimizing-lstm-language-models/), which used iterate averaging to reach its strongest performance. Their own comparison does not establish a ceiling on every possible SGD procedure for these tasks.

Taken together, the image and language results support a restrained conclusion. The automatic handoff is viable across the tested modalities and tends to approach the better component optimizer. The numerical text does not supply all final benchmark endpoints, so it does not support a more detailed ranking by exact margins.

### What the ablations show

#### Restricting Adam’s coordinatewise rates

The most direct mechanism-focused comparison uses DenseNet on CIFAR-10. Adam, SGD, and clipped Adam variants are trained for 200 epochs, with the learning rate reduced by 10 after epoch 150. This diagnostic schedule differs from the longer main benchmark schedule.

The lower-bound and upper-bound restrictions behave differently. Limiting Adam’s large coordinatewise rates with Adam-Clip(0, 1) produces no meaningful improvement in final generalization. Preventing very small rates with Adam-Clip(1, ∞) recovers part of the gap between Adam and SGD.

The paper attaches an approximate value of 6% to the latter result, but calls it accuracy even though the surrounding discussion concerns error. That wording makes the metric label ambiguous. The safe conclusion is the qualitative one supported by the surrounding comparison: the lower-bound restriction helps partially, while the upper-bound restriction does not materially help.

This asymmetry supports the authors’ concern that some learned coordinatewise rates can become too small. It weakens the simple explanation that Adam’s difficulty in this example comes mainly from overly large updates. It does not establish that imposing a lower bound is sufficient to match SGD, because the improved clipped variant still leaves a gap.

The authors also state that further tuning of Adam’s initial rate and learning-rate schedule did not improve the illustrated outcome. That matters because a poor schedule could otherwise explain the comparison. Their search does not prove that every conceivable schedule would fail, but it shows that the observed problem survived the adjustments they tried.

#### Choosing the transition time manually

A second comparison switches from Adam to SGD at selected epochs on the same DenseNet task. The destination optimizer uses learning rate 0.1 and momentum 0.9. The illustrated transition points are 10, 40, and 80 epochs.

Switching after 10 epochs produces a trajectory resembling SGD. The interpretation is straightforward: the adaptive phase is short enough that much of the run behaves like the destination optimizer. This can recover SGD-like generalization, but it leaves less room to benefit from Adam’s early speed.

A transition after 80 epochs performs worse. The paper associates that late switch with an approximate error-level result of 6.5%, although its sentence again uses an accuracy label inconsistent with the surrounding discussion. The central observation is that a late transition does not recover the same generalization as an earlier one.

The comparison at 40 epochs is included in the figure description, but the narrative does not give a separate exact endpoint for it. Its role is to place an intermediate transition alongside the earlier and later choices. An exact ranking or margin should not be inferred beyond what the authors state.

This analysis establishes that transition time is consequential. It also motivates automation without proving that the SWATS trigger identifies an optimal moment. The proposed condition is a practical rule tested across tasks, not a solution to an explicit optimization problem over all possible switching times.

#### Comparing learning-rate estimates

The projection construction is supported by comparisons with simpler alternatives. The authors report that projecting Adam’s step onto the negative gradient gives an SGD rate that is too small. They also report unsuccessful results from matching the ratio of the two vector lengths.

These alternatives isolate what the final rule uses. The reverse projection preserves a required component along Adam’s direction, while the length-only rule discards angle information. Their contrast supports paying attention to the relationship between direction and magnitude when transferring from an adaptive update to a scalar-rate update.

The evidence here is qualitative. The paper does not supply numerical benchmark endpoints for each alternative estimator in the narrative. It therefore supports the choice as an empirically motivated design decision, rather than a quantified account of how much each part contributes.

The authors additionally mention experimenting with more elaborate switching criteria, including gradient-norm monitoring. They find the simpler unnormalized agreement test effective across the studied applications. Without detailed results for the alternatives, this is evidence for practical adequacy instead of a complete comparison of possible detectors.

#### What is not separately isolated

The paper does not provide an exhaustive factorial ablation of smoothing, bias correction, thresholding, momentum correction, and transition timing. Several elements have clear mathematical motivations, but their individual contributions are not all measured in separate controlled runs.

For instance, bias correction removes the influence of zero initialization from the running average. That explains why it belongs in the monitored quantity. It does not tell a reader how much final accuracy would change if it were omitted in every benchmark.

Similarly, reusing β₂ avoids another hyper-parameter, and the authors report relative insensitivity to fine adjustments of that coefficient. The article does not present a detailed sensitivity curve. The strongest supported claim is that this reuse worked under the tested recipe.

The language clipping comparison also deserves careful interpretation. It improves the credibility of each optimizer’s chosen configuration, because the authors report testing whether clipping helps. At the same time, it means the language results compare complete procedures with different clipping behavior, rather than isolating optimizer equations under every other setting held identical.

#### What the trajectory analyses add

The learning-rate evolution plots show why averaging is useful. Individual estimates fluctuate while their average behavior becomes more settled. This connects the algorithm’s scalar monitor to actual training behavior and supports the choice to avoid acting on an unsmoothed value alone.

The transition plots reveal a different issue: the hard switch can disrupt performance even when the final result is competitive. The cause is not isolated by a dedicated experiment, so it would be too strong to attribute the disruption to one specific state variable or scaling mismatch.

Together, these analyses offer a coherent but incomplete account. Coordinatewise restrictions motivate leaving Adam, timing comparisons motivate choosing the handoff carefully, and rate-estimator comparisons motivate the geometric rule. The benchmark results then test the assembled procedure. The paper gives useful evidence for each stage without claiming a complete causal decomposition.

### Limitations

#### Limits the authors acknowledge

The authors present SWATS primarily as an empirical investigation of hybrid optimization. They do not prove that the switching condition guarantees convergence to a better-generalizing solution in deep networks. Their discussion explicitly treats the connection between optimization paths and generalization as requiring more theoretical and experimental support.

They suggest that an adaptive beginning may still leave the network able to reach a more favorable region after changing to SGD. That is a hypothesis about training dynamics, not a directly established explanation of the results. The experiments show outcomes consistent with it, but do not identify or characterize the relevant regions mathematically.

The hard transition is another acknowledged weakness. Tiny-ImageNet demonstrates that held-out performance can deteriorate sharply before recovering. The authors propose a smoother mixture of Adam and SGD directions as a possible remedy. That mixture is a research direction instead of the evaluated main procedure.

They also leave repeated switching open. Preliminary CIFAR-10 experiments suggest that returning from SGD to Adam near the end of a 300 epoch run can improve performance slightly. The paper does not supply a developed automatic back-and-forth strategy or a detailed numerical evaluation of that idea.

Other adaptive methods are discussed as possible starting points. The authors argue that the approach could extend to Adagrad or RMSProp. The benchmark evidence, however, concerns the Adam-based hybrid. General applicability is a proposal whose broader empirical support remains to be established.

#### Limits visible in the comparison

The result is not that SWATS is always best. The paper describes it as performing nearly as well as the stronger component optimizer across the tasks. That is a useful outcome for reducing the risk of choosing poorly, but it differs from demonstrating a consistent new best result.

The language experiments are particularly important here. They show Adam outperforming the tested SGD setup, so the image-task conclusion cannot be generalized into a rule that SGD is the superior late-stage optimizer for all language training. The hybrid preserves competitive performance in those experiments, but its transition is not necessary to beat Adam.

The SGD baseline also lacks the iterate-averaging procedure that the authors identify as important in earlier language work. A careful reader should therefore interpret the results as comparisons among the implemented training recipes. They do not exhaust all methods that could be grouped under SGD.

The learning-rate search is substantial and task dependent. SWATS avoids separately tuning a transition epoch and a destination rate, but its initial Adam learning rate still requires selection in the experiments. Claims about reduced tuning should be tied to those omitted handoff choices, rather than interpreted as the removal of tuning altogether.

The shared decay schedule is another boundary. The optimizer comparisons are embedded in a particular training duration and set of rate reductions. The paper does not establish that the same relative behavior holds under every budget, schedule, or stopping rule.

#### The trigger has a narrower meaning than stability

The switching condition checks whether the latest scalar estimate is close to a corrected running average. It does not directly measure generalization, inspect a validation plateau, or certify that all recent estimates are tightly concentrated. A successful check is a particular numerical event.

This distinction matters because the paper’s motivating language concerns stabilization. The agreement test may be a useful indicator of that behavior, but its success does not prove that optimization has entered a universally identifiable new phase. The connection is empirical.

The derivation also begins with assumptions about a non-zero Adam step and its alignment with the gradient. Positivity follows directly in the no-momentum case under the stated scaling structure. With momentum, the current update includes historical information, so the simple argument no longer automatically covers every possible step.

The available mathematical description does not justify inventing additional safeguards for exceptional cases. It supports explaining the assumptions and noting that an implementation needs to respect the conditions under which the rate estimate is meaningful. Those cases are part of the distinction between a compact derivation and a fully specified account of every numerical contingency.

#### Evidence and reporting boundaries

The main result figures span several architectures and datasets, but the numerical narrative does not state all final error or perplexity values. The metadata table is described as recording tuned rates and switching information, yet its individual entries are not given in the results text. Exact endpoint claims beyond the stated values would therefore be unwarranted.

The paper also does not state repeated-run variability or uncertainty estimates in the experimental account. Without those, a reader cannot assess how consistently small apparent advantages would recur under different training randomness. This does not erase the broad pattern, but it limits fine-grained ranking.

Monitoring overhead is described as small because the procedure adds scalar calculations to information already computed by Adam. The study does not present a dedicated runtime comparison that quantifies that overhead. Computational simplicity and measured training speed are related questions, but the reported evidence addresses them differently.

Finally, the experiments do not establish a universal causal story about adaptive scaling. The clipping analysis supports one concern, and earlier theory supplies related examples. Deep-network behavior remains more complicated than the scalar monitor alone can explain.

#### What the least-squares discussion does and does not establish

The discussion uses a simpler optimization problem to illustrate why the path of an optimizer can select a particular solution:

```
minimize ‖Xw − y‖₂²
```

The matrix X represents the inputs, w is the parameter vector, and y contains the targets. The subscript 2 denotes Euclidean norm, and the square makes this a squared-error objective. The example starts from w₀ = 0.

The authors use it to contrast SGD’s minimum-norm outcome with the behavior of adaptive methods. The important conceptual point is that optimization can impose an implicit preference among solutions, even when that preference is not written as an extra penalty in the objective.

The subspace explanation needs dimensional care. For the written form Xw, gradients in parameter space belong to the span generated by the columns of Xᵀ, equivalently the row space of X. The paper refers to a column-space restriction without making that orientation explicit. The underlying illustration concerns remaining in a gradient-generated subspace.

This example motivates studying optimizer trajectories, but it is not a proof about the deep networks in the experiments. Switching after an adaptive phase also differs from beginning SGD at zero. The paper recognizes that extending such arguments to deep-network hybrids remains an open problem.

### What came after

No later citing studies are identified in the available later-work record, so a subsequent research history cannot be established here. The paper’s own discussion instead provides a concrete set of unresolved directions that follow from its results.

The first is to make the transition gentler. Instead of replacing Adam’s direction at a single event, a procedure could gradually increase the contribution of SGD. The authors connect this possibility to earlier work combining adaptive and SGD updates. The temporary performance losses in their experiments explain why such a transition would be worth investigating.

Another direction is to allow movement back to Adam. The preliminary return-to-Adam observation suggests that different stages might benefit from different update behavior, rather than a single permanent change. What remains missing is an automatic rule for those repeated decisions and a full evaluation of their consequences.

The authors also propose combining the hybrid with other changes to adaptive optimization, including monotonic second-moment behavior, norm correction, and cosine-based scheduling. These are prospective combinations, not results demonstrated by SWATS itself.

The lasting question posed by the paper is how much of optimizer selection should happen during training. SWATS gives a specific answer for one transition: infer a scalar rate from update geometry and use agreement with its history to trigger the handoff. Its evidence makes that approach worth testing while leaving the broader explanation—and the best way to manage more complex transitions—unsettled.

## Cite

Cite as Nitish Shirish Keskar and Richard Socher. 2017. Improving Generalization Performance by Switching from Adam to SGD. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.48550/arxiv.1712.07628](https://doi.org/10.48550/arxiv.1712.07628) · [arXiv 1712.07628](https://arxiv.org/abs/1712.07628)

```bibtex
@misc{keskar2017improving,
  title = {{Improving Generalization Performance by Switching from Adam to SGD}},
  author = {Nitish Shirish Keskar and Richard Socher},
  year = {2017},
  doi = {10.48550/arxiv.1712.07628},
  eprint = {1712.07628},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.1712.07628}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
