Lion optimizer

Also known as: EvoLved sign momentum · Lion

On this page 6

The Lion optimizer (short for EvoLved sign momentum) is a first-order optimization algorithm for training neural networks that updates each weight by a fixed-magnitude step whose direction is the sign of an interpolated momentum. In training large models in artificial intelligence, Lion serves as a memory-efficient alternative to AdamW, because it stores only one state tensor per parameter instead of two.

Lion was introduced by researchers at Google in 2023, who did not design it by hand but discovered it through symbolic program search, an evolutionary process that mutated and evaluated thousands of candidate update rules. The resulting algorithm is short enough to write in a few lines, yet it matched or exceeded AdamW on image classification, vision-language contrastive learning, diffusion models and language modeling in the original experiments.

How the Lion update rule works

Lion computes each update in three steps that use two momentum coefficients, conventionally called beta1 and beta2. First, it forms an interpolation between the stored momentum and the current gradient using beta1. Second, it takes the elementwise sign of that interpolation, so every coordinate becomes plus one, minus one or zero, and subtracts the learning rate times this sign plus a decoupled weight decay term. Third, it updates the stored momentum with the gradient using beta2.

The use of two different betas is the distinctive feature. With the default beta1 of 0.9 and beta2 of 0.99, the update direction reacts relatively quickly to the current gradient, while the stored momentum keeps a longer memory of past gradients. This combination lets the optimizer respond to new information without losing the smoothing benefit of long-horizon momentum.

Because the sign operation discards magnitude, every parameter moves by exactly the learning rate in each step, apart from weight decay. The update therefore has a uniform norm, which acts as a form of regularization and often leads to flatter minima in the loss landscape.

The table lists the operations in one Lion step and their purpose.

StepOperationPurpose
InterpolateBlend momentum and gradient with beta1Choose a responsive direction
SignTake the elementwise signFix the step size per coordinate
ApplySubtract learning rate times sign plus decayMove weights and regularize
TrackUpdate momentum with beta2Keep a long gradient history
Operations in a single Lion step

Lion compared with AdamW and other optimizers

Lion differs from AdamW mainly in what it stores and how it scales updates. AdamW keeps a first moment and a second moment for every parameter and divides by the square root of the second moment, which produces adaptive per-parameter step sizes. Lion keeps only the first moment and replaces adaptive scaling with the sign function, which saves memory and compute.

The comparison below places Lion among the optimizers most often used for large-scale training.

OptimizerState per parameterStep size behaviorTypical use
SGD with momentumOne tensorScales with gradientConvolutional vision models
AdamWTwo tensorsAdaptive per coordinateDefault for transformers
AdafactorFactored second momentAdaptive, low memoryVery large language models
LionOne tensorUniform sign stepMemory-constrained large models
MuonOne tensorOrthogonalized matrix stepHidden layers of transformers
Lion compared with related optimizers

Lion is also closely related to signSGD with momentum, an earlier family of sign-based methods studied for communication-efficient distributed training. The main innovations in Lion are the dual-beta interpolation and the tuned combination with decoupled weight decay.

Hyperparameters and how to tune them

Lion requires different hyperparameter values from AdamW because its sign-based update has a larger norm per step. The common rule is to use a learning rate 3 to 10 times smaller than for AdamW and a weight decay 3 to 10 times larger, so that the effective decay strength, the product of learning rate and weight decay, stays similar.

The table gives typical starting values; the correct values always depend on model size, batch size and schedule.

HyperparameterTypical valueEffect
Learning rate1e-5 to 3e-4Sets the size of every coordinate step
Beta10.9 (0.95 for stability)Weight of momentum in the update direction
Beta20.99 (0.98 for stability)Length of the stored gradient memory
Weight decay0.1 to 1.0Pulls weights toward zero each step
Batch size64 or largerReduces noise in the gradient sign
Typical Lion hyperparameters

Learning rate warmup and a cosine learning rate schedule work with Lion as they do with AdamW. Gradient clipping has less effect, because the sign function already bounds each coordinate update.

Strengths and limitations of Lion

The main strength of Lion is lower optimizer memory: removing the second moment cuts optimizer state roughly in half compared with AdamW, which matters when training models with billions of parameters. Each step is also slightly cheaper to compute, since it avoids square roots and divisions.

Lion has clear limitations that experienced practitioners account for. The table summarizes when it tends to help and when it tends to underperform.

SituationExpected outcomeReason
Large batch, large modelOften matches or beats AdamWGradient sign is reliable
Small batch trainingOften worse than AdamWNoisy signs cause erratic steps
Tight accelerator memoryClear benefitOnly one state tensor
Transferring AdamW settings unchangedDivergence or poor resultsUpdate norm is much larger
Strong data augmentationSmaller gainsRegularization effects overlap
When Lion is and is not a good choice

Independent studies after the original paper found that the advantage over a well-tuned AdamW is often small and task dependent. The most common mistake is copying AdamW hyperparameters, which usually produces training instability or a loss spike early in the run.

Explained without jargon

Training an AI model means nudging millions of numbers again and again until the model makes fewer mistakes. An optimizer decides how big each nudge is and which way it goes.

Most optimizers vary the size of each nudge. Lion does something simpler. It only asks which direction is downhill, and then takes the same small step for every number. It also remembers recent directions, so it does not zigzag. Because it remembers less than other methods, it needs less computer memory. The trade-off is that it must be set up carefully.

A typical use case

A research team is training a 1.3 billion parameter language model on eight accelerators with 40 GB of memory each. With AdamW, the two optimizer states for every weight force them to use a small per-device batch and frequent gradient checkpointing, which slows training.

They switch to Lion with a learning rate of 1e-4 instead of 6e-4, weight decay raised from 0.1 to 0.6, beta1 of 0.95 and beta2 of 0.98, and keep the same warmup and cosine schedule. The freed optimizer memory lets them raise the per-device batch size and remove some checkpointing.

After a short pilot run confirms stable loss, the full run reaches a validation loss similar to the AdamW baseline while finishing noticeably sooner, which is the outcome teams usually seek when they adopt Lion.