Recent improvements to the Adam optimizer

Researchers have improved the widely used deep learning optimizer Adam, decreasing the time needed for training models and improving model generalization. We made a small contribution of our own by open sourcing our PyTorch implementation of QHAdamW.

The Adam optimizer is one of the most commonly used optimizers for deep learning. When training with Adam the model usually converges a lot faster than when using regular stochastic gradient descent (SGD), and Adam often requires less tuning of the learning rate compared to SGD with momentum. Adam improves on SGD with momentum by (in addition to momentum) also computing adaptive learning rates for each parameter that is tuned. This means that when using Adam there is less need to modify the learning rate during the training than when using SGD. For a more detailed description of Adam and other optimization algorithms, see the blog post An overview of gradient descent optimization algorithms by Sebastian Ruder.

Adam is unfortunately not without flaws. In many research papers the best generalization results are achieved by SGD with momentum coupled with a well-tuned learning rate schedule. While training with Adam helps in getting fast convergence, the resulting model will often have worse generalization performance than when training with SGD with momentum. Another issue is that even though Adam has adaptive learning rates its performance improves when using a good learning rate schedule. Especially early in the training it is beneficial to use a lower learning rate to avoid divergence. This is because in the beginning the model weights are random, and thus the resulting gradients are not very reliable. A learning rate that is too large might result in the model taking too large steps and not settling in on any decent weights. When the model overcomes these initial stability issues the learning rate can be increased to speed up convergence. This process is called learning rate warm-up, and one version of it is describe in the paper Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour.

The following recently published optimizers improve Adam in different ways and try to alleviate some of the issues mentioned above:


AdamW

In the common weight decay implementation in the Adam optimizer the weight decay is implicitly bound to the learning rate. This means that when optimizing the learning rate you will also need to find a new optimal weight decay for each learning rate you try. The AdamW optimizer decouples the weight decay from the optimization step. This means that the weight decay and learning rate can be optimized separately, i.e. changing the learning rate does not change the optimal weight decay. The result of this fix is a substantially improved generalization performance; models trained with AdamW using an annealing learning rate schedule achieve results on image recognition tasks (e.g. CIFAR-10 and ImageNet) that match the ones achieved with SGD + momentum.


As seen in this figure from the AdamW paper, the optimal weight decay in Adam is dependent on the learning rate, but in AdamW they are independent.


For a more detailed explanation on the AdamW algorithm, see Ruder's blog post Optimization for Deep Learning Highlights in 2017.

Implementations

PyTorch

TensorFlow


QHAdam

QHAdam decouples the momentum buffer discount factors (beta1 and beta2) from the contribution of the current gradient to the weight update by setting the weight update to be a weighted average of the momentum and the current unmodified gradient. This means that you may (by increasing beta1 and/or beta2) update the momentum buffer more slowly and thus decrease its variance without the weight updates becoming too stale (i.e. containing too much old gradient information). This is because in QHAdam the gradient can directly affect the update step, whereas in Adam the update step is calculated solely using the momentum buffer. In the paper the effectiveness of QHAdam is demonstrated on both neural machine translation and reinforcement learning tasks, where it in both cases outperforms Adam in both generalization performance and training stability.

Implementations

PyTorch & TensorFlow

‍

QHAdamW

QHAdamW combines the weight decay decoupling from AdamW to the weight update rule changes from QHAdam, as suggested in the QHAdam paper. This is an implementation we made ourselves at IPRally. The end results we achieved with it are about the same as with AdamW, but in the early stages of the training QHAdamW performs a bit better (when using the default parameters given in the QHAdam documentation).

Implementations 

PyTorch


LAMB

The LAMB optimizer aims to eliminate the need of the learning rate warm-up needed in the early stages of training. This is done by automatically scaling the weight update layer-wise by the ratio of the weight magnitude and the gradient magnitude for that layer. Intuitively the idea is that if the gradient magnitude is large compared to the weight magnitude then the weights for that layer are very bad, and the gradients are thus not reliable. In that case it makes sense to take small steps to avoid "jumping around" too much. On the other hand, if the magnitude of the gradients is small compared to the magnitude of the weights then it is probable that the weights are already quite good. In this case the gradient estimate is more reliable and a larger step size is warranted. In the paper LAMB is demonstrated to work well even with very large batch sizes: The full BERT model is trained in just 76 minutes (compared to 3 days in the original paper), and a ResNet-50 network can be trained on ImageNet in just a few minutes.

