Papers
Topics
Authors
Recent
Search
2000 character limit reached

Momentum Factorized SGD (MoFaSGD)

Updated 5 July 2026
  • MoFaSGD is a memory-efficient optimizer that replaces full momentum buffers with an online low-rank SVD approximation of the first moment.
  • It projects new gradients onto the tangent space of the current low-rank momentum, achieving spectrally normalized updates without full-matrix SVDs.
  • Empirical results show significant GPU memory savings and competitive performance compared to AdamW and other low-rank techniques in fine-tuning large models.

Momentum Factorized SGD (MoFaSGD) is a memory-efficient first-order optimizer for large-scale fine-tuning that replaces full momentum buffers with a dynamically maintained low-rank singular value decomposition (SVD) of the first moment and uses the normalized singular directions of that low-rank momentum for parameter updates. It was introduced in "Low-rank Momentum Factorization for Memory Efficient Training" (Mahdavinia et al., 10 Jul 2025) for the regime in which optimizer-state memory, especially the first and second moments of AdamW, dominates GPU memory during fine-tuning. The method targets the trade-off between full-parameter optimization and low memory usage by maintaining an adaptive low-rank approximation to the exponential moving average of gradients, rather than restricting training to fixed low-rank adapters or periodically recomputing gradient subspaces by expensive full-matrix SVDs.

1. Definition and problem setting

MoFaSGD is formulated for matrix parameters WRm×nW \in \mathbb{R}^{m\times n}. In the full-momentum baseline, the first moment is

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,

where Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t), and vanilla momentum SGD would update Wt+1=WtηMtW_{t+1}=W_t-\eta M_t. MoFaSGD instead assumes that the exponential moving average of gradients is approximately low rank and maintains a rank-rr SVD approximation

M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,

with Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r, Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r, and diagonal Σt+1\Sigma_{t+1}. The rank rr is a user hyperparameter analogous to LoRA rank and controls optimizer-state size and approximation fidelity (Mahdavinia et al., 10 Jul 2025).

The motivation is specific to fine-tuning large foundation models. AdamW and similar adaptive optimizers maintain full-rank first and second moment buffers Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,0, so optimizer state is Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,1 per parameter matrix and often several times the inference memory. Existing alternatives in the source material fall into three classes: parameter-efficient fine-tuning such as LoRA, optimizer-state compression such as AdaFactor and SM3, and low-rank subspace methods such as GaLore, Flora, ReLoRA, LDAdam, and APOLLO. MoFaSGD is positioned against the limitations of fixed parameter subspaces, full-gradient SVD resampling, and subspace moment accumulation by treating the first moment itself as the low-rank object and updating its factorization online at every iteration.

2. Low-rank momentum representation and online update

The central computational problem is to update Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,2 without forming a full SVD of Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,3. MoFaSGD addresses this by projecting the new gradient onto the tangent space of the rank-Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,4 manifold at the previous low-rank momentum approximation. With current factors Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,5, the tangent-space projection is

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,6

Conceptually, the next low-rank momentum is obtained from

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,7

Because both Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,8 and Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,9 have rank at most Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)0, their sum has rank at most Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)1. The algorithm therefore avoids a full decomposition by computing Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)2, Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)3, and Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)4, then forming QR decompositions of the augmented subspaces

Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)5

and a small core matrix

Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)6

A rank-Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)7 SVD of this Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)8 matrix,

Gt=WL(Wt)G_t = \nabla_W \mathcal{L}(W_t)9

yields the updated factors

Wt+1=WtηMtW_{t+1}=W_t-\eta M_t0

The resulting per-layer complexity is

Wt+1=WtηMtW_{t+1}=W_t-\eta M_t1

coming from two QR decompositions of size Wt+1=WtηMtW_{t+1}=W_t-\eta M_t2 and Wt+1=WtηMtW_{t+1}=W_t-\eta M_t3 and an SVD of size Wt+1=WtηMtW_{t+1}=W_t-\eta M_t4. For Wt+1=WtηMtW_{t+1}=W_t-\eta M_t5, this replaces the expensive full-matrix SVDs required by methods that periodically resample a gradient-defined subspace (Mahdavinia et al., 10 Jul 2025).

3. Optimization geometry and spectrally normalized updates

