TL;DR
MKOR (Momentum-Enabled Kronecker-Factor-Based Optimizer) is a new optimization framework that slashes the computational and communication overhead of second-order methods. By using rank-1 updates and the Sherman-Morrison identity, it reduces complexity from cubic to quadratic, enabling training speedups of up to 2.57× over standard optimizers like LAMB for large-scale models like BERT.
What Problem Does This Paper Address?
In the world of deep learning, first-order optimizers like SGD, Adam, and LAMB are the workhorses. They are computationally "cheap" but often require many iterations to converge because they only look at the gradient's slope.
Second-order methods (like Natural Gradient Descent) are theoretically superior because they look at the "curvature" of the loss landscape, allowing them to take much smarter, larger steps toward the optimum. However, they have a massive catch: they require computing and inverting large matrices (the Hessian or Fisher Information Matrix). For a layer with dimension $d$, this inversion usually costs $O(d^3)$—a death sentence for scalability in the era of Large Language Models (LLMs). Furthermore, synchronizing these large matrices across multiple GPUs creates a communication bottleneck ($O(d^2)$).
The authors aim to bridge this gap, making the fast convergence of second-order methods practical for massive Transformer models.
Methods
The core innovation of MKOR lies in how it approximates and updates the inverse of the curvature information:
- Rank-1 Approximations: Instead of computing full covariance matrices for every batch, MKOR uses a rank-1 approximation based on the average of samples.
- Sherman-Morrison (SM) Based Inversion: This is the mathematical "cheat code." Because the update is rank-1, the authors use the Sherman-Morrison identity to update the inverse of the matrix directly. This transforms a cubic $O(d^3)$ matrix inversion into a quadratic $O(d^2)$ matrix-vector multiplication.
- Linear Communication: Because only rank-1 vectors need to be synchronized across workers, communication costs drop from $O(d^2)$ to $O(d)$.
- Momentum Integration: Unlike previous low-rank attempts, MKOR successfully integrates momentum into the Kronecker factors, which is vital for stable training in deep networks.
- MKOR-H (Hybrid): The authors observed that second-order gains are highest early in training. MKOR-H automatically switches to a first-order optimizer (like LAMB) once the curvature updates no longer provide a significant "boost," saving even more time.
- Stability Mechanisms: To prevent the "exploding gradient" issues common in second-order methods, MKOR includes a norm-based stabilizer and a gradient rescaling mechanism.
Datasets
The authors evaluated MKOR across a variety of standard benchmarks to prove its versatility:
- BERT-Large-Uncased: Pre-trained on English Wikipedia and the Toronto BookCorpus.
- SQuAD v1.1: For fine-tuning on question-answering tasks.
- GLUE Benchmark: A suite of nine diverse natural language understanding tasks.
- ImageNet: Used with ResNet-50 to test performance on computer vision.
- CIFAR-100: Used with AlexNet for smaller-scale validation.
Key Insights and Ideas
- Curvature is Low-Rank: A major "aha moment" is the empirical evidence that covariance matrices in deep learning are often low-rank. This justifies using rank-1 updates without losing the essential "shape" of the loss landscape.
- Freshness Over Precision: Because MKOR is so computationally cheap, it can update its second-order information much more frequently (e.g., every 10 iterations) than traditional KFAC (which might wait 100–1000 iterations). "Fresher" approximate info turns out to be better than "stale" exact info.
- FP16 Compatibility: Most second-order methods are numerically unstable with half-precision (FP16) math. MKOR’s simpler scalar divisions make it robust enough to use FP16, further doubling the communication speed.
Key Results
The results on BERT-Large-Uncased using 64 A100 GPUs are particularly striking:
- Speedup: MKOR-H achieved a 2.57× speedup over the LAMB optimizer and a 1.85× speedup over KAISA (a state-of-the-art KFAC implementation).
- Training Time: It reduced the training time for BERT-Large from roughly 8 hours down to 3 hours.
- Convergence: On the GLUE dataset, MKOR achieved new state-of-the-art metrics, whereas other second-order methods like KFAC sometimes failed to reach the baseline accuracy.
- Scalability: MKOR showed near-linear scaling up to 64 GPUs, proving that its reduced communication complexity works in practice.
Limitations and Future Work
- Memory Overhead: While MKOR is more efficient than KFAC, it still requires storing the inverse factors ($O(d^2)$), which is more memory-intensive than simple first-order methods ($O(d)$).
- Higher-Rank Potential: The authors mention that while rank-1 works well, extending this to "rank-$r$" updates (using SVD) could potentially capture even more curvature info, though it currently introduces too much overhead to be worth it.
- Switching Heuristics: The hybrid version (MKOR-H) relies on a loss-reduction-rate heuristic to decide when to switch to first-order. The authors suggest that more sophisticated, automated switching logic could be a fruitful area for future research.
Summary updated