lion-pytorch
Lion Optimizer - Pytorch
Decision gist · record as of 2026-08-14
Yes, with conditions. Lion is permissively licensed, has low install friction, and is actively maintained. Install it if you are training models in domains the paper evaluated (language modeling, vision transformers, text-to-image) and are willing to invest in hyperparameter tuning. The description's own updates acknowledge it performs worse than Adam without careful learning rate adjustment and shows negative results outside tested architectures. Not recommended for reinforcement learning, standard feedforward networks, or exploratory work where you cannot afford tuning overhead.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Learning rate and weight decay require careful tuning (typically 3–10x smaller/larger than AdamW); default hyperparameters may not work without adjustment.
- Low install friction with a single runtime dependency on torch.
License · maintenance · safety
permissive license (permissive) — MIT License permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
last release 2026-07-09 (36 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 159,256 downloads/mo, #10,703 on PyPI
Alternatives
Verify before relying
pip install lion-pytorch
import torch
from torch import nn
from lion_pytorch import Lion
model = nn.Linear(10, 1)
opt = Lion(model.parameters(), lr=1e-4, weight_decay=1e-2)
loss = model(torch.randn(10))
loss.backward()
opt.step()
opt.zero_grad()- Whether Lion's performance gains over AdamW hold across a broad range of model architectures and training regimes beyond those tested in the original paper
- Optimal learning rate schedules and hyperparameter tuning strategies for specific problem domains
- Stability and convergence behavior with batch sizes below 64, given the author's recommendation for high batch sizes
What it is and what it does
Lion is a PyTorch optimizer implementing an evolved sign momentum algorithm that the description positions as a potential successor to AdamW. It depends only on torch and integrates directly into PyTorch's optimizer interface. The optimizer requires careful hyperparameter tuning: learning rates should typically be 3–10x smaller than AdamW equivalents, weight decay values 3–10x larger, and default β1 and β2 values differ from AdamW (0.9 and 0.99 versus 0.9 and 0.999). The description documents mixed empirical results—positive outcomes reported for language modeling and text-to-image training when tuned correctly, but negative results outside the paper's tested domains (reinforcement learning, feedforward networks, hybrid architectures). The author recommends Lion primarily for high batch sizes (64 or above) and notes sensitivity to batch size, data volume, and augmentation.
Use it for
- Training large language models where a 3x smaller learning rate than AdamW yields better convergence
- Text-to-image model training when hyperparameters are carefully tuned to the specific architecture
- Vision transformer training with cosine decay learning rate schedules
- Scenarios with high batch sizes (64+) where Lion's sign momentum approach may outperform adaptive methods
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Lion is permissively licensed, has low install friction, and is actively maintained. Install it if you are training models in domains the paper evaluated (language modeling, vision transformers, text-to-image) and are willing to invest in hyperparameter tuning. The description's own updates acknowledge it performs worse than Adam without careful learning rate adjustment and shows negative results outside tested architectures. Not recommended for reinforcement learning, standard feedforward networks, or exploratory work where you cannot afford tuning overhead.
Install
lion-pytorch on PyPI
Before you install
Low install friction with a single runtime dependency on torch. Actively maintained with a recent release 36 days ago.
Requires Python 3.9 or later. Learning rate and weight decay require careful tuning (typically 3–10x smaller/larger than AdamW); default hyperparameters may not work without adjustment.
License in practice
MIT License permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install lion-pytorch
import torch
from torch import nn
from lion_pytorch import Lion
model = nn.Linear(10, 1)
opt = Lion(model.parameters(), lr=1e-4, weight_decay=1e-2)
loss = model(torch.randn(10))
loss.backward()
opt.step()
opt.zero_grad()
Verify before relying
- Whether Lion's performance gains over AdamW hold across a broad range of model architectures and training regimes beyond those tested in the original paper
- Optimal learning rate schedules and hyperparameter tuning strategies for specific problem domains
- Stability and convergence behavior with batch sizes below 64, given the author's recommendation for high batch sizes
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetorch |
| Maintenance | Actively maintained 36 days since the last release |
| First released | |
| Downloads | 159,256 / month, #10,703 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial Intelligence |
Evidence: lion_pytorch-0.2.5-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytorch optimizer alternative to adam”
- lion-pytorchLion is a PyTorch optimizer that implements an evolved sign momentum…
- adam-atan2-pytorchProvides an Adam optimizer variant using atan2 for numerical…
- pytorch-rangerRanger is a PyTorch optimizer that combines RAdam (Rectified Adam)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also adam-atan2-pytorch · flashoptim · schedulefree · pytorch-ranger · prodigyopt · pytorch_optimizer · hyper-connections · opt-einsum-fx · torch-optimizer · omnimalloc