# lucidrains/lion-pytorch

🦁 Lion, new optimizer discovered by Google Brain using genetic algorithms that is purportedly better than Adam(w), in Pytorch

Repository: https://github.com/lucidrains/lion-pytorch
Canonical: https://ross.abutalabs.com/products/lion-pytorch
Language: Python
License: MIT
License Family: permissive
Topics: artificial-intelligence, deep-learning, optimizers, evolutionary-search
Last push: 2026-07-09T14:19:32+00:00

## Health v2 (maintenance only)
Score: 62/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 91, release rhythm 8, longevity 92
- inputs: {"age_days": 1295, "days_push": 55, "days_rel": 644, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2199, forks 55 (observed 2026-08-28T04:06:25.504399+00:00)

## What it is
A PyTorch implementation of the Lion optimizer (Evolved Sign Momentum), discovered by Google Brain via genetic algorithms and claimed to outperform AdamW. It is a lightweight drop-in optimizer class with tuning guidance for learning rate and beta parameters.

## Use cases
- train neural networks with the Lion optimizer in PyTorch
- replace AdamW with a potentially better optimizer
- speed up deep learning model training
- experiment with optimizers discovered via evolutionary search
- tune learning rate and betas for Lion optimizer

## When to choose
- you train models in PyTorch and want to try a modern alternative to AdamW
- you are doing language modeling or text-to-image training where Lion has shown positive results
- you want a minimal, easy-to-integrate optimizer implementation

## When to avoid
- you need a battle-tested optimizer with guaranteed stability out of the box
- you cannot afford hyperparameter retuning, since Lion requires 3-10x smaller learning rates than AdamW
- you are not using PyTorch

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning
- domain: deep-learning, machine-learning, artificial-intelligence
- platform: python
- tags: optimizer, pytorch, lion-optimizer, evolutionary-search, training

## Member repositories
- lucidrains/lion-pytorch (main) score 62

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:25.504399+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:47:07.585932+00:00, confidence not recorded.
  - readme: https://github.com/lucidrains/lion-pytorch (fetched 2026-08-28T04:06:25.504399+00:00, sha a6389a656485)
- Data as of 2026-08-30T08:39:29.467469+00:00.
