On Surprising Effectiveness of Masking Updates in Adaptive Optimizers
Taejong Joo, Wenhan Xia, Cheolmin Kim, Ming Zhang, Eugene Ie
TL;DR
The paper addresses the reliance on dense adaptive optimizers in large-language-model (LLM) training by proposing structured stochastic update masking. It introduces SkipUpdate, a block-wise Bernoulli masking scheme that preserves unbiased updates and induces a curvature-dependent regularizer in the expected loss, as well as Magma, a momentum-aligned masking wrapper that modulates masked updates per block using per-block momentum-gradient alignment with $s_t^{(b)} = \mathrm{sigmoid}( \mathrm{cos\,similarity}(\mu_t^{(b)}, g_t^{(b)})/\tau )$. The authors provide a theoretical descent analysis showing how the masking term adds a curvature-weighted penalty and demonstrate empirically that Magma yields consistent gains across Llama 2 pre-training on C4, Nano MoE pre-training, and controlled benchmarks with heavy-tailed noise and heterogeneous Hessians; notably, 1B-parameter perplexities improve substantially, with RMSProp+Magma achieving the best results. Practically, Magma is a drop-in wrapper with negligible overhead that scales advantageously with model size, offering a new direction for optimization algorithms that leverage structured stochasticity to stabilize training and improve generalization in ill-conditioned transformer landscapes.
Abstract
Training large language models (LLMs) relies almost exclusively on dense adaptive optimizers with increasingly sophisticated preconditioners. We challenge this by showing that randomly masking parameter updates can be highly effective, with a masked variant of RMSProp consistently outperforming recent state-of-the-art optimizers. Our analysis reveals that the random masking induces a curvature-dependent geometric regularization that smooths the optimization trajectory. Motivated by this finding, we introduce Momentum-aligned gradient masking (Magma), which modulates the masked updates using momentum-gradient alignment. Extensive LLM pre-training experiments show that Magma is a simple drop-in replacement for adaptive optimizers with consistent gains and negligible computational overhead. Notably, for the 1B model size, Magma reduces perplexity by over 19\% and 9\% compared to Adam and Muon, respectively.
