The Mathematics of Optimizers优化器的数学原理
Read The Mathematics of Optimizers in order, following the questions developed in each installment.按期阅读《优化器的数学原理》,沿着每一期的问题逐步展开。
- For whom适合谁
- For readers who know how to compute a gradient and want to understand how training software turns it into a parameter update.适合已经会求梯度,想弄懂训练程序究竟如何更新参数的读者。
- Before you begin已有基础
- Partial derivatives, vector inner products and matrix multiplication. Part 5 also uses singular values.用到偏导数、向量内积与矩阵乘法。第 5 期还会用到奇异值。
- What you can explain读完能解释什么
- Calculate a step by hand, identify what information each optimizer retains, and compare training runs at the same validation target and tuning budget.能手算一次更新,指出每种方法保存了哪些信息,也能在相同验证目标与调参预算下比较训练结果。
- PART 01第 1 期 ·
Gradient descent and momentum in a narrow valley梯度下降与动量:为什么陡的方向限制了平的方向?
A two-dimensional quadratic lets us derive the stability interval for gradient descent, see how momentum changes the roots of the error recurrence, and calculate the residual variance introduced by noisy gradients.从一个二维二次函数推导梯度下降的稳定区间,追踪重球法与 Nesterov 加速怎样改变误差递推,再算出随机梯度带来的残余波动。
- PART 02第 2 期 ·
From AdaGrad to AdamW: what sets each coordinate’s step?从 AdaGrad 到 AdamW:每个坐标该走多远?
A diagonal metric turns gradient history into coordinate-wise step sizes. Follow one update through AdaGrad, RMSProp and Adam, then isolate the effect of weight decay with a zero-gradient experiment.从带权距离推导逐坐标步长,跟踪 AdaGrad、RMSProp 与 Adam 如何保存梯度历史,再以零数据梯度的算例区分 L₂ 正则与 AdamW 权重衰减。
- PART 03第 3 期 ·
Why does Lion keep only the sign?Lion 为什么只取更新方向的符号?
Derive the sign step from a bound on each coordinate, trace the two uses of one momentum buffer, and calculate when a step sends the loss uphill.从逐坐标的位移上限推导符号步,追踪 Lion 的一份动量怎样决定两次不同的加权,再用二次函数检验这一步何时会越过谷底。
- PART 04第 4 期 ·
How does Sophia use curvature to size a step?Sophia 怎样用曲率决定步长?
A bounded quadratic model explains Sophia’s clipped update. Derive the rule, compare its two curvature estimators and translate step counts into elapsed time.从有边界的二次近似推导 Sophia 的逐坐标截断,分别追踪 Sophia-H 与 Sophia-G 分母的来源,再核算一次曲率估计的代价。
- PART 05第 5 期 ·
How matrix optimizers choose a direction矩阵优化器怎样决定一步的方向
A two-by-two gradient explains Shampoo’s two-sided preconditioning, SOAP’s rotated coordinates and Muon’s spectral-norm step. Language-model studies from 2024–2026 show how these choices affect training cost.从一个 2×2 梯度矩阵出发,推导 Shampoo 的双边预条件、SOAP 的旋转坐标与 Muon 的谱范数约束,再核对 2024–2026 年语言模型实验中的收益与代价。
- PART 06第 6 期 ·
What makes an optimizer faster?怎样判断一个优化器真的更快?
Rotating a quadratic by 45 degrees turns a one-step solution into a hundred-step problem for diagonal scaling. A worked example and training studies explain how to compare optimizers on data, time and memory.同一个二次函数,为什么转过 45° 就会从一步走完变成需要上百步?从坐标变换和参数平均出发,结合 2022–2026 年的研究,比较达到同一验证目标所需的样本、时间与显存。