For a more thorough review of the LAMB algorithm, see the blog post An intuitive understanding of the LAMB optimizer written by Ben Mann.

Implementations

PyTorch

TensorFlow


Conclusions


If you usually use Adam you should definitely try out AdamW, QHAdam or QHAdamW the next time you train a deep model. In case you use weight decay then AdamW is probably the safe choice to start with since there is no additional hyperparameters to tune, but QHAdam/QHAdamW is also pretty simple to take into use even though it has two new parameters. At IPRally we got a nice increase in generalization performance when replacing Adam with AdamW and fine-tuning the weight decay. QHAdamW performed about the same as AdamW, although the model learned a bit quicker in the early stages. Using LAMB sped up the convergence in the early phases, but in the end the results were a bit worse than with AdamW. In case you need to train on very large batch sizes LAMB might still be the way to go.


Read more

Webinar Q&A follow-up: your questions about the IPRally MCP answered

Thank you to everyone who joined Patent answers, inside the AI you already use. Across the two sessions on 4 November, you sent us more questions than we had time to answer live. We have grouped them by theme below, merged similar questions and included the answers given during the sessions.

Your IPRally workspace, wherever you work

Your AI assistant can now pick up where your IPRally work left off. The IPRally MCP now reads your collections, tags, search cases, projects, and agent runs, so your agent starts from results you’ve already vetted instead of a blank prompt.

Webinar Q&A follow-up: your questions about IPRally Drafting answered

Thank you to everyone who joined No more drafting in the dark: prior-art-aware patent drafting with IPRally Protection. Across our EU and US sessions, you sent us more than 80 questions, from file formats and drawings to claim clarity and US disclosure duties. We have grouped the answers by theme and merged similar questions. Some were answered live or in the chat during the sessions, and we include those here too.

Webinar Q&A follow-up: your questions about IPRally Intelligence answered

Your questions on IPRally Intelligence, answered: from working with larger datasets to verifying results at paragraph level.

IPRally is SOC 2 Type II compliant

IPRally has completed its SOC 2 Type II examination. Advantage Partners, our independent auditor, tested our security controls in operation from March 4 to June 4, 2026, and issued an unqualified opinion: no exceptions noted on any control tested.

When systems start talking: IPRally's journey toward a virtual IP department

Something new is happening: people talk to systems in plain language, systems talk back, and systems have started talking to each other the same way. As AI climbs from the small decisions to the large ones, the question for IP work is no longer whether it gets automated, but how to stay in control once it is. Co-founder and CPO, Sakari Arvela, lays out where this leads – through IPRally's new API and upcoming MCP support toward a virtual IP department that's always on – and why humans end up more important in that picture, not less.

Search, Intelligence, Protection: the three pillars of IPRally’s next chapter

For nearly a decade IPRally has been obsessed with getting one task right: patent search. Having built the best patent search in the world, we’re now reorganizing around three pillars – Search, Intelligence, and Protection – the newest of which makes drafting prior-art-aware from the first sentence. Co-founder and CPO Sakari Arvela maps out the next chapter, and why Protection is the shift he's most personally invested in.

NGen selects IPRally to bring AI-native patent intelligence to Canada's advanced manufacturers

After evaluating a range of tools on functionality, usability, and cost, Canada's Global Innovation Cluster for Advanced Manufacturing chose IPRally to power its Patent Search Adoption Tool Pilot Program.

IPRally and RPX Corporation announce strategic collaboration, cross-linking AI-powered patent search with RPX Empower

IPRally today announces a strategic collaboration with RPX Corporation, the global patent risk management service provider, that further expands the capabilities of the RPX Empower platform and provides seamless access to business critical complementary information for IPRally users.

Macro meets micro: IPRally's next chapter builds intelligence on search

Excellence in patent search was always the foundation. But foundations are meant to be built on. After years of staying focused – and saying no to a lot – IPRally is now ready to bring the same rigor and precision that redefined search to the bigger, strategic questions that businesses make decisions on. CCO Andreas Cehlinder explains why now, and what comes next.