A defining feature of MoFaSGD is that the parameter update is not the low-rank momentum itself. Once Wt+1=WtηMtW_{t+1}=W_t-\eta M_t6 has been computed, the update is

Wt+1=WtηMtW_{t+1}=W_t-\eta M_t7

Only the singular directions are used; the singular values Wt+1=WtηMtW_{t+1}=W_t-\eta M_t8 do not appear directly in the step. The source material describes this as using the normalized, spectrally whitened directions of the low-rank momentum and as a low-rank analogue of Muon/Shampoo-style gradient whitening (Mahdavinia et al., 10 Jul 2025).

This design gives MoFaSGD two coupled interpretations. First, the factors Wt+1=WtηMtW_{t+1}=W_t-\eta M_t9 and rr0 define an implicitly evolving optimization subspace. Unlike GaLore, which defines a projection matrix from the current gradient and resamples it every rr1 steps, MoFaSGD updates its subspace every iteration through the momentum SVD itself. The subspace is therefore momentum-defined, online, and smooth. Second, the update rr2 is the polar or sign factor of the low-rank momentum restricted to rank rr3, so the method substitutes directional structure for explicit second-moment accumulation.

This distinction resolves a common confusion. MoFaSGD is neither a fixed-subspace parameter-efficient method nor a straightforward low-rank version of vanilla momentum descent. It does not freeze base weights as LoRA does, and it does not use rr4. Its state is a low-rank factorization of the first moment, while its step is a spectrally normalized rank-rr5 direction extracted from that factorization.

4. Memory, computational profile, and empirical performance

For a single matrix rr6 with rr7, the source material gives the following memory and subspace-update costs.

Method Memory Subspace update
GaLore rr8 full SVD of gradient, rr9
LoRA M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,0 No subspace resampling
MoFaSGD M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,1 online, M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,2

The optimizer-state reduction is substantial because MoFaSGD stores M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,3, M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,4, and M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,5, with no second-moment buffer. For LLaMA-3.1-8B fine-tuning in bf16 with no checkpointing, batch size M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,6, and gradient accumulation M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,7, the reported total memory is approximately M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,8 GB for AdamW, M^tUt+1Σt+1Vt+1i=1tβtiGi,\hat M_t \triangleq U_{t+1}\Sigma_{t+1}V_{t+1}^\top \approx \sum_{i=1}^t \beta^{t-i} G_i,9 GB for MoFaSGD with rank Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r0, Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r1 GB for LoRA with rank Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r2, Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r3 GB for fused GaLore with rank Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r4, and Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r5 GB for a stateless SWAN-like baseline. The MoFaSGD breakdown is Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r6 GB parameters, Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r7 GB optimizer, Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r8 GB gradients, and Ut+1Ut+1=IrU_{t+1}^\top U_{t+1}=I_r9 GB activations (Mahdavinia et al., 10 Jul 2025).

Empirical evaluation was reported on three settings. In modded NanoGPT pre-training on a FineWeb subset, MoFaSGD consistently outperformed GaLore across ranks Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r0, with smoother convergence and better perplexity, while still trailing full-rank Muon and AdamW. In GLUE fine-tuning with RoBERTa-Base, average accuracy across seven tasks was Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r1 for full-rank AdamW, Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r2 for GaLore Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r3, Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r4 for LoRA Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r5, and Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r6 for MoFaSGD Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r7; at rank Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r8, the corresponding numbers were Vt+1Vt+1=IrV_{t+1}^\top V_{t+1}=I_r9, Σt+1\Sigma_{t+1}0, and Σt+1\Sigma_{t+1}1 for GaLore, LoRA, and MoFaSGD. In Tulu-3 instruction tuning with LLaMA-3.1 8B and rank Σt+1\Sigma_{t+1}2, the average score over MMLU, TruthfulQA, BigBenchHard, GSM8K, and HumanEval was Σt+1\Sigma_{t+1}3 for AdamW, Σt+1\Sigma_{t+1}4 for LoRA, Σt+1\Sigma_{t+1}5 for GaLore, and Σt+1\Sigma_{t+1}6 for MoFaSGD. Reported throughput on that setup was approximately Σt+1\Sigma_{t+1}7 tokens/sec for MoFaSGD, Σt+1\Sigma_{t+1}8 for GaLore, and Σt+1\Sigma_{t+1}9 for LoRA. A momentum spectral analysis on Tulu-3 with AdamW further indicated that the top-rr0 singular values of the first moment contain approximately rr1 of Frobenius energy, and the top-rr2 contain approximately rr3, which empirically supports low-rank first-moment factorization.

