TL;DR
Classical momentum accelerates optimization but can become erratic when facing large, misaligned ("torqued") gradients in noisy loss landscapes. Torque-Aware Momentum (TAM) addresses this by applying an anisotropic damping factor based on the cosine similarity between the current gradient and the accumulated momentum. Compatible with both SGD and Adam (as AdaTAM), it smooths out updates, mitigates oscillations, and improves generalization across computer vision benchmarks, LLM fine-tuning, and non-stationary online learning setups.
What Problem Does This Paper Address?
Stochastic Gradient Descent with Momentum (SGDM) accelerates optimization across flat valleys and dampens stochastic noise. However, on highly non-convex and noisy loss surfaces—such as narrow ravines or abrupt curvature changes—successive gradients can drastically disagree with the accumulated momentum vector.
Standard momentum treats these misaligned or opposing gradients with standard linear addition. When a large gradient suddenly points in a conflicting direction ("torqued gradient"), it causes abrupt trajectory shifts, violent oscillations, and early convergence into sharp, sub-optimal minima. While prior work has explored angle-based damping between consecutive gradients (e.g., AngularGrad), aligning gradients with the running momentum vector is far more critical for stability.
Methods
TAM introduces a mechanical damping analogy: momentum acts as linear velocity, the gradient acts as applied force, and misaligned gradients act as rotational torque. To counteract this torque, TAM modulates the gradient's contribution before adding it to the momentum buffer:
- Cosine Alignment ($S_t$): Measure the directional alignment between the current gradient $g_t$ and the previous momentum $m_{t-1}$: $$S_t = \frac{m_{t-1} \cdot g_t}{\|m_{t-1}\| \|g_t\|}$$
- Exponential Smoothing ($\hat{s}_t$): Smooth the correlation over time to mitigate mini-batch noise: $$\hat{s}_t = \gamma \hat{s}_{t-1} + (1 - \gamma) S_t$$
- Damping Factor ($d_t$) and Momentum Update: Rescale the correlation to $[0, 1]$ and damp conflicting gradients: $$d_t = \frac{1 + \hat{s}_t}{2}, \quad m_t = \beta m_{t-1} + (\epsilon + d_t) g_t$$ (Default hyperparameters are fixed to $\gamma = 0.9$ and $\epsilon = 10^{-8}$, requiring no extra tuning).
- AdaTAM: TAM seamlessly integrates into Adam by updating the first-moment vector $m_t$ with TAM's damping rule while keeping second-moment updates $v_t$ unchanged.
- Learning Rate Transfer: The authors prove that because $\hat{s}_t$ naturally stabilizes to $s^* \approx 0$ near optima, TAM's effective learning rate is $\eta_{\text{TAM}}^{\text{eff}} \approx \frac{1 + s^*}{2(1 - \beta)}\eta$. Under standard settings ($\beta_{\text{TAM}} = \beta_{\text{SGDM}}$), optimal learning rates transfer simply as: $$\eta_{\text{TAM}}^* = 2\eta_{\text{SGDM}}^*$$
Datasets
The authors evaluated TAM across diverse tasks and benchmarks:
- Image Classification: CIFAR-10, CIFAR-100, SVHN, and ImageNet.
- LLM Fine-Tuning: Masked language modeling on WikiText-103, evaluated across 56 datasets spanning 7 core tasks in the MTEB (Massive Text Embedding Benchmark).
- Online Learning: CIFAR-10 under varying degrees of label-flipping distribution shifts ($\delta \in \{40\%, 80\%, 100\%\}$).
- Continual Learning: The CLEAR benchmark (10 sequential image recognition experiences).
- Link Prediction / GNNs: MovieLens benchmark using Graph Neural Networks.
Key Insights and Ideas
- Deferring Abrupt Sharpening: When tracking gradient norms across training epochs, standard SGDM exhibits a sudden spike in gradient norm early on (oscillations in sharp curvature). TAM defers this abrupt jump by 5–10 epochs, allowing extended exploration of flatter regions before settling.
- Lower Loss Barriers: Linear mode connectivity tests reveal that models initialized or warmed up with TAM navigate to wider loss basins with significantly lower interpolation loss barriers between independent runs.
- Robustness Under Extreme Distribution Shifts: In online task sequences with abrupt 80% to 100% label switches, standard SGDM degrades sharply due to massive conflicting gradients. TAM actively suppresses these opposing gradients, allowing smoother adaptation and preserving model plasticity.
- Warm-up Utility: Using TAM for just the first 25–50 epochs before switching to SGDM or Adam achieves superior generalization and lower validation RMSE than training end-to-end with Adam or SGDM alone.
Key Results
- Computer Vision: TAM improves validation accuracy across ResNet architectures:
- ResNet18 on CIFAR-10: 94.2% vs. 93.6% (SGDM).
- ResNet18 on CIFAR-100: 73.8% vs. 73.2% (SGDM).
- ResNet50 on ImageNet: 77.1% vs. 77.0% (SGDM).
- ViT Fine-tuning on CIFAR-100: 86.2% vs. 85.3% (SGDM).
- LLM Fine-Tuning (MTEB): AdaTAMW outperforms or matches AdamW in the majority of evaluated configurations (e.g., DeBERTa-large matched or beat AdamW on 93% of datasets at 3 epochs, and 73% at 5 epochs).
- Online & Continual Learning: On CLEAR, ResNet-50 trained with TAM consistently surpassed SGDM across all 10 sequential experiences (e.g., reaching 95.9% final accuracy vs. 93.7% for SGDM in the naive setup).
- Computational Overhead: TAM requires only a single vector inner product per step, resulting in identical memory consumption to SGDM and just a 1.12× runtime overhead compared to AdamW.
Limitations and Future Work
- Performance Plateaus on Specific Architectures: On certain setups (e.g., ResNet-34 on CIFAR-100, and RoBERTa-large on MTEB), AdaTAM/TAM yielded slightly lower or less consistent gains compared to baseline optimizers.
- Continual Learning Scope: While preliminary experiments on CLEAR and online label flipping are promising, full evaluations under complex class-incremental or reinforcement learning scenarios were left for future research.
- Broader Optimization Paradigms: The authors note that investigating TAM within large-scale self-supervised pre-training and deep reinforcement learning (where policy gradient misalignment is frequent) remains an open opportunity.
Summary updated