KellerJordan/Muon has 2,939 GitHub stars and 134 forks. GitHot measured +1 stars in 24 hours and +11 in 7 days. Last checked 2026-11-13 20:13 UTC. Last push 2026-05-24.
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +11
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
소개
Muon은 신경망의 은닉층을 위한 옵티마이저입니다.
머신러닝README.md
OriginalMuon: An optimizer for the hidden layers of neural networks
This repo contains an implementation of the Muon optimizer originally described in this thread and this writeup.
Installation
pip install git+https://github.com/KellerJordan/Muon
Usage
Muon is an optimizer for the hidden weights of a neural network. Other parameters, such as embeddings, classifier heads, and hidden gains/biases should be optimized using standard AdamW. Muon should be used as follows:
# optimizer = torch.optim.AdamW(model.parameters(), lr=3e-4, betas=(0.90, 0.95), weight_decay=0.01)
# To replace the above, do the following:
from muon import MuonWithAuxAdam
hidden_weights = [p for p in model.body.parameters() if p.ndim >= 2]
hidden_gains_biases = [p for p in model.body.parameters() if p.ndim < 2]
nonhidden_params = [*model.head.parameters(), *model.embed.parameters()]
param_groups = [
dict(params=hidden_weights, use_muon=True,
lr=0.02, weight_decay=0.01),
dict(params=hidden_gains_biases+nonhidden_params, use_muon=False,
lr=3e-4, betas=(0.9, 0.95), weight_decay=0.01),
]
optimizer = MuonWithAuxAdam(param_groups)
You'll have to replace model.body, model.head, and model.embed with whatever is appropriate for your model.
E.g., for a ConvNet, you should use Muon to optimize all the convolutional filters except the first one, and AdamW to optimize everything else.
Example usage
Example use in the NanoGPT speedrun
Example use in the CIFAR-10 speedrun
Hyperparameter tuning
Typically, the default values of momentum (0.95), nesterov (True), and ns_steps (5) work well. Only the learning rate and weight decay must be tuned. The learning rate should have built-in muP scaling: That is, as you scale up the model size, you shouldn't need to retune it.
Benchmarks
For a comparison between AdamW, Shampoo, SOAP, and Muon for training a 124M-parameter transformer, see here.
Accomplishments
- Lowered the record for training to 94% on CIFAR-10 from 3.3 A100-seconds to 2.6 A100-seconds
- Used to train a transformer to GPT-2 (XL) performance in $175 of compute
- Improved the training speed record for attaining GPT-2 (small) performance by a factor of 1.35x
- Used by the Kimi.ai frontier lab for scaled LLM training
- Ashish Vaswani's lab essential.ai showed that Muon is especially good for training with large batch size
More learning resources and results about Muon
- Blog post on Muon by Jianlin Su (the creator of RoPE)
- Blog post by Jeremy Bernstein on theoretical background of Muon
- Tech report by Kimi.ai on using Muon for scaled training
- Why we chose Muon: Our chain of thought (by Jianlin Su at Kimi.ai)
Citation
@misc{jordan2024muon,
author = {Keller Jordan and Yuchen Jin and Vlado Boza and You Jiacheng and
Franz Cesista and Laker Newhouse and Jeremy Bernstein},
title = {Muon: An optimizer for hidden layers in neural networks},
year = {2024},
url = {https://kellerjordan.github.io/posts/muon/}
}
관련 프로젝트 살펴보기
tensorflow/tensorflow
모두를 위한 오픈소스 머신러닝 프레임워크
201,591 스타huggingface/transformers
🤗 Transformers: 텍스트, 비전, 오디오, 멀티모달 분야의 최첨단 머신러닝 모델을 위한 모델 정의 프레임워크로, 추론과 학습을 모두 지원합니다.
168,951 스타AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion 웹 UI
165,306 스타Comfy-Org/ComfyUI
그래프와 노드로 구성된 인터페이스를 갖춘, 가장 강력하고 모듈성이 뛰어난 확산 모델 GUI, API, 백엔드입니다. 세계에서 가장 빠른 로컬 추론 엔진입니다.
146,694 스타