arXiv:2609.11867cs.LGSep 2026

Manuscript Offprint

arXiv:2609.11867

AdamX: Cosine similarity meets gradient descent

Francisco Caldas, Ruben Belo, Cláudia Soares

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Francisco Caldas 1^{1}[0000-0001-5090-0216], Ruben Belo 1^{1}[0009-0006-8516-7732], and Cláudia Soares 1^{1}[0000-0003-3071-6627]

NOVA School of Science of Technology

Universidade Nova de Lisboa, Caparica, Portugal

f.caldas@campus.fct.unl.pt

Abstract. We introduce AdamX, a first-order optimizer that incorporates cosine similarity as an adaptive mechanism for controlling update magnitudes. The proposed method is scalable, model-agnostic, and straightforward to integrate into existing training pipelines. We further introduce a variance rectification scheme that promotes smoother optimization during the early stages of training. Overall, we provide empirical evidence that AdamX achieves competitive convergence rates across a range of benchmark datasets and architectures. Performance is evaluated in terms of the number of epochs required to reach predefined performance thresholds under a fixed hyperparameter budget. Code and Experiments available at: https://github.com/FranciscoCaldas/adamX

Keywords: First Order Optimizer · Online Convex Optimization · Cosine Similarity.

1 Introduction

Gradient-based optimization is central to modern machine learning, where model training requires minimizing high-dimensional and generally non-convex objectives. While stochastic gradient descent (SGD) remains a foundational approach [4][4], adaptive first-order methods have become widely used because they adjust update magnitudes according to observed gradient statistics. Prominent examples include AdaGrad [8][8], RMSProp [1][1], and Adam [12][12].

Adam combines exponential moving averages of the gradient and its coordinate-wise squared magnitude to produce momentum-based, adaptively normalized updates [12][12]. This combination has made Adam a practical default for many deep learning tasks, as it often provides stable training behavior with limited task-specific tuning. However, its adaptive normalization can also lead to problematic update dynamics and, in some settings, a failure to converge [15][15].

Existing Adam-type methods primarily improve the treatment of magnitude information in the optimization trajectory. AMSGrad enforces a monotone second-moment envelope to recover convergence guarantees in online convex optimization [15][15]; AdamW decouples weight decay from adaptive updates [14][14]; RAdam addresses instability in the early variance estimate [13][13]; and AdaBelief modifies the second-moment statistic to reflect deviation from the predicted

F. Caldas et al.

gradient direction [23]. More recent optimizers, such as Lion [5] and Muon [11], further reconsider the form of the update rule or its preconditioning structure. Despite these developments, the alignment between successive gradients remains comparatively underused as a direct mechanism for modulating update magnitudes.

Directional alignment provides a computationally inexpensive signal for adapting update magnitudes. Consecutive gradients that point in similar directions indicate locally consistent optimization progress, whereas poorly aligned or opposing gradients may indicate oscillation or rapidly changing trajectory information. Cosine similarity captures this signal independently of gradient scale. Closely related to this motivation, GALA [10] adapts the learning rate using consecutive-gradient alignment together with a local curvature estimate, formulated through a one-dimensional online learning problem. AdamX instead incorporates alignment through a bounded multiplicative cosine controller within an Adam/AMSGrad-style coordinate-wise adaptive update. This design preserves the practical structure of adaptive moment methods while explicitly exploiting directional consistency.

Second-order and preconditioned optimization methods also exploit geometric information to improve training dynamics. Methods such as Shampoo and SOAP construct richer approximations to curvature or preconditioning structure, and can improve optimization performance in large-scale learning problems [9,20][9,20]. In contrast, our objective is to investigate whether a lightweight scalar signal derived from consecutive gradient directions can provide useful geometric adaptivity while retaining the implementation simplicity and scalability of first-order Adam-type methods.

Our contributions are threefold. First, we introduce AdamX, an adaptive first-order optimizer that integrates a bounded cosine-similarity controller into an Adam-style moment-normalized update with a monotone second-moment envelope. Second, we provide an OCO analysis of a simplified momentum-free AdamX variant, showing that a bounded cosine controller can be incorporated into an adaptive projected-gradient scheme without worsening the standard convex regret rate. Third, we evaluate AdamX across benchmark datasets and architectures, with default settings, measuring the number of epochs required to reach predefined test-performance thresholds.