5. Theoretical guarantees

The convergence analysis is stated for the non-convex stochastic matrix optimization problem

rr4

The assumptions are: rr5 is rr6-smooth with respect to the nuclear norm,

rr7

the stochastic gradient oracle is unbiased with

rr8

and the initialization satisfies rr9 (Mahdavinia et al., 10 Jul 2025).

Two theoretical results are emphasized. The first is an optimality property of the tangent projection. For projection operators of the form

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,00

the Frobenius residual is minimized when Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,01 and Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,02, yielding exactly the tangent projection

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,03

or, equivalently,

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,04

This establishes that the online projection used in MoFaSGD is optimal within the specified family.

The second is the convergence theorem. Under A1-A2, Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,05, and Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,06, the iterates satisfy

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,07

Choosing

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,08

yields

Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,09

which matches the optimal Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,10 rate for non-convex stochastic optimization. The proof decomposes the discrepancy between the true full-rank momentum Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,11 and the low-rank approximation Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,12 into temporal error Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,13 and compression error Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,14, and then bounds the latter recursively through the tangent projection residual.

The term “momentum factorization” has a broader surrounding literature than the 2025 optimizer itself. In "Compressing gradients by exploiting temporal correlation in momentum-SGD" (Adikari et al., 2021), the paper does not use MoFaSGD as its method name, but it explicitly describes a hypothetical “Momentum Factorized SGD (MoFaSGD)” that would exploit the low-pass-filtering effect of momentum and represent the update as a predictable, low-frequency component plus a small residual. In that setting, the factorization is temporal and communication-oriented: predictive coding factorizes the momentum trajectory into a history-based predictor and a compressed residual. A separate communication-centered perspective appears in "Communication-Efficient Distributed Blockwise Momentum SGD with Error-Feedback" (Zheng et al., 2019), where momentum-based updates are represented blockwise as sign plus scale with error-feedback, yielding nearly Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,15 communication reduction. "Accelerating Single-Pass SGD for Generalized Linear Prediction" (Chen et al., 2 Mar 2026) does not define MoFaSGD, but it presents dual-momentum operator factorization and a decomposition of excess risk into optimization, statistical, and model-misspecification terms as relevant design principles for momentum-factorized methods. "Effects of momentum scaling for SGD" (Pasechnyuk et al., 2022) studies momentum-updated preconditioners and emphasizes the role of the momentum coefficient Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,16, which is directly relevant because practical MoFaSGD runs use momentum decay values around Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,17–Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,18 even though the current proof assumes Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,19.

Several misconceptions are addressed directly by the source material. MoFaSGD is not a parameter-efficient fine-tuning method of the LoRA type; it makes no architectural change and leaves the base model fully trainable. It is not identical to GaLore-style gradient projection, because its low-rank object is the first moment rather than the current gradient, and its subspace evolves online rather than through periodic offline SVD resampling. It is also not simply low-rank momentum descent, because the update uses the spectrally normalized factor Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,20, not the low-rank momentum Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,21.

The limitations are equally explicit. Performance remains below full-rank AdamW and Muon on the largest instruction-tuning benchmarks. Very low ranks can under-approximate the momentum, slowing convergence or degrading final quality. Although the per-step cost is modest for small Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,22, the Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,23 term grows with rank. The theory uses nuclear-norm smoothness and Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,24, which do not match the practical regime exactly. Current implementations apply MoFaSGD primarily to Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,25D linear layers of transformer blocks, while embeddings and Mt=βMt1+(1β)Gt,M0=0,M_t = \beta M_{t-1} + (1-\beta)G_t,\qquad M_0=0,26D parameters are optimized with AdamW in bf16. This suggests that MoFaSGD is best understood as a low-rank, memory-efficient variant of spectral momentum normalization with strong empirical trade-offs under tight GPU-memory budgets, rather than as a universal replacement for full-rank optimizers.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Momentum Factorized SGD (MoFaSGD).