Addax: Utilizing Zeroth-Order Gradients to Improve Memory Efficiency and Performance of SGD for Fine-Tuning Language Models

## Abstract

Abstract Fine-tuning language models (LMs) with the standard Adam optimizer often demands excessive memory, limiting accessibility. The “in-place” version of Stochastic Gradient Descent (IP-SGD) and Memory-Efficient Zeroth-order Optimizer (MeZO) have been proposed as solutions to improve memory efficiency. However, IP-SGD still requires a substantial amount of memory, and MeZO suffers from slow convergence and degraded final performance due to its zeroth-order nature. This paper introduces Addax , a novel method that improves both memory efficiency and algorithm performance of IP-SGD by integrating it with MeZO. Specifically, Addax computes the zeroth- or first-order gradient of the data points in the minibatch based on their memory consumption and combines zeroth- and first-order gradient estimates to obtain the updated direction in each step.
By computing the zeroth-order gradient of data points that require more memory and the first-order gradient of the ones that require less memory, Addax overcomes the slow convergence of MeZO and the excessive memory requirement of IP-SGD. Additionally, the zeroth-order gradient acts as a regularizer for the first-order gradient, further enhancing the model’s final performance.
Theoretically, we establish the convergence of Addax under mild assumptions, demonstrating faster convergence and less restrictive hyper-parameter choices than MeZO. Our extensive experiments with diverse LMs and tasks show that Addax consistently outperforms MeZO in terms of accuracy and convergence speed while having a comparable memory footprint.
In particular, our experiments using one A100 GPU on the OPT-13B model reveal that, on average, Addax outperforms MeZO in terms of accuracy/F1 score by 14 % percent 14 14\% 14 % and runs 15 × 15\times 15 × faster while having a comparable memory footprint to MeZO. In our experiments on the larger OPT-30B model, on average, Addax outperforms MeZO in terms of accuracy/F1 score by > 16 % absent percent 16 >16\% > 16 % and runs 30 × 30\times 30 × faster on a single H100 GPU. Moreover, Addax surpasses the performance of standard fine-tuning approaches, such as IP-SGD and Adam, in most tasks in terms of accuracy/F1 score with significantly less memory requirement.

## 1 Introduction

Fine-tuning pre-trained language models (LMs) is a crucial step in a wide range of natural language processing tasks, including text classification and sentiment analysis [], as well as their use in different domains [, , ]. However, standard fine-tuning approaches (with the Adam optimizer) demand excessive memory requirement due to gradient and/or the optimizer state storage, presenting a challenge as LMs grow in scale [, ]. For instance, fine-tuning a 13-billion-parameter model like OPT [] in mixed precision requires over 316 GB of memory, hindering accessibility for researchers and practitioners with limited resources and specialized hardware.

Recently, various memory-efficient methods for fine-tuning LMs have been proposed. In-context learning (ICL) utilizes a single inference pass, incorporating label examples in its context for prediction []. Despite its limited success, ICL’s performance is shown to be less effective than (Adam) fine-tuning for medium-sized LMs []. As an alternative approach, Parameter-Efficient Fine-Tuning (PEFT) tunes a fraction of the network while freezing the rest of the parameters and significantly reduces the parameters needed for fine-tuning [, , ]. Despite its efficiency, fine-tuning LMs with PEFT may still require more memory than model inference. For example, fine-tuning OPT-13B with Adam with a batch size of $8$ requires $4\times$H100 GPUs (316GB total), whereas utilizing PEFT decreases this to $2\times$H100 GPUs (158GB total) with a batch size of $16$ []. Nonetheless, this requirement is still $6\times$ greater than the 25GB needed for model inference.

Another approach for memory-efficient fine-tuning is to lessen the memory footprint of the optimizer. Recently, the Memory-Efficient Zeroth-order Optimizer (MeZO) is proposed by Malladi et al. []. MeZO generates gradient estimators solely through forward passes with minimal memory overhead. Unlike the classical zeroth-order optimization method ZO-SGD [], MeZO allows in-place perturbation of model parameters to avoid storing the perturbation vector. One desirable property of MeZO (and in general approaches that reduce the memory overhead of the optimizers) is that it can be combined with other methods, such as PEFT. Moreover, Malladi et al. [] showed that the memory footprint of MeZO can be $12\times$ lower than Adam. While being memory efficient, MeZO suffers from 1) slow convergence rate compared to standard fine-tuning methods such as Adam; and 2) possible degradation of the performance (e.g. accuracy) of the fine-tuned model compared to Adam (see the experiments in [] and Table 12). Observing these drawbacks, it is natural to ask:

Question: Can we develop an optimizer for fine-tuning language models (LMs)
that requires significantly less memory than the standard Adam but still enjoys fast convergence and produces high-quality fine-tuned models?

In an effort to answer this question, we propose Addax (ADDition of grAdient estimates through memory-efficient eXecution), a method that: i) is memory efficient, ii) has fast convergence speed, and iii) achieves the best performance across a wide range of fine-tuning methods and tasks. Our specific contributions are as follows:

- 1.
Algorithm design. We develop Addax, a novel approach that cleverly assigns different batches of data to either MeZO or in-place SGD (IP-SGD) and combines the computed gradients. This strategic assignment of data points, based on input length, allows Addax to maintain a memory footprint comparable to MeZO while significantly improving performance. Specifically, Addax accelerates MeZO’s convergence rate and boosts the final model’s performance, effectively overcoming the limitations of zeroth-order optimization. Our design is driven by two novel observations: 1) computing gradients for different data points requires varying memory, and 2) integrating zeroth-order updates with first-order methods enhances the quality of the fine-tuned model.
- 2.
Theoretical analysis. Theoretically, we analyze Addax’s convergence under mild assumptions in two scenarios: with and without the data assignment procedure. Unlike MeZO, the convergence rate of Addax is independent of model size without requiring the assumption of low-rankness of the Hessian. Additionally, we show that the hyperparameters for Addax are less restrictive compared to those of MeZO.
- 3.
Numerical comparisons. We perform comprehensive experiments on a broad range of model architectures (e.g., masked LM and autoregressive LM), model scales ranging from 350M to 70B parameters, and tasks including classification, multiple-choice questions, and content generation. Compared to SGD and IP-SGD, Addax has a lower memory footprint and is on par with MeZO. Using a single A100 (40GB) GPU, Addax successfully fine-tunes the OPT-13B model on all nine tasks, while SGD fails on all tasks and IP-SGD fails on three due to memory limitations (see Figure 2). Addax surpasses MeZO by 14% in accuracy/F1 and converges $15\times$ faster on average, with a similar memory footprint. Furthermore, Addax outperforms Adam in seven out of nine tasks while reducing memory usage by up to $89\%$. When fine-tuning larger model like OPT-30B with a single H100 (80GB) GPU, Addax achieves superior performance over IP-SGD and MeZO on various tasks, e.g. test accuracy $16\%$ higher than MeZO, $4.8\%$ higher than IP-SGD when IP-SGD applicable (see Figure 2 and Table 1). Similar results are observed when fine-tuning Addax on OPT-66B and Llama-2-70B using three H100 (240GB total) GPUs (See Table 2 and  3).

Next, we will discuss preliminaries and will leave further discussions on prior work to Appendix C.

Figure: Figure 1: Accuracy/F-1 score, memory, and convergence time resulted from fine-tuning the OPT-13B model with various algorithms on one A100 (40GB) GPU, except for Adam, which runs on five GPUs. The label “OOM” means the run encounters an out-of-memory error during fine-tuning, even with the smallest batch size. Addax consistently outperforms other methods in terms of Accuracy, with GPU memory consumption comparable to MeZO. Except for Adam, all other methods are running in 16-bit mode. We do not report the time for Adam as it requires five GPUs. The exact numbers can be found in Table 12 in Appendix F.1.
Refer to caption: x1.png

## 2 Notations and Preliminaries

### 2.1 Notations

We are interested in optimizing the (smooth and possibly non-convex) loss function

$$ $\min_{\bm{\theta}\in\mathbb{R}^{d}}\bigg{(}\mathcal{L}(\bm{\theta}):=\mathbb{E }_{x\sim\mathcal{D}}\left[\ell(\bm{\theta};x)\right]\bigg{)},$ (1) $$

parameterized by $\bm{\theta}\in\mathbb{R}^{d}$, where $\mathcal{D}$ denotes the (fine-tuning) data distribution and $x$ denotes the (fine-tuning) data point.
Throughout, we mark the values related to zeroth- and first-order gradient with $(\cdot)^{0},(\cdot)^{1}$, respectively, and denote the iteration and coordinate indices as $(\cdot)_{t},(\cdot)_{i}$, where $t\in\{0,\dots,T\},i\in\{1,\dots,d\}$. In addition, we assume $\bm{\theta}$ parameterized an $M$-layer network, i.e., $\bm{\theta}=(\bm{\theta}_{1},\dots,\bm{\theta}_{M})$, where $\bm{\theta}_{m}\in\mathbb{R}^{d_{m}}$ and $\sum^{M}_{m=1}d_{m}=d$. The maximum sequence length in the dataset $\mathcal{D}$ is denoted by $L_{max}$. We slightly abuse the notation and denote the loss evaluated on a minibatch $\mathcal{B}$ as $\mathcal{L}(\bm{\theta};\mathcal{B})\triangleq\frac{1}{B}\sum_{x\in\mathcal{B}
}\ell(\bm{\theta};x)$.

### 2.2 Memory-Efficient Zeroth-order Optimizer

MeZO [] is a memory-efficient fine-tuning approach based on the zeroth-order stochastic gradient descent method (ZO-SGD). The update step of MeZO follows SGD, i.e., $\bm{\theta}_{t+1}=\bm{\theta}_{t}-\eta\widehat{\nabla}\mathcal{L}\left(\bm{
\theta}_{t};\mathcal{B}^{0}_{t}\right)$, with the key difference of using zeroth-order gradient $\widehat{\nabla}\mathcal{L}\left(\bm{\theta}_{t};\mathcal{B}^{0}_{t}\right)$ estimated on minibatch $\mathcal{B}^{0}_{t}$, instead of first-order gradient $\nabla\mathcal{L}\left(\bm{\theta}_{t};\mathcal{B}^{1}_{t}\right).$ The zeroth-order gradient is estimated using Simultaneous Perturbation Stochastic Approximation (SPSA, []):

$$ $\widehat{\nabla}\mathcal{L}(\bm{\theta};\mathcal{B})=\frac{\mathcal{L}(\bm{ \theta}+\epsilon\bm{z};\mathcal{B})-\mathcal{L}(\bm{\theta}-\epsilon\bm{z}; \mathcal{B})}{2\epsilon}\bm{z},$ (2) $$

where $\mathbf{z}$ is a random search direction, e.g., $\mathbf{z}\sim\mathcal{N}(\mathbf{0},\mathbf{I}).$
In ZO-SGD, SPSA requires generating and storing $\mathbf{z}\in\mathbb{R}^{d}$ multiple times during model perturbation, $\bm{\theta}+\epsilon\mathbf{z},\bm{\theta}-\epsilon\mathbf{z}$, which is memory inefficient. MeZO reduces memory consumption in the implementation of SPSA by only storing the random seed that generates $\mathbf{z}$, reducing memory consumption from $\mathcal{O}(d)$ to $\mathcal{O}(1)$.

However, due to the inherent bias and higher noise level in the zeroth-order gradient estimate [], MeZO suffers from slower convergence and worse final model performance compared to first-order methods, c.f. Malladi et al. [, Table 1], and the experiments in section 4.

### 2.3 Preliminaries and Major Observations

In this subsection, we provide the key observations behind the development of Addax:

SGD can match the performance of Adam in fine-tuning tasks.
Although Adam and AdamW [, ] have demonstrated better performance than SGD in training deep learning models from scratch, they require additional memory to store optimizer states, which is unfavorable in fine-tuning LMs. On the other hand, it has been observed that SGD achieves comparable performance to Adam in fine-tuning tasks
(see, e.g., Zhang et al. [] and []). This observation is also re-confirmed in our experiments showing that fine-tuning LMs using (16-bit) SGD can achieve comparable performance to fine-tuning with (32-bit) Adam. For example, in the right panel of Figure 3, in three fine-tuning tasks of RTE, CB, and COPA [], SGD leads to higher performance while requiring significantly less memory. The success of using SGD in fine-tuning LMs is attributed to the relative “nice” landscape of fine-tuning tasks of LMs [, ].

Figure: Figure 3: Left: Memory profile of fine-tuning OPT-13B with IP-SGD and MeZO on a synthetic dataset with a fixed sequence length of $300$. Right: Fine-tuning OPT-13B using IP-SGD and small batch sizes (BS) can outperform Adam while consuming significantly lower memory.
Refer to caption: x3.png

Memory-efficient implementation of SGD via “in-place” updates.
To reduce the memory footprint of SGD, several studies have explored the utilization of in-place (IP) updates during backward propagation [, ]. Instead of separating the backward propagation and weight update steps, which require storing the gradients for all layers, in-place SGD (IP-SGD) combines the two steps by updating the weights in each layer as soon as the gradients are computed and immediately discards the gradient after it has been used. In-place update avoids storing the gradients of the full model and, thus, significantly reduces the memory footprint of SGD.

Though improving over SGD, IP-SGD may still require more memory than MeZO. To compare the memory consumption of IP-SGD and MeZO, we record the memory consumption as a function of the batch size in the left panel of Figure 3. As illustrated in the figure, with a memory constraint of 30GB, we can use a batch size of 18 for running MeZO, while we can only use a batch size of 2 for running IP-SGD.

Figure: Figure 4: Memory profiling of SGD, IP-SGD, and MeZO on OPT-13B fine-tuning with synthetic datasets with varying sequence lengths (fixing batch size = 8).
Refer to caption: x6.png

Memory required for computing gradient depends on the input sequence length.

We observe that in fine-tuning LM models, the memory required for first-order gradient estimation depends on the maximum input sequence length (in tokens). In Figure 4, we record the memory consumption of SGD, IP-SGD, and MeZO with fixed batch size and varying input sequence length. As illustrated in the figure, the memory consumption of all algorithms increases as the input sequence length increases, and the memory increase of IP-SGD is much faster than MeZO. Given the fact that the input sequence lengths vary a lot in a given fine-tuning task across different data points (see Figure 6 in Appendix D), we conclude that the memory inefficiency of IP-SGD compared with MeZO mainly attributes to the data points with longer sequence length in the dataset.

With the above observations in hand, we discuss our algorithm, Addax, in the next section.

## 3 Addax

Building on the insights from Section 2, we propose Addax, a method that assigns data batches to either MeZO or IP-SGD based on memory needs and then combines their gradients. In memory-limited scenarios, Addax reduces memory usage by assigning shorter sequences to IP-SGD and longer ones to MeZO, leading to a similar convergence rate as IP-SGD, much faster than MeZO, while keeping a similar memory footprint, significantly less than IP-SGD. Furthermore, incorporating zeroth-order gradients with first-order gradients can enhance the final model performance. We first propose the Addax algorithm, provide its convergence properties, and finally discuss how incorporating the zeroth-order gradient benefits SGD in the final model performance.

### 3.1 Algorithm Overview

Addax starts by partitioning the dataset into data points with long/short sequence length, i.e., $\mathcal{D}=\mathcal{D}^{0}\cup\mathcal{D}^{1}$ where $\mathcal{D}^{0}=\{x\in\mathcal{D}\,|\,\textrm{length}(x)>L_{T}\}$ and $\mathcal{D}^{1}=\{x\in\mathcal{D}\,|\,\textrm{length}(x)\leq L_{T}\}$ for some given threshold hyper-parameter $L_{T}$, where $\textrm{length}(\cdot)$ measures the sequence length of a data point. As discussed in Section 2.3, computing gradients on data points in $\mathcal{D}^{1}$ requires much less memory than computing the gradients in $\mathcal{D}$ because the maximum input sequence length of $\mathcal{D}^{1}$ is capped by $L_{T}$, which is smaller than $L_{max}$. With this data partition, Addax computes the zeroth-order gradient on the data points with long sequence length in $\mathcal{D}^{0}$ while computing the first-order gradients for the data points with short sequence length in $\mathcal{D}^{1}$, resulting in a considerable memory reduction compared with IP-SGD. In particular, at each iteration of the algorithm, Addax draws a random batch $\mathcal{B}^{0}$ (with $|\mathcal{B}^{0}|=K^{0}$) of data points from $\mathcal{D}^{0}$ and a random search direction $\mathbf{z}\in\mathbb{R}^{d}$ with $\mathbb{E}[\mathbf{z}]=0$ and $\mathbb{E}[\mathbf{z}\mathbf{z}^{T}]=\mathbf{I}$. Then, using the drawn samples, it utilizes SPSA to estimate the directional derivative of the objective function in the direction $\mathbf{z}$ at the point $\bm{\theta}$ with a small perturbation size $\epsilon$:

$$ $g^{0}=\frac{1}{K^{0}}\sum_{x\in\mathcal{B}^{0}}\frac{\ell(\bm{\theta}+\epsilon \bm{z};x)-\ell(\bm{\theta}-\epsilon\bm{z};x)}{2\epsilon}.$ $$

Then, Addax draws a random batch $\mathcal{B}^{1}$ (with $|\mathcal{B}^{1}|=K^{1}$) of data from $\mathcal{B}^{0}$ and computes $\mathbf{g}^{1}=\frac{1}{K^{1}}\sum_{x\in\mathcal{B}^{1}}\nabla\ell(\bm{\theta}
;x).$ Finally, it updates the model parameters by:

$$ $\bm{\theta}\leftarrow\bm{\theta}-\eta\left(\alpha\mathbf{z}g^{0}+(1-\alpha) \mathbf{g}^{1}\right),$ (3) $$

where $\eta$ is the learning rate and $\alpha\in[0,1]$ is a mixing constant for combining the two gradient estimates. If one naïvely implements the update rule in equation (3), it needs to store the gradient $\mathbf{g}^{1}$ and the direction $\mathbf{z}$. However, as discussed in Section 2,
one can perform the update rule in equation (3) in-place, without storing the values of $\mathbf{g}^{1}$ or $\mathbf{z}$. Such a memory-efficient implementation of Addax is described in Algorithm 1. We leave further detailed discussions on this algorithm to Appendix A.

Addax without data assignment (Addax-WA). When sufficient memory is available to perform IP-SGD, one might argue that there is no need to use zeroth-order gradients. However, as demonstrated in our extensive experiments (see Figure 5 and Fine-tuning results for datasets SST-2, RTE, WSC of Addax ($L_{T}=320$) in Table 13),
incorporating zeroth-order gradients still results in better final accuracy for the fine-tuned model. Therefore, even when memory constraints are not a concern, we continue to utilize zeroth-order gradients by randomly selecting a data batch and combining its zeroth-order gradient with IP-SGD. This is achieved by setting $\mathcal{D}^{0}\leftarrow\mathcal{D}$ and $\mathcal{D}^{1}\leftarrow\mathcal{D}$ in step 3 of Algorithm 1. This version of the algorithm is referred to as Addax-WA.

Having introduced Addax, we would like to comment on a recent related work. Concurrently with our work, Zhang et al. [] propose a “hybrid ZO-FO” fine-tuning scheme for LLMs, which also integrates zeroth- and first-order gradient estimates.
However, their method differs significantly from ours. They limit backpropagation to the deeper layers and use zeroth-order optimization in the shallower layers. This approach prevents them from taking advantage of the memory savings offered by in-place update rules and does not harness the benefits of zeroth-order methods for improving the final model accuracy. In contrast, our approach utilizes in-place update rules, ensuring that memory usage does not scale significantly with model size and removing the need to limit backpropagation to specific layers. Furthermore, we allocate data to optimizers differently, leading to additional major memory savings.

Figure: Algorithm 1 Addax: ADDition of grAdient estimates through memory-efficient eXecution

### 3.2 Theoretical Analysis

Depending on whether step 3 or step 5 is executed in Algorithm 1, the algorithm follows two distinct trajectories. We analyze each case separately. We begin by discussing the convergence result of Addax when step 3 is applied, i.e., the Addax-WA algorithm. We provide only the informal version of the results, while the formal theorems can be found in Appendix G. We start by presenting the convergence of Addax in the general nonconvex setting:

###### Theorem 3.1 (Informal) .

Assume that the loss $\ell$ is Lipschitz smooth, and the first-order stochastic gradient is unbiased and has bounded variance. Choosing $\eta_{t}=\eta=\mathcal{O}(d^{-1/2}T^{-1/2})$ and $\epsilon=\mathcal{O}(d^{-3/4}T^{-1/4}))$ in Addax leads to the convergence rate:

$$ $\mathbb{E}\left[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2} \right]=\mathcal{O}\left(\frac{1}{\sqrt{T}}\cdot\sqrt{\frac{(1-\alpha)^{2}}{K^ {1}}+\frac{\alpha^{2}d}{K^{0}}}\right).$ $$

Further, by choosing the optimal $\alpha=\frac{K^{0}}{K^{0}+dK^{1}}$, we obtain the
convergence rate $\mathcal{O}\left(\sqrt{\frac{d}{T(K^{0}+dK^{1})}}\right).$

The formal version of this Theorem and its proof can be found in Appendix G.3.

###### Remark 3.2 .

Compared with the convergence rate of zeroth-order methods [, ], the above convergence rate is nearly dimension-independent. In particular, the factor $\sqrt{\frac{d}{T(K^{0}+dK^{1})}}$ is upper bounded by $\sqrt{\frac{1}{TK^{1}}}$.

###### Remark 3.3 .

The restrictions on the choice of parameters for Addax are more relaxed than the ones in zeroth-order methods. In particular, ZO-SGD (or MeZO) requires choosing smaller parameters $\epsilon=\mathcal{O}(d^{-1}T^{-1/2})$ and $\eta=\mathcal{O}(1/\sqrt{dT})$ for guaranteeing convergence. These choices are clearly more restrictive than the choice of parameters in Theorem 3.1. Therefore, one can choose a larger learning rate in Addax compared to MeZO. This is also observed in our experiments (see Appendix D.5 for details).

###### Remark 3.4 .

Prior works observed that pre-trained LMs have a low effective rank Hessian [, , , ]. Under the assumption that the Hessian \xwedithas a low effective rank, the dependency on the \xweditparameter dimension $d$ can be further improved (see Theorem G.12 in Appendix G).

Besides assuming the loss is nonconvex and smooth, we also provide the convergence of Addax for strongly convex and smooth loss functions:

###### Theorem 3.5 (Informal) .

Assume that $\mathcal{L}$ is strongly convex, per-sample loss $\ell$ is Lipschitz smooth, and the first-order stochastic gradients are unbiased and have bounded variance. Choosing $\eta_{t}=\eta=\mathcal{O}(T^{-1}\ln(T))$ and $\epsilon=\mathcal{O}(\alpha^{1/2}T^{-1/2}d^{-1/2})$ in Addax leads to the convergence rate:

$$ $\mathbb{E}[\left\lVert\bm{\theta}_{T}-\bm{\theta}_{\star}\right\rVert^{2}]= \mathcal{O}\left(\frac{\ln(T)}{T}\left(\frac{(1-\alpha)^{2}}{K^{1}}+\frac{ \alpha^{2}d}{K^{0}}\right)\right)$ $$

Further, by choosing the optimal $\alpha=\frac{K^{0}}{K^{0}+dK^{1}}$, Addax converges with rate $\mathcal{O}\left(\frac{\ln(T)d}{T(K^{0}+dK^{1})}\right)$.

The above results cover the case where step 3 is executed in Algorithm 1. When step 5 is executed, we can obtain similar results (see Theorem G.10 in Appendix G.4 for details).

###### Theorem 3.1 (Informal) .

###### Remark 3.2 .

###### Remark 3.3 .

###### Remark 3.4 .

###### Theorem 3.5 (Informal) .

### 3.3 Further Discussions on the Benefits of Utilizing Zeroth-Order Gradients

Beyond enhancing memory efficiency of IP-SGD by eliminating the need to compute gradients for input data with longer sequence lengths that are more memory-intensive, using zeroth-order updates alongside first-order updates improve the final performance and accuracy of the fine-tuned model compared with vanilla IP-SGD. We hypothesize the following reasons for this improvement in performance:

Zeroth-order updates may help to escape spurious and sharp local minima. It is known that zeroth-order gradient estimates are noisy estimates of the gradient (see [] and Lemma G.5 in Appendix G). It has also been observed that injecting noise into the gradient can be beneficial in nonconvex optimization. For example, Ge et al. [] and Jin et al. [] showed that adding noise to the gradient direction can help escape saddle points in nonconvex optimization. Moreover, Zhou et al. [] showed (both experimentally and theoretically) that injecting noise into the gradient direction can help the algorithm in escaping bad/spurious local minima. One can also argue that noise would help the algorithm in finding flat minima and avoid sharp local minima Liu et al. []. All these insights suggest that Addax can converge to better local minima. Our extensive experiments in Section 4 also show that Addax outperforms SGD in terms of the final performance of the fine-tuned model.

Zeroth-order updates act as a regularizer.
To simplify the presentation, consider the case where step 3 is executed in Algorithm 1.
Recall that the zeroth-order gradient is an unbiased estimator of the smoothed version of the actual loss. That is, $\mathbb{E}[g^{0}\mathbf{z}]=\nabla\widehat{\mathcal{L}}(\bm{\theta})$, where $\widehat{\mathcal{L}}(\bm{\theta})\triangleq\mathbb{E}_{\mathbf{z}}\left[
\mathcal{L}(\bm{\theta}+\epsilon\mathbf{z})\right]$ is the Gaussian smoothed version of the original loss function $\mathcal{L}(\bm{\theta})$ (see Nesterov and Spokoiny [, Section 1] and Nemirovsky et al. [, Section 9.3]). Thus, the Addax update rule in equation (3) aims to solve the optimization problem

$$ $\min_{\bm{\theta}}\;\;(1-\alpha)\mathcal{L}(\bm{\theta})+\alpha\widehat{ \mathcal{L}}(\bm{\theta}).$ $$

Such a regularization, illustrated in Figure 5, can help escape sharp local minima and find higher-quality solutions. When step 5 is executed, then this regularization is only done for some of the data points but still can be effective. This could be the reason that Addax finds higher-quality models in all our experiments.

Figure: Figure 5: Left: An illustration of loss function $\mathcal{L}(\bm{\theta})$ alongside its Gaussian smoothed version $\widehat{\mathcal{L}}(\bm{\theta})$. Minimizing $(1-\alpha)\mathcal{L}(\bm{\theta})+\alpha\widehat{\mathcal{L}}(\bm{\theta})$ can help escape sharp local minima and find higher quality solutions. Right: The regularization effect of zeroth-order gradient estimates on first-order gradient estimates. We fix $K^{1}=4$ in Addax across experiments while varying $K^{0}$ from 0 to 16. In the special case where $K^{0}=0$, Addax reduces to IP-SGD.
Refer to caption: x7.png

## 4 Experiments

Experiment Settings.
We conduct fine-tuning experiments on five different models: the masked LM RoBERTa-large of [] (350M), the OPT-13B, OPT-30B, OPT-66B [] and Llama-2-70B models [].
We also explore the impact of hyper-parameters $\alpha$ and the batch size on Addax’s performance, detailed in Appendix E.2. Further details on the datasets, prompts used, and implementation can be found in Appendix D. The code for our experiments is available at [https://github.com/optimization-for-data-driven-science/Addax](https://github.com/optimization-for-data-driven-science/Addax).

Observations on OPT-13B experiments  Following [],
we fine-tune the OPT-13B model using a single A100 GPU with Addax, MeZO, IP-SGD, and SGD. The results are presented in Figure 2 and Table 12. In this configuration, we aim to select the largest possible batch sizes for MeZO, IP-SGD, and SGD and optimize $(K^{0},K^{1})$ and $L_{T}$ for Addax using one GPU. Averaging over nine tasks, Addax outperforms MeZO in this configuration by 14% in accuracy/F1 score and converges $15\times$ faster. To highlight the differences in convergence speed, we plot the convergence curves of Addax-WA and MeZO using the same batch size in Figure 11.

Remarkably, while Addax can successfully run on all datasets, SGD encounters out-of-memory errors on all nine tasks and IP-SGD fails in three out of nine tasks. For the six datasets where IP-SGD is able to fine-tune, Addax achieves an average accuracy/F1 score of 81.7 compared to 80.3 for IP-SGD. Finally, Addax even outperforms Adam in seven out of nine tasks while it reduces up to $89\%$ the memory.

Observations on OPT-30B, OPT-66B, and Llama-2-70B experiments.  We also perform experiments on fine-tuning the larger-size models OPT-30B, OPT-66B, and Llama-2-70B. In particular, we fine-tune the OPT-30B model using one H100 GPU and report the results in Figure 2 and Table 13. To summarize
the results, we report the averaged performance metrics (time, accuracy, and memory) in Table 1. Our experiment on OPT-30B shows that while Addax has comparable memory consumption to MeZO, on average, Addax outperforms MeZO by more than $16\%$ in terms of final accuracy and converges $30\times$ faster.
Moreover, SGD and IP-SGD failed in three out of seven tasks due to out-of-memory, while Addax can run on all tasks. In terms of the final accuracy of the fine-tuned model, Addax outperforms MeZO, SGD, and IP-SGD in all experiments in OPT-30B.

Similar observations are made in fine-tuning OPT-66B and Llama-2-70B models on three H100 GPUs: SGD and IP-SGD fail in some or all tasks due to out-of-memory, while Addax can efficiently fine-tune on all tasks. Addax outperforms other methods in six of seven tasks for the OPT-66B model and all six tasks for the Llama-2-70B model. Moreover, Addax outperforms MeZO in terms of final accuracy while being orders of magnitude faster. The results are summarized in Table 2 and Table 3, repectively.

Observations on RoBERTa-large experiments. Besides the large autoregressive language model, we also perform experiments on a smaller language model: RoBERTa-large with 350M parameters. The results can be found in Figure 7. As can be seen in this figure, 16/32-bit Addax outperforms zero-shot and MeZO across six different tasks and surpasses Adam in four out of six tasks. We also investigate the two important hyper-parameters, $\alpha$ and $\frac{K^{1}}{K^{0}+K^{1}}$ on Addax’s performance. The results can be found in Figure 8 and Figure 9. As shown in the top row of the heatmaps of the two figures, it is observed that an increase in the ratio $\frac{K^{1}}{K^{0}+K^{1}}$ correlates with improved accuracy across tasks for both 16-bit and 32-bit Addax configurations. We did not identify a consistent trend for $\alpha$ across different tasks for both 16-bit and 32-bit Addax, suggesting that the optimal $\alpha$ requires tuning and could be task-specific.

Zeroth-order gradient estimates improve model performance even when $K^{1}$ is small. We report the detailed choice of the batch size for different algorithms in Table 12. Notably, fine-tuning OPT-13B using Addax with a smaller first-order batch size $K^{1}$ surpasses the performance of SGD with larger batch sizes. For example, Addax achieves an accuracy of $68.3$ on the WIC task with $K^{1}=4$, while IP-SGD achieves $66.0$ with a batch size of $12$. This suggests that the zeroth-order gradient estimate in Addax provides stability (and regularization of the gradient) even when $K^{1}$ is small and can effectively reduce memory usage.
Additional experimental results are given in Appendix 7.

It is important to note that reported memory usage should be interpreted with caution, as it depends on the selected batch size. Reducing the batch size can lower memory usage, but it may come at the cost of accuracy and convergence speed. In our tables, when an entry is marked with $*$, it means that even with the smallest batch size in our grid (i.e. BS = 2), the algorithm still results in out-of-memory.

Hyperparameter tuning. For MeZO, IP-SGD, and SGD, we select the largest possible batch size from the hyperparameter search grid that maximizes GPU memory usage without causing out-of-memory. For Addax, we choose $K^{0}$, $K^{1}$, and $L_{T}$ values that optimize GPU usage during fine-tuning on the MultiRC dataset, as it is the task with the longest sequence length. Successful fine-tuning on MultiRC implies Addax can handle smaller tasks as well. For detailed procedures, please refer to Appendix D.6.

Table: Table 1: Summary of OPT-30B fine-tuning results on one H100 GPU (80GB): The $\mskip 1.5mu\overline{\mskip-1.5mu{\text{METRIC}}\mskip-1.5mu}\mskip 1.5mu$, representing the average performance across short datasets (SST-2, RTE, WSC, WIC) and long datasets (BoolQ, MultiRC, SQuAD). $L_{max}$ is the maximum sequence length within a dataset. Detailed results are in Table 13.

Table: Table 2: Summary of OPT-66B fine-tuning results on three H100 GPUs (240GB total): The $\mskip 1.5mu\overline{\mskip-1.5mu{\text{METRIC}}\mskip-1.5mu}\mskip 1.5mu$, representing the average performance across short datasets (SST-2, RTE, BoolQ, WSC, WIC, SQuAD) and long dataset (MultiRC). $L_{max}$ is the maximum sequence length within a dataset. Detailed results are in Table 14.

Table: Table 3: Summary of Llama-2-70B fine-tuning results on three H100 GPUs (240GB total): The notation $\mskip 1.5mu\overline{\mskip-1.5mu{\text{METRIC}}\mskip-1.5mu}\mskip 1.5mu$ represents the average performance across short datasets (RTE, WSC, WIC) and long datasets (BoolQ, MultiRC, SQuAD). $L_{max}$ is the maximum sequence length within a dataset. Detailed results are in Table 15.

## 5 Conclusion, Broader Impact, and Limitations

This paper introduces Addax, a memory-efficient fine-tuning method for Language Models (LMs). By leveraging both first- and zeroth-order stochastic gradient estimates, Addax demonstrates improved memory efficiency without sacrificing convergence speed or model performance, as validated by our extensive experiments across various models, tasks, and datasets.
Addax has the potential to impact language model fine-tuning tasks for researchers and machine learning practitioners with limited resources. With a convergence time comparable to first-order methods and memory usage similar to zeroth-order methods, Addax provides a resource-efficient approach to optimizing higher-quality fine-tuned models. Furthermore, Addax has proven effective with large-scale models, and its memory-efficient nature can make large-scale fine-tuning more feasible by requiring fewer resources.

Limitation: Addax introduces an additional hyper-parameter, $\alpha$, which requires tuning for best performance. While the search grid for $\alpha$ is small and includes only five different values across all OPT experiments, this is still an additional burden for institutions with limited resources.

Future works: Addax may also have potential application in tasks other than fine-tuning. For example, Addax may be used for pre-training tasks or even combined with the Adam algorithm by passing the combined first- and zeroth-order gradients to Adam. From a theoretical perspective, conducting an in-depth theoretical analysis of how zeroth-order gradient estimates regularize the performance of first-order ones is of particular interest. We leave these aspects as future work for further exploration. Furthermore, we did not explore the effectiveness of Addax when combined with other memory-efficient methods, such as PEFT [, , ], quantization [], and memory-efficient attention mechanisms [, , ], but we hope to investigate these combinations in future work.

## Appendix A More discussion on Addax

Algorithm 1 outlines the steps of Addax. The process starts by determining whether the dataset requires partitioning based on the sequence length threshold $L_{T}$. There are two possible scenarios: If memory constraints are not a concern, $L_{T}$ can exceed $L_{max}$, the maximum sequence length in the dataset $\mathcal{D}$. In this case, Addax retains the dataset $\mathcal{D}$ as a whole, with $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$ both being equivalent to $\mathcal{D}$ (Step 3). However, when memory is limited and running IP-SGD on the entire dataset $\mathcal{D}$ is not feasible, Addax saves memory by partitioning the dataset according to $L_{T}$. It assigns samples with sequence lengths shorter than $L_{T}$ to $\mathcal{D}^{1}$, and the remaining samples to $\mathcal{D}^{0}$ (Step 5). This enables Addax to run in memory-constrained settings where IP-SGD would otherwise be infeasible.

In Step 8, the zeroth-order gradient estimator $g^{0}$ and random seed $s$ are obtained using the samples $\mathcal{B}^{0}$ with batch size $K_{0}$, which are drawn uniformly from the dataset $\mathcal{D}^{0}$. Similarly, Step 10 gets the layer $l$ first-order gradients $\bm{g}^{1}_{l}\in\mathbb{R}^{d_{l}}$ from samples $\mathcal{B}^{1}$ through backward propagation.

A major step in Algorithm 1 is the computation of zeroth-order directional derivative $g_{0}$, done in Step 8, which is the subroutine call in Algorithm 2. Algorithm 2 is also used in MeZO, where the directional derivative is obtained through the classical zeroth-order gradient estimate SPSA; see equation equation (2). To get the zeroth-order gradient estimates, Algorithm 2 requires the evaluation of the loss function $\mathcal{L}$ through two forward passes at points ${\bm{\theta}}+\epsilon\bm{z}$ and ${\bm{\theta}}-\epsilon\bm{z}$. The naïve implementation of the SPSA algorithm costs twice the memory of inference because of the need to store the value of $\bm{z}\in\mathbb{R}^{d}$. Algorithm 2 removes this overhead by generating a random seed $s$ and resetting the random number generator each time model parameters are perturbed (see Step 3-7 in Algorithm 2).
This approach guarantees that Algorithm 3 maintains a consistent direction for the random vector
$\bm{z}$ across the two perturbations. Employing this in-place operation results in Algorithm 2 having memory consumption comparable to that of inference.

Steps 9 to 12 in Algorithm 1 are the main update steps based on the first-order gradient estimates for Addax. In Step 10, we back-propagate the first-order gradient estimates $\bm{g}^{1}_{m}$ for layer $m$ and update the model parameters in Step 11. In Step 12, Addax frees up the calculated first-order gradient estimates $\bm{g}^{1}_{m}$. This step is crucial because freeing up per-layer gradients ensures that memory requirements do not scale with the number of model parameters. More discussion on the related literature on this in-place update rule can be found in Appendix B.

Steps 14 to 17 in Algorithm 1 describes the updates of Addax based on zeroth-order gradient estimates. We use the same idea as in Malladi et al. [], where the seed $s$ is stored instead of the random vector $\bm{z}$. The random generator is reset before updating the components (see Step 13 in Algorithm 1), as described before. For each component $\bm{\theta}_{l}$ in ${\bm{\theta}}$ where $m$ ranges from $1$ to $M$, the process begins by generating a random direction $\bm{z}_{m}\sim\mathcal{N}(0,\mathbf{I}_{d_{m}})$ in Step 15. Subsequently, each $\bm{\theta}_{m}$ is updated using zeroth-order gradient estimates. When iteration $t$ reaches $T$, Addax outputs the final model parameters ${\bm{\theta}}$.

In general, the in-place update operations have the same output as the update rule $\bm{\theta}\leftarrow\bm{\theta}-\eta(\alpha\mathbf{z}g^{0}+(1-\alpha)\mathbf{
g}^{1})$. This fine-grained control of dynamically allocated gradients ensures that Addax remains memory-efficient during fine-tuning.

Figure: Algorithm 2 ZerothGrad []

Figure: Algorithm 3 PertubParameters

## Appendix B More discussion on the in-place updates

In this section, we provide a more detailed discussion on in-place updates. The technique of in-place gradient updates during backward propagation, as referenced in our approach, has been previously used in Zhao et al. [], Lv et al. []. In modern deep learning training frameworks, such as PyTorch [](^1^11[https://pytorch.org/](https://pytorch.org/)), they store the gradient tensor for computing optimizer states and update the model weights after all layers of gradients are computed. This approach is perfect for models with a small number of parameters; however, fine-tuning a large model, like OPT-13B with 13 billion parameters, requires significant memory because the gradient tensor has the same size as the number of model parameters. For example, as for the OPT-13B model, each parameter needs 2 bytes or 4 bytes for gradient storage, totaling 26 GB or 52 GB of memory, respectively. Since Addax does not require any optimizer states, such memory overhead can be avoided by combining the computation of first-order gradient estimates and parameter updates into a single step. As described in Algorithm 1 lines 9-12, we sequentially iterate over the $M^{\text{th}}$ layer to the $1^{\text{st}}$ layer, compute the gradient $\bm{g}_{m}^{1}$ (line 10), and perform in-place update to $\bm{\theta}_{m}$ (line 11). Right after that, we free the memory for gradient $\bm{g}_{m}$ (line 12). The loss computation and the update of zeroth-order gradient $g_{0}$ remain the same as Algorithm 1. It is important to note that while the main update rule of mixing first-order and zeroth-order gradients remains unchanged, the implementation details significantly impact the memory consumption of fine-tuning tasks.

It is also worth noting that the in-place update rule has its own limitations. Firstly, it prevents the optimizer from using gradient accumulation, a technique that scales batch size by accumulating gradients over several batches and only updating the optimizer after a specified number of batches. Secondly, it prevents gradient normalization, as the norm of the gradient must be known for normalization. In our paper, we distinguish between SGD and IP-SGD: SGD uses gradient normalization during fine-tuning, while IP-SGD does not. This distinction leads to differences in final performance and convergence time. For all experiments, except those using Adam, we do not employ the gradient accumulation technique.

## Appendix C Discussion on related works

Stochastic First-order Optimizers in Deep Learning. SGD [] has long been used in training deep neural networks due to its convergence rate that is independent of the number of model parameters. However, adaptive first-order optimizers have shown advantages over SGD in hyper-parameter tuning, final model performance, and convergence speed. The concept of adaptive first-order optimizers dates back to RPROP []. AdaGrad [] adjusts the learning rate based on the estimated geometry, assigning higher rates to less frequent features. RMSProp [] builds on RPROP, making it effective for small batch sizes. Adam [], inspired by AdaGrad and RMSProp, incorporates a running average of gradients and has become the preferred method for training neural networks due to its fast convergence and reduced need for hyper-parameter tuning. Numerous studies have demonstrated Adam’s success [, , ], and researchers continue to investigate its efficacy with Transformer architectures [].

Zeroth-order optimization.
Zeroth-order optimization has been extensively studied in convex, strongly convex, and non-convex settings in the optimization literature [, , , , , ]. It is known that the convergence rate of zeroth-order methods generally scales with the number of parameters $d$. This property makes zeroth-order methods less effective for training deep neural networks for which the number of parameters $d$ can be very large. Recently, MeZO [] demonstrated that in language fine-tuning tasks, ZO-SGD can perform comparably to first-order methods. By using in-place perturbation, MeZO applies ZO-SGD in a memory-efficient manner, keeping memory usage comparable to inference. The success of fine-tuning with zeroth-order methods may be due to the fact that LM fine-tuning can occur in a very low-dimensional subspace [, ]. However, MeZO suffers from significantly slow convergence speed and slightly worse performance compared to first-order optimizers. Balasubramanian and Ghadimi [] estimate the Hessian to perform ZO optimization along important directions. Guo et al. [] focus on fine-tuning a minimal subset of LLM parameters using zeroth-order methods, incorporating sparsity and quantization to overcome memory limitations.

Mixing update directions from different optimizers. There are recent studies of mixing the update directions of different optimizers to enhance the performance of training/fine-tuning. MAS [] integrates SGD and Adam by assigning constant weights to balance the contributions of gradient estimates from both optimizers. Concurrent to our work, Zhang et al. [] explores integrating zeroth- and first-order gradient estimates through a “hybrid ZO-FO fine-tuning scheme for LLMs”. However, their method is completely different than ours. In particular, they restrict backpropagation to the deeper layers of the model, using zeroth-order optimization for the shallower layers to update parameters. Although this technique enhances memory efficiency, it neglects the possibility of using in-place first-order updates, leading to significant memory usage. In contrast, our approach employs in-place first-order gradient estimates, ensuring that memory requirements do not scale with the number of model parameters, eliminating the need to restrict backpropagation to specific layers. As we discussed in the main body, the memory demands of fine-tuning LMs with small first-order batch sizes are comparable to those using zeroth-order batch sizes for many fine-tuning tasks. By utilizing both gradient estimates, our proposed method, Addax, not only proves to be more memory-efficient but also surpasses competing methods in terms of the final accuracy of the fine-tuned model.

## Appendix D Experiment setup

The code is available at [https://github.com/optimization-for-data-driven-science/Addax](https://github.com/optimization-for-data-driven-science/Addax).

### D.1 Datasets

Our setup mainly follows the experiments in []. We employ the same datasets utilized in Malladi et al. []. Unless otherwise noted, we apply the same data processing procedures and settings for both validation and training.

For the RoBERTa-large model, we utilize the following datasets: SST-2 [], SST-5 [], SNLI [], MNLI [], RTE [, , , ], and TREC []. The test set is limited to 1,000 examples for both training and validation purposes. In our few-shot learning experiments, we set $k=16$, where $k$ represents the number of examples per class for training and validation.

For the OPT experiments, we employ the SuperGLUE dataset [], comprising BoolQ [], CB [], COPA [], MultiRC [], RTE [, , , ], WIC [], and WSC []. Following the approach of Malladi et al. [], we also include SST-2 [] for development purposes, along with one question answering (QA) datasets: SQuAD []. For each dataset, we randomly select $1,000$ examples for training, $500$ examples for validation, and $1,000$ examples for testing.

### D.2 Datasets overview

In this section, we provide a brief overview of the datasets used in our experiments. For both training and fine-tuning with transformers, peak memory usage is usually determined by the dataset’s longest sequence length $L_{max}$. Samples shorter than $L_{max}$ are padded to this length. Figure 6 shows the histograms of sequence lengths for six different datasets (SST-2, RTE, WSC, WIC, MultiRC) tokenized by the OPT-13B tokenizer. The data points in these distributions are mostly from right-skewed normal distributions, indicating a relatively small number of samples with long sequence lengths in each dataset.

Figure: (a) Task: SST2
Refer to caption: x9.png

### D.3 Prompts

To ensure a fair comparison, we employ the same prompts as those used by Malladi et al. [], which were initially adapted from Gao et al. [], GPT-3 [], and PromptSource []. Table 4 presents the prompts employed in our RoBERTa-large experiments, while Table 5 details the prompts utilized for the OPT experiments.

Table: Table 4: The prompts for each dataset used in our RoBERTa-large experiments. These prompts are identical to those used by Malladi et al. []. There are three different task types: sentiment classification (sentiment cls.), topic classification (topic cls.), and natural language inference (NLI). $C$ is the number of classes for each dataset. The label words can be filled in the [MASK] token of the prompt template. <S1> and <S2> are the first and second (if any) input sentences.

Table: Table 5: The prompts used in the OPT experiments are identical to those used in Malladi et al. []. There are three types of tasks: classification (cls.), multiple-choice (mch.), and question-answering (QA). <text> is the input from the dataset and blue text are the label words. We follow the same practice as in Malladi et al. []: for the inference task, we incorporate different candidates into the prompt, compute the average log-likelihood for each, and select the candidate with the highest score. For question-answering (QA) tasks, answers are produced through greedy decoding.

### D.4 Implementation

For the RoBERTa-large experiments, we run Addax in two separate computational precision settings: one using 16-bit floating-point calculations (FP16), referred to as 16-bit Addax, and the other using 32-bit floating-point calculations (FP32), denoted as 32-bit Addax for clarity. For all RoBERTa-large experiments, MeZO and Adam are loaded in the FP32 setting. Since fine-tuning RoBERTa-large models does not require significant memory, we set $L_{T}$ sufficiently large for running Addax, ensuring that $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$ are equivalent to the total dataset $\mathcal{D}$.

For the OPT and Llama experiments, Addax is used solely in the FP16 setting. We run SGD and IP-SGD in the FP16 setting and Adam in the FP32 setting. Unless otherwise noted, Addax, SGD, IP-SGD, and MeZO are trained in the FP16 setting, while Adam uses the FP32 setting. If the maximum sequence length within the dataset $L_{max}$ is less than $L_{T}$, Addax does not partition the dataset, and $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$ are equivalent to the total dataset $\mathcal{D}$. In the scenarios where IP-SGD fails, Addax further reduces the memory usage by assigning different batches of data to ZO-SGD and FO-SGD based on $L_{T}$. Specifically, Addax partitions the training data $X$ based on the length of data points, given a threshold $L_{T}$. The data is divided into $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$, where $\mathcal{D}^{0}=\{x\in\mathcal{D}\,|\,\textrm{length}(x)>L_{T}\}$ and $\mathcal{D}^{1}=\{x\in\mathcal{D}\,|\,\textrm{length}(x)\leq L_{T}\}$.

We do not employ advanced quantization techniques such as LLM.int8() [] and QLoRA [], nor do we integrate Addax with Parameter-Efficient Fine-Tuning methods (PEFT) [, , ]. For model inference, we utilize the standard PyTorch [] implementation of transformer. We do not use the memory-efficient approaches such as FlashAttention [], KDEformer [], and HyperAttention []. Although the combination between Addax and these methods remains unexplored, we posit that their combination could significantly enhance Addax by further reducing the memory demands and augmenting performance. We leave the exploration of Addax’s interplay with various memory-efficient methods to future work.

### D.5 Hyper-parameters

We present the hyper-parameters for all experiments conducted with RoBERTa-large in Table 6 and those for OPT-13B, OPT-30B, OPT-66B, Llama-2-70B in Table 7, Table 8, Table 9 and Table 10 respectively. It is important to note that for both models, the hyper-parameters grid utilized for MeZO and Adam adheres to the specifications set forth in Malladi et al. [].

For RoBERTa-large experiments, both Addax and MeZO employ a constant learning rate schedule, while Adam uses linear scheduling. For the training process, Addax and Adam are set for $1,000$ steps, while MeZO extends to $100,000$ steps. We check validation performance every $50$ training step and save the best validation checkpoint for testing.

For OPT experiments, Addax, SGD, IP-SGD, and MeZO similarly adopt a constant learning rate schedule, with Adam maintaining its linear scheduling. Here, Adam is configured for $100$ steps, whereas Addax, SGD, and IP-SGD are set for $1,000$ steps, and MeZO for $20,000$ steps. For the SGD and IP-SGD experiments in OPT-13B, we choose the batch size from our grid that maximizes the memory usage of a single A100 GPU, as larger batch sizes tend to yield better results. For OPT-30B, OPT-66B experiments, and Llama-2-70B experiments, we set the batch size of SGD and IP-SGD to the same or less than $K^{1}$ of Addax. We check validation performance every $1/20$ training step and save the best validation checkpoint for testing. We leave a detailed discussion on how we selected batch size, $K^{1}$, $K^{0}$, and $L_{T}$ for reporting accuracy in Appendix D.6.

As explained in the main body, Addax can use larger learning rates than MeZO, resulting in faster convergence. For the RoBERTa-large experiments, Addax uses the learning rate $\eta$ of $\{1\mathrm{e}-5,5\mathrm{e}-5,1\mathrm{e}-4\}$, while MeZO uses the learning rate $\eta$ of $\{1\mathrm{e}-7,1\mathrm{e}-6,1\mathrm{e}-5\}$. For the OPT experiments, we fix the learning rate $\eta$ of Addax to $1\mathrm{e}-4$, while MeZO uses a magnitude smaller learning rate $\eta$ of $\{1\mathrm{e}-6,1\mathrm{e}-7\}$.

**Table 6: The hyper-parameter grids used for RoBERTa-large experiments. Addax and MeZO use a constant learning rate schedule, and Adam uses linear scheduling. Addax and Adam use 1K steps, and MeZO uses 100K steps. We check validation performance every $50$ training step and save the best for testing.**
| Experiment | Hyper-parameters | Values |
| --- | --- | --- |
| 16-bit/32-bit Addax | $K^{0}+K^{1}$ | 64 |
|  | $\frac{K^{1}}{K^{0}+K^{1}}$ | $\{0.1,0.2,0.3,0.4,0.5\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-5,5\mathrm{e}-5,1\mathrm{e}-4\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
|  | $\alpha$ | $\{3\mathrm{e}-4,1\mathrm{e}-3,3\mathrm{e}-3,4\mathrm{e}-3,$ |
|  |  | $5\mathrm{e}-3,7\mathrm{e}-3,1\mathrm{e}-2,1\mathrm{e}-1\}$ |
| MeZO | Batch size | 64 |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-7,1\mathrm{e}-6,1\mathrm{e}-5\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
| 32-bit Adam | Batch size | $\{2,4,8\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-5,3\mathrm{e}-5,5\mathrm{e}-5\}$ |

**Table 7: The hyper-parameter grids used for OPT-13B experiments in one A100 GPU (40GB). Addax, SGD, IP-SGD, and MeZO use a constant learning rate schedule, and Adam uses linear scheduling. Adam uses 200 steps. Addax, IP-SGD, and SGD use 1K steps and MeZO 20K steps. We check validation performance every $1/20$ training step and save the best for testing. Note that for IP-SGD, SGD, and MeZO, some runs may have encountered out-of-memory errors during training when fine-tuning with one A100 GPU.**
| Experiment | Hyper-parameters | Values |
| --- | --- | --- |
| Addax | $(K^{1},K^{0})$ | $(4,6)$ |
|  | Learning Rate $\eta$ | $1\mathrm{e}-4$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
|  | $\alpha$ | $\{1\mathrm{e}-4,3\mathrm{e}-4,5\mathrm{e}-4,7\mathrm{e}-4,9\mathrm{e}-4\}$ |
|  | $L_{T}$ | $\{150,155,160,165,170\}$ |
| MeZO | Batch size | $\{2,4,6,8,10,12,14,16,20,24,28,32\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-6,1\mathrm{e}-7\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
| SGD | Batch size | $\{2,4,6,8,10,12,14,16,20,24,28,32\}$ |
|  | Learning Rate $\eta$ | $\{5\mathrm{e}-3,1\mathrm{e}-2,5\mathrm{e}-2\}$ |
| IP-SGD | Batch size | $\{2,4,6,8,10,12,14,16,20,24,28,32\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-4,1.25\mathrm{e}-4,7.5\mathrm{e}-4\}$ |
| Adam | Batch size | 8 |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-5,5\mathrm{e}-5,8\mathrm{e}-5\}$ |

**Table 8: The hyper-parameter grids used for OPT-30B experiments in one H100 GPU (80GB). Addax, SGD, IP-SGD, and MeZO use a constant learning rate schedule. Addax, IP-SGD, and SGD use 1K steps and MeZO 20K steps. We check validation performance every $1/20$ training steps and save the best for testing.**
| Experiment | Hyper-parameters | Values |
| --- | --- | --- |
| Addax | $(K^{1},K^{0})$ | $\{(2,6),(4,6)\}$ |
|  | Learning Rate $\eta$ | $1\mathrm{e}-4$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
|  | $\alpha$ | $\{1\mathrm{e}-4,3\mathrm{e}-4,5\mathrm{e}-4,7\mathrm{e}-4,9\mathrm{e}-4\}$ |
|  | $L_{T}$ | $\{320,180\}$ |
| MeZO | Batch size | $\{2,4,6,8,10,12,14,16\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-6,1\mathrm{e}-7\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
| SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{5\mathrm{e}-3,1\mathrm{e}-2,5\mathrm{e}-2\}$ |
| IP-SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-4,1.25\mathrm{e}-4,7.5\mathrm{e}-4\}$ |

**Table 9: The hyper-parameter grids used for OPT-66B experiments in three H100 GPU (240GB total). Addax, SGD, IP-SGD and MeZO use a constant learning rate schedule Addax, IP-SGD, SGD use 1K steps and MeZO 20K steps. We check validation performance every $1/20$ training step and save the best for testing.**
| Experiment | Hyper-parameters | Values |
| --- | --- | --- |
| Addax | $(K^{1},K^{0})$ | $(4,6)$ |
|  | Learning Rate $\eta$ | $1\mathrm{e}-4$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
|  | $\alpha$ | $\{1\mathrm{e}-4,3\mathrm{e}-4,5\mathrm{e}-4,7\mathrm{e}-4,9\mathrm{e}-4\}$ |
|  | $L_{T}$ | $260$ |
| MeZO | Batch size | $\{2,4,6,8,10,12,14,16\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-6,1\mathrm{e}-7\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
| SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{5\mathrm{e}-3,1\mathrm{e}-2,5\mathrm{e}-2\}$ |
| IP-SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-4,1.25\mathrm{e}-4,7.5\mathrm{e}-4\}$ |

**Table 10: The hyper-parameter grids used for Llama-2-70B experiments in three H100 GPU (240GB total). Addax, SGD, IP-SGD and MeZO use a constant learning rate schedule Addax, IP-SGD, SGD use 1K steps and MeZO 20K steps. We check validation performance every $1/20$ training step and save the best for testing.**
| Experiment | Hyper-parameters | Values |
| --- | --- | --- |
| Addax | $(K^{1},K^{0})$ | $(4,6)$ |
|  | Learning Rate $\eta$ | $1\mathrm{e}-4$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
|  | $\alpha$ | $\{1\mathrm{e}-4,3\mathrm{e}-4,5\mathrm{e}-4,7\mathrm{e}-4,9\mathrm{e}-4\}$ |
|  | $L_{T}$ | $240$ |
| MeZO | Batch size | $\{2,4,6,8,10,12,14,16\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-6,1\mathrm{e}-7\}$ |
|  | $\epsilon$ | $1\mathrm{e}-3$ |
| SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{5\mathrm{e}-3,1\mathrm{e}-2,5\mathrm{e}-2\}$ |
| IP-SGD | Batch size | $\{2,4\}$ |
|  | Learning Rate $\eta$ | $\{1\mathrm{e}-4,1.25\mathrm{e}-4,7.5\mathrm{e}-4\}$ |

### D.6 Detailed methods in selecting BS, K 0 superscript 𝐾 0 K^{0} italic_K start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT , K 1 superscript 𝐾 1 K^{1} italic_K start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT , and L T subscript 𝐿 𝑇 L_{T} italic_L start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT for reporting

#### D.6.1 OPT-13B experiments

In our OPT-13B experiments, we run Addax, MeZO, IP-SGD, and SGD using a single A100 (40GB) GPU. For MeZO, IP-SGD, and SGD, we select a batch size from the grid $\{2,4,6,8,10,12,14,16,20,24,28,32\}$, choosing the largest possible batch size that maximizes GPU memory usage without encountering out-of-memory errors. A method is considered to have failed to fine-tune the dataset if it cannot run even with the smallest batch size from the grid. For example, SGD fails to fine-tune all datasets with the smallest batch size, and IP-SGD fails to fine-tune the BoolQ, MultiRC, and SQuAD datasets on a single A100 (40GB) GPU.

To further reduce the memory requirements of IP-SGD, we first fine-tune Addax on the longest dataset, MultiRC (Figure 6), as successfully running Addax on the longest dataset ensures it can also run on shorter ones. We found that with $(K^{1},K^{0})=(4,6)$ and $L_{T}=170$, Addax achieves optimal performance on the MultiRC dataset while staying within the 40GB memory constraints. Thus, we use the same $(K^{1},K^{0})=(4,6)$ configuration for Addax when fine-tuning the remaining datasets, searching for optimal combinations of $\alpha$ and $L_{T}\leq 170$.

#### D.6.2 OPT-30B, OPT-66B, Llama-2-70B experiments

For the OPT-30B experiments, we follow the same methodology as described in the OPT-13B experiments. For MeZO, IP-SGD, and SGD, we choose the largest possible batch size from the grid that maximizes GPU memory usage without encountering out-of-memory errors, using a single H100 GPU (80GB). For Addax in the OPT-30B experiments, we fine-tune with two different settings: $(K^{1},K^{0})=(4,6)$ when $L_{T}=180$ and $(K^{1},K^{0})=(2,6)$ when $L_{T}=320$. In both settings, Addax does not encounter out-of-memory issues when fine-tuning the MultiRC dataset in one GPU, indicating that it can also fine-tune the remaining datasets.

In the OPT-66B and Llama-2-70B experiments, we fine-tune MeZO, IP-SGD, and SGD by selecting the largest possible batch size from the grid that maximizes GPU memory usage without encountering out-of-memory errors, using three H100 GPUs (a total of 240GB). For simplicity, Addax uses the same $(K^{1},K^{0})=(4,6)$ configuration from the OPT-13B experiments, with $L_{T}=260$ for OPT-66B and $L_{T}=240$ for Llama-2-70B, allowing Addax to successfully run without out-of-memory errors.

### D.7 Memory profiling

In our memory profiling, we conform to the methodologies previously established in Malladi et al. []. Our implementation utilizes the default configuration provided by the transformers [] package. We do not turn on any advanced memory optimization technique, such as gradient checkpointing. For multi-GPU backpropagation, we utilize the Fully Sharded Data Parallel (FSDP) [] by PyTorch []. We use Nvidia’s nvidia-smi command to monitor the GPU memory usage. We report the maximum GPU memory consumption observed throughout all experiments.

## Appendix E Roberta-large experiments

Figure: Figure 7: Experiments on RoBERTa-large: 16/32-bit Addax outperform zero-shot and MeZO across all tasks and outperform Adam in four out of six tasks. Detailed numbers can be found in Table 11.
Refer to caption: x15.png

### E.1 RoBERTa-large experiments main results

Table 11 reports the detailed numbers of the accuracy on the RoBERTa-large model across different fine-tuning methods that are shown in Figure 7. For the accuracy of MeZO and Adam, we directly report the results from Malladi et al. [].

**Table 11: Experiments on RoBERTa-large (350M parameters). 16-bit Addax and 32-bit Addax outperform zero-shot and MeZO across the board on $6$ tasks while surpassing Adam in four out of six tasks. All experiments use prompts (Appendix D.3). For the accuracy of 32-bit MeZO and 32-bit Adam, we report the results from Malladi et al. [].**
| Task | SST-2 | SST-5 | SNLI | MNLI | RTE | TREC |
| --- | --- | --- | --- | --- | --- | --- |
| Type | sentiment | natural language inference | topic |  |  |  |
| Zero-shot | 79.0 | 35.5 | 50.2 | 48.8 | 51.4 | 32.0 |
| Samples per classes: $k\ =\ 16$ |  |  |  |  |  |  |
| 32-bit MeZO | 90.5 | 45.5 | 68.5 | 58.7 | 64.0 | 76.9 |
| 32-bit Addax | 90.6 | 49.1 | 79.3 | 69.9 | 64.6 | 89.6 |
| 16-bit Addax | 91.4 | 50.4 | 79.3 | 68.2 | 67.2 | 90.8 |
| 32-bit Adam | 91.9 | 47.5 | 77.5 | 70.0 | 66.4 | 85.0 |

### E.2 Investigation on the hyper-parameters of Addax

In this section, we explore the effect of different hyper-parameters, specifically reporting on the accuracy of both 32-bit and 16-bit Addax across various tasks utilizing the RoBERTa-large model using different combinations of hyper-parameters. We include the combinations of $\alpha$ and $\frac{K^{1}}{K^{0}+K^{1}}$ for 32-bit and 16-bit Addax in Figure 8 and Figure 9. Generally, it is observed that an increase in the ratio $\frac{K^{1}}{K^{0}+K^{1}}$ correlates with improved accuracy across tasks for both 16-bit and 32-bit Addax configurations, as evidenced by the top row of the heatmaps for each task in Figure 8 and Figure 9. We did not identify a consistent trend for $\alpha$ across different tasks for both 16-bit and 32-bit Addax, suggesting that the optimal $\alpha$ could be task-specific.

Figure: (a) Task: SST-2
Refer to caption: x16.png

Figure: (a) Task: SST-2
Refer to caption: x22.png

## Appendix F OPT and Llama experiments

### F.1 OPT-13B experiments main results

Table: Table 12: Experiments on OPT-13B (with 1,000 examples) using a single A100 (40GB) GPU except for Adam, which is run on five H100 GPUs (350GB total). Addax consistently outperforms zero-shot, MeZO, and IP-SGD across nine tasks and surpasses Adam in seven of the nine tasks. An asterisk (*) indicates runs that encountered out-of-memory errors during training, even with the smallest possible batch size.

Table 12 reports the detailed numbers of the accuracy on the OPT-13B model across different fine-tuning methods shown in Figure 2. Details on batch size, time to the best validation checkpoint, and memory for different algorithms are also available in Table 12. We also report GPU memory consumption across tasks and different fine-tuning methods for the OPT-13B model in Figure 2, with the exact number reported in Table 12. See Appendix D.7 for memory profiling details.

### F.2 OPT-30B, OPT-66B and Llama-2-70B experiments main results

Tables 13, 14, 15 present the complete results of fine-tuning OPT-30B and OPT-66B with Addax-P, SGD, IP-SGD, and MeZO, including metrics such as accuracy, memory usage, and batch size/$(K^{1},K^{0})$. Figures 2 and 10 show the corresponding data.

Table: Table 13: Experiments on OPT-30B (with 1000 examples) on a one H100 (80GB) GPU. * means the run encounters out-of-memory errors during training.

Figure: Figure 10: Accuracy/F-1 score, memory, and convergence time resulted from fine-tuning OPT-66B model with zero-shot, MeZO, SGD, IP-SGD, and Addax on 3 H100 GPU (240GB total). The label “OOM” means the run encounters out-of-memory errors during fine-tuning. The exact numbers related to this figure can be found in Table 14 in Appendix F.2.
Refer to caption: x28.png

Table: Table 14: Experiments on OPT-66B (with 1000 examples) on three GPUs (240GB total). * means the run encounters out-of-memory errors during training.

Table: Table 15: Experiments on Llama-2-70B (with 1000 examples) on three H100 (80GB) GPUs. * means the run encounters out-of-memory errors during training.

### F.3 Convergence speed of different tuning methods on the OPT-13B model

In this section, we demonstrate that 16-bit Addax reaches a convergence speed comparable to 16-bit SGD, despite SGD using $4\times$ more first-order samples for backward propagation. Meanwhile, Addax memory consumption is comparable to MeZO. The comparison of convergence speeds across the three methods is illustrated in Figure 11. For MeZO and SGD, the batch size is set to $16$, while for Addax, we configure $(K^{1},K^{0})$ as $(4,12)$. The learning rate for Addax is set at $\eta=1\mathrm{e}-4$. For SGD, the learning rates are $\eta=\{5\mathrm{e}-3,1\mathrm{e}-2,5\mathrm{e}-2\}$. For MeZO, we utilize learning rates of $\eta=\{1\mathrm{e}-6,1\mathrm{e}-7\}$. We select the hyper-parameters that yield the best validation accuracy across three methods. We utilize a single H100 GPU (80GB total) for running both Addax and MeZO, whereas SGD requires two H100 GPUs (160GB total). MeZO requires significantly more steps (20K steps) to converge compared to Addax and SGD (1K steps). Addax, using a smaller first-order batch size of $K^{1}=4$, achieves a convergence speed comparable to SGD with a batch size of 16 while requiring significantly less memory.

Figure: (a) Task: RTE
Refer to caption: x29.png

## Appendix G Theoretical Results and Proofs

### G.1 List of Assumptions

###### Assumption G.1 .

$\ell(\bm{\theta};x)$ is $L$-Lipschitz smooth, i.e.,

$$ $\left\lVert\nabla\ell(\bm{\theta};x)-\nabla\ell(\bm{\theta}^{\prime};x)\right \rVert\leq L\left\lVert\bm{\theta}-\bm{\theta}^{\prime}\right\rVert,\forall\bm {\theta},\bm{\theta}^{\prime}\in\mathbb{R}^{d},x\in\mathcal{D}.$ $$

###### Assumption G.2 .

The stochastic gradient is unbiased and has bounded variance, i.e.,

$$ $\mathbb{E}_{x}[\nabla\ell(\bm{\theta};x)]=\nabla\mathcal{L}(\bm{\theta}),\; \mathbb{E}_{x}[\left\lVert\nabla\ell(\bm{\theta};x)-\nabla\mathcal{L}(\bm{ \theta})\right\rVert^{2}]\leq\sigma^{2},\forall\bm{\theta}\in\mathbb{R}^{d}.$ $$

###### Assumption G.3 (Low effective rank Hessian) .

There exists a matrix $0\preceq{\bm{H}}\preceq L\cdot{\bm{I}}_{d}$ such that $\nabla^{2}\mathcal{L}(\mathbf{x})\preceq{\bm{H}}$, and the effective rank of ${\bm{H}}$ is at most $r$, i.e.,

$$ $\mathrm{tr}\left({\bm{H}}\right)\leq Lr.$ $$

###### Assumption G.4 .

$\mathcal{L}(\bm{\theta})$ is $\mu$-convex, i.e.,

$$ $\mathcal{L}(\bm{\theta})\geq\mathcal{L}(\bm{\theta}^{\prime})+\left\langle \nabla\mathcal{L}(\bm{\theta}^{\prime}),\bm{\theta}-\bm{\theta}^{\prime}\right \rangle+\frac{\mu}{2}\left\lVert\bm{\theta}-\bm{\theta}^{\prime}\right\rVert^{ 2},\forall\bm{\theta},\bm{\theta}^{\prime}\in\mathbb{R}^{d}.$ $$

###### Assumption G.1 .

###### Assumption G.2 .

###### Assumption G.3 (Low effective rank Hessian) .

###### Assumption G.4 .

### G.2 Useful Lemmas

###### Lemma G.5 ( Gao et al. [ 19 ] , Lemma 4.1 (b)) .

Suppose Assumption G.1 holds, then the expected gradient estimated with SPSA is a biased estimation of $\nabla\mathcal{L}(\bm{\theta})$ and satisfies

$$ $\left\lVert\mathbb{E}_{\mathcal{B},\mathbf{z}}[\hat{\nabla}\mathcal{L}(\bm{ \theta};\mathcal{B})]-\nabla\mathcal{L}(\bm{\theta})\right\rVert^{2}\leq\frac{ \epsilon^{2}L^{2}d^{2}}{4}.$ $$

###### Lemma G.6 ( Malladi et al. [ 42 ] , Lemma 2) .

Suppose Assumption G.1 and Assumption G.2 holds, then the variance of the gradient estimated with SPSA satisfies

$$ $\mathrm{Var}(\hat{\nabla}\mathcal{L}(\bm{\theta};\mathcal{B}))=\mathbb{E}_{ \mathcal{B}}\left[\left\lVert\mathbb{E}_{\mathcal{B}}[\hat{\nabla}\mathcal{L}( \bm{\theta};\mathcal{B})]-\hat{\nabla}\mathcal{L}(\bm{\theta};\mathcal{B}) \right\rVert^{2}\right]\leq{\frac{d}{K}}\sigma^{2}.$ $$

###### Lemma G.7 ( Zhang et al. [ 66 ] , Lemma C.1 (iv)) .

Let $\mathbf{z}\sim\mathcal{N}(0,{\bm{I}}_{d})$, ${\bm{v}}\in\mathbb{R}^{d}$ be some fixed vector, ${\bm{H}}\in\mathbb{R}^{d\times d}$ be some fixed matrix independent of $\mathbf{z}$, we have:

$$ $\mathbb{E}_{\mathbf{z}}[(\mathbf{z}^{\top}{\bm{v}})^{2}\mathbf{z}^{\top}{\bm{H }}\mathbf{z}]=\frac{d}{d+2}\left(2{\bm{v}}^{\top}{\bm{H}}{\bm{v}}+\left\lVert{ \bm{v}}\right\rVert^{2}\mathrm{tr}\left({\bm{H}}\right)\right).$ $$

###### Lemma G.5 ( Gao et al. [ 19 ] , Lemma 4.1 (b)) .

###### Lemma G.6 ( Malladi et al. [ 42 ] , Lemma 2) .

###### Lemma G.7 ( Zhang et al. [ 66 ] , Lemma C.1 (iv)) .

### G.3 Convergence analysis of Addax in smooth nonconvex setting when 𝒟 0 superscript 𝒟 0 \mathcal{D}^{0} caligraphic_D start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT and 𝒟 1 superscript 𝒟 1 \mathcal{D}^{1} caligraphic_D start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT are same

The following Theorem is the precise statement of the result behind Theorem 3.1 presented in the main body.

###### Theorem G.8 .

Under Assumptions G.1, G.2, by running Algorithm 1 for $T$ iterations with $0<\eta_{t}=\eta\leq\frac{2-\alpha}{4L},\forall t$, the output satisfies

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]\leq\frac{4(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star})}{\eta T (2-\alpha)}$ (4) $\displaystyle\quad+\frac{\alpha(1+\alpha-\alpha^{2}/2)\epsilon^{2}L^{2}d^{2}}{ 2(2-\alpha)}+\frac{4\eta L}{(2-\alpha)}\left(\frac{(1-\alpha)^{2}}{2K^{1}}+ \frac{\alpha^{2}d}{2K^{0}}\right)\sigma^{2}.$ $$

Proof:
By Assumption G.1:

$$ $\displaystyle\mathbb{E}_{t}[\mathcal{L}(\bm{\theta}_{t+1})]$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{t})+\mathbb{E}_{t}[\left\langle \nabla\mathcal{L}(\bm{\theta}_{t}),\bm{\theta}_{t+1}-\bm{\theta}_{t}\right \rangle]+\frac{L}{2}\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{t }\right\rVert^{2}]$ (5) $\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha)\nabla \mathcal{L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla} \mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{L\eta_{t}^{2}}{2}\left\lVert(1-\alpha)\nabla\mathcal{ L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L} (\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ $\displaystyle\quad+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2}\mathbb{E}_{\mathcal{B }^{1}}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})-\nabla\mathcal{L}(\bm{ \theta}_{t};\mathcal{B}^{1})\right\rVert^{2}]+\frac{L\eta_{t}^{2}\alpha^{2}}{2 }\mathrm{Var}(\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0}))$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- (1-\alpha)\eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2 }-\alpha\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{L\eta_{t}^{2}}{2}\left\lVert(1-\alpha)\nabla\mathcal{ L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L} (\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ $\displaystyle\quad+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{ L\eta_{t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2},$ $$

where $(a)$ substitutes the update of $\bm{\theta}$ and takes expectations to $\bm{g}^{0},\bm{g}^{1}$;$(b)$ follows from the Lemma G.6. The third term on the Right-Hand-Side (RHS) can be further bounded as

$$ $\displaystyle-\alpha\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}), \mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0 })]\right\rangle$ (6) $\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}-\frac{\alpha\eta_{t}}{2}\left \lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}-\frac{\alpha\eta_{t}} {2}\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t}; \mathcal{B}^{0})]\right\rVert^{2}+\frac{\alpha\eta_{t}}{2}\left\lVert\nabla \mathcal{L}(\bm{\theta}_{t})-\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal {L}(\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}-\frac{\alpha\eta_{t}}{2} \left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}-\frac{\alpha\eta _{t}}{2}\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta _{t};\mathcal{B}^{0})]\right\rVert^{2}+\frac{\alpha\eta_{t}\epsilon^{2}L^{2}d^ {2}}{8},$ $$

where $(a)$ uses the fact that $\left\lVert\mathbf{u}+\mathbf{v}\right\rVert^{2}=\left\lVert\mathbf{u}\right
\rVert^{2}+\left\lVert\mathbf{v}\right\rVert^{2}+2\left\langle\mathbf{u},
\mathbf{v}\right\rangle$; $(b)$ applies Lemma G.5 to the last term. The fourth term on the RHS of equation (5) can be bounded as

$$ $\displaystyle\frac{L\eta_{t}^{2}}{2}\left\lVert(1-\alpha)\nabla\mathcal{L}(\bm {\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}( \theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ (7) $\displaystyle=\frac{L\eta_{t}^{2}}{2}\left\lVert\nabla\mathcal{L}(\bm{\theta}_ {t})+\alpha\left(\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{ t};\mathcal{B}^{0})]-\nabla\mathcal{L}(\bm{\theta}_{t})\right)\right\rVert^{2}$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}L\eta_{t}^{2}\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}+\alpha^{2}L\eta_{t}^{2} \left\lVert\left(\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{ t};\mathcal{B}^{0})]-\nabla\mathcal{L}(\bm{\theta}_{t})\right)\right\rVert^{2}$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}L\eta_{t}^{2}\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}+\frac{\alpha^{2}\eta_{t}^{2 }\epsilon^{2}L^{3}d^{2}}{4},$ $$

where $(a)$ applies Cauchy-Schwarz inequality;
$(b)$ applies Lemma G.5 to the last term. Substitute equation (6), equation (7) back to equation (5), we have

$$ $\displaystyle\mathbb{E}_{t}[\mathcal{L}(\bm{\theta}_{t+1})]$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{t})-(1-\frac{\alpha}{2}-L\eta_{t}) \eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}-\frac{ \alpha\eta_{t}}{2}\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal {L}(\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ (8) $\displaystyle\quad+\frac{\alpha\eta_{t}\epsilon^{2}L^{2}d^{2}(1+2\alpha\eta_{t }L)}{8}+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\eta_{t}^{ 2}\alpha^{2}}{2K^{0}}\sigma^{2}.$ $$

Choose $\eta_{t}\leq\frac{2-\alpha}{4L}$, we have $1-\frac{\alpha}{2}-L\eta_{t}\geq\frac{2-\alpha}{4}>0$, $1+2\alpha\eta_{t}L\leq 1+\alpha-\frac{\alpha^{2}}{2}$ and

$$ $\displaystyle\frac{(2-\alpha)\eta_{t}}{4}\left\lVert\nabla\mathcal{L}(\bm{ \theta}_{t})\right\rVert^{2}$ $\displaystyle+\frac{\alpha\eta_{t}}{2}\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[ \hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}\leq \mathcal{L}(\bm{\theta}_{t})-\mathbb{E}_{t}[\mathcal{L}(\bm{\theta}_{t+1})]$ (9) $\displaystyle\quad+\frac{\alpha\eta_{t}\epsilon^{2}L^{2}d^{2}(1+\alpha-\alpha^ {2}/2)}{8}+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\eta_{t }^{2}\alpha^{2}}{2K^{0}}\sigma^{2}.$ $$

Sum from $t=0$ to $T$, we have

$$ $\displaystyle\sum^{T}_{t=0}$ $\displaystyle\left(\frac{(2-\alpha)\eta_{t}}{4}\mathbb{E}[\left\lVert\nabla \mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}]+\frac{\alpha\eta_{t}}{2}\mathbb{ E}\left[\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta _{t};\mathcal{B}^{0})]\right\rVert^{2}\right]\right)\leq\mathcal{L}(\bm{\theta }_{0})-\mathbb{E}[\mathcal{L}(\bm{\theta}_{T+1})]$ (10) $\displaystyle\quad+\sum^{T}_{t=0}\eta_{t}\cdot\frac{\alpha(1+\alpha-\alpha^{2} /2)\epsilon^{2}L^{2}d^{2}}{8}+\sum^{T}_{t=0}\eta_{t}^{2}\cdot\left(\frac{L(1- \alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\alpha^{2}d}{2K^{0}}\sigma^{2}\right).$ $$

Choose $\eta_{t}=\eta\leq\frac{2-\alpha}{4L},\forall t,$ and divide both side by $\frac{(2-\alpha)\eta T}{4}$, we have

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]+\frac{2\alpha}{2-\alpha}\mathbb{E}\left[\left\lVert\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right \rVert^{2}\right]\leq\frac{4(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}) }{\eta T(2-\alpha)}$ (11) $\displaystyle\quad+\frac{\alpha(1+\alpha-\alpha^{2}/2)\epsilon^{2}L^{2}d^{2}}{ 2(2-\alpha)}+\frac{4\eta L}{(2-\alpha)}\left(\frac{(1-\alpha)^{2}}{2K^{1}}+ \frac{\alpha^{2}d}{2K^{0}}\right)\sigma^{2},$ $$

which completes the proof.

###### Corollary G.9 .

By choosing $\eta=\min\left\{\frac{2-\alpha}{4L},\sqrt{\frac{2(\mathcal{L}(\bm{\theta}_{0})
-\mathcal{L}_{\star})}{TL\sigma^{2}\left(\frac{(1-\alpha)^{2}}{K^{1}}+\frac{
\alpha^{2}d}{K^{0}}\right)}}\right\}$ and

$$ $\epsilon\leq\left(\frac{2(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}) \sigma^{2}\left((1-\alpha)^{2}/K^{1}+\alpha^{2}d/K^{0}\right)}{T}\right)^{1/4} \cdot\frac{1}{L^{3/4}d\sqrt{\alpha(1+\alpha-\alpha^{2}/2)}},$ $$

Algorithm 1 converges with rate

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq 5\sqrt{2L}\cdot\frac{\sqrt{\frac{(1-\alpha)^{2}}{K^{1}}+ \frac{\alpha^{2}d}{K^{0}}}}{2-\alpha}\cdot\sigma\sqrt{\frac{\mathcal{L}(\bm{ \theta}_{0})-\mathcal{L}_{\star}}{T}}$ $\displaystyle=\mathcal{O}\left(\frac{1}{\sqrt{T}}\cdot\sqrt{\frac{(1-\alpha)^{ 2}}{K^{1}}+\frac{\alpha^{2}d}{K^{0}}}\right)$ $$

###### Theorem G.8 .

###### Corollary G.9 .

### G.4 Convergence analysis of Addax in smooth nonconvex setting when 𝒟 0 superscript 𝒟 0 \mathcal{D}^{0} caligraphic_D start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT and 𝒟 1 superscript 𝒟 1 \mathcal{D}^{1} caligraphic_D start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT are different

Assume that datasets $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$ are different. Consider loss functions $\mathcal{L}$, $\mathcal{L}^{0}$, and $\mathcal{L}^{1}$, where $\mathcal{L}^{0}$ and $\mathcal{L}^{1}$ are evaluated on datasets $\mathcal{D}^{0}$ and $\mathcal{D}^{1}$ of sizes $N^{0}$ and $N^{1}$, respectively. The combined loss function $\mathcal{L}$ is defined as:

$$ $\mathcal{L}=\frac{(N^{0}\mathcal{L}^{0}+N^{1}\mathcal{L}^{1})}{N^{0}+N^{1}}$ $$

###### Theorem G.10 .

Assuming that the loss functions $\mathcal{L}$, $\mathcal{L}^{0}$, and $\mathcal{L}^{1}$ satisfy Assumptions G.1 and G.2 and $L_{T}\leq L_{max}$, running Algorihtm 1 for $T$ iterations with a learning rate $0<\eta_{t}=\eta\leq\frac{2\alpha}{L},\forall t$, $\epsilon^{1/2}\leq\frac{1}{\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert}$ and choose $\alpha=\frac{N^{0}}{N^{0}+N^{1}}$, the output satisfies

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\frac{\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}}{\eta T (1-\alpha)}$ (12) $\displaystyle\quad+\frac{\epsilon^{1/2}Ld\alpha(6+\epsilon^{3/2}Ld\alpha^{2})} {4(1-\alpha)}+\frac{\eta L}{(1-\alpha)}\left(\frac{(1-\alpha)^{2}}{2K^{1}}+ \frac{\alpha^{2}d}{2K^{0}}\right)\sigma^{2}$ $$

Proof:
By Assumption G.1:

$$ $\displaystyle\mathbb{E}_{t}[\mathcal{L}(\bm{\theta}_{t+1})]$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{t})+\mathbb{E}_{t}[\left\langle \nabla\mathcal{L}(\bm{\theta}_{t}),\bm{\theta}_{t+1}-\bm{\theta}_{t}\right \rangle]+\frac{L}{2}\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{t }\right\rVert^{2}]$ (13) $\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha)\nabla \mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{ \nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{L\eta_{t}^{2}}{2}\left\lVert(1-\alpha)\nabla\mathcal{ L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla} \mathcal{L}^{0}(\bm{\theta}_{t};\mathcal{B}^{0})]\right\rVert^{2}$ $\displaystyle\quad+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2}\mathbb{E}_{\mathcal{B }^{1}}[\left\lVert\nabla\mathcal{L}^{1}(\bm{\theta}_{t})-\nabla\mathcal{L}^{1} (\bm{\theta}_{t};\mathcal{B}^{1})\right\rVert^{2}]+\frac{L\eta_{t}^{2}\alpha^{ 2}}{2}\mathrm{Var}(\hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0}))$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha)\nabla \mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{ \nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{L\eta_{t}^{2}}{2}\left(\left\lVert(1-\alpha)\nabla \mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\nabla\mathcal{L}^{0}(\bm{\theta}_{t}) \right\rVert+\left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}^{ 0}(\bm{\theta}_{t};\mathcal{B}^{0})]-\nabla\mathcal{L}^{0}(\bm{\theta}_{t}) \right\rVert\right)^{2}$ $\displaystyle\quad+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{ L\eta_{t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2}$ $\displaystyle\stackrel{{\scriptstyle(c)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha)\nabla \mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{ \nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{L\eta_{t}^{2}}{2}\left\lVert\nabla\mathcal{L}(\bm{ \theta}_{t})\right\rVert^{2}+\frac{L^{2}\eta_{t}^{2}\epsilon d}{2}\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert+\frac{\epsilon^{2}L^{3}\eta_{t} ^{2}\alpha^{2}d^{2}}{8}$ $\displaystyle\quad+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{ L\eta_{t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2}$ $$

where $(a)$ substitutes the update of $\bm{\theta}$ and takes expectation of $\bm{g}^{0}$, $\bm{g}^{1}$; $(b)$ add and subtract $\alpha\nabla\mathcal{L}^{0}(\bm{\theta}_{t})$ and Cauchy-Schwartz inequality to the third term and the last two terms follow from the Lemma G.6; $(c)$ follows from the Lemma G.5. The second term on the Right-Hand-Side (RHS) can be further bounded by

$$ $\displaystyle-\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha )\nabla\mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[ \hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ (14) $\displaystyle=-\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1- \alpha)\nabla\mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\nabla\mathcal{L}^{0}(\bm{ \theta}_{t})-\alpha\nabla\mathcal{L}^{0}(\bm{\theta}_{t})+\alpha\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle=-\eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}-\alpha\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}), \mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B }^{0})]-\nabla\mathcal{L}^{0}(\bm{\theta}_{t})\right\rangle$ $$

The second term in equation (14) can be further bounded by

$$ $\displaystyle-\alpha\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}), \mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B }^{0})]-\nabla\mathcal{L}^{0}(\bm{\theta}_{t})\right\rangle$ (15) $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\alpha\eta_{t}\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert\left\lVert\mathbb{E}_{\mathcal{ B}^{0}}[\hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]-\nabla \mathcal{L}^{0}(\bm{\theta}_{t})\right\rVert$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}\frac{\alpha\eta_{t}\epsilon Ld }{2}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert$ $$

where $(a)$ applies Cauchy-Schwartz inequality; $(b)$ applies Lemma G.5. Substitute equation (16) back to equation (14), we have

$$ $\displaystyle-\eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha )\nabla\mathcal{L}^{1}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[ \hat{\nabla}\mathcal{L}^{0}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ (16) $\displaystyle\leq-\eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}+\frac{\alpha\eta_{t}\epsilon Ld}{2}\left\lVert\nabla\mathcal{L}(\bm {\theta}_{t})\right\rVert$ $$

Substitute equation (16) back to equation (13), we have

$$ $\displaystyle\mathbb{E}_{t}[\mathcal{L}(\bm{\theta}_{t+1})]$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{t})-(1-\frac{L\eta_{t}}{2})\eta_{t} \left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}$ (17) $\displaystyle\quad+\frac{\epsilon Ld(\alpha+L\eta_{t})}{2}\eta_{t}\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert+\frac{\epsilon^{2}L^{3}\eta_{t} \alpha^{2}d^{2}}{8}\eta_{t}+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{ 2}+\frac{L\eta_{t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2}$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- (1-\frac{L\eta_{t}}{2})\eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t}) \right\rVert^{2}$ $\displaystyle\quad+\frac{\epsilon^{1/2}Ld(\alpha+L\eta_{t})}{2}\eta_{t}+\frac{ \epsilon^{2}L^{3}\eta_{t}\alpha^{2}d^{2}}{8}\eta_{t}+\frac{L\eta_{t}^{2}(1- \alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\eta_{t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2}$ $$

where $(a)$ choose that $\epsilon^{1/2}\leq\frac{1}{\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert}$, then $\epsilon^{1/2}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert\leq 1$.

Choose $\eta_{t}\leq\frac{2\alpha}{L}$, we have $1-\frac{L\eta_{t}}{2}\geq 1-\alpha>0$, $\eta_{t}L\leq 2\alpha$ and

$$ $\displaystyle(1-\alpha)\eta_{t}\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t}) \right\rVert^{2}$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{t})-\mathbb{E}_{t}[\mathcal{L}(\bm{ \theta}_{t+1})]$ (18) $\displaystyle\quad+\frac{\epsilon^{1/2}Ld\alpha(6+\epsilon^{3/2}Ld\alpha^{2})} {4}\eta_{t}+\frac{L\eta_{t}^{2}(1-\alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\eta_{ t}^{2}\alpha^{2}d}{2K^{0}}\sigma^{2}$ $$

Sum from $t=0$ to $T$ we have

$$ $\displaystyle\sum^{T}_{t=0}\left((1-\alpha)\eta_{t}\mathbb{E}[\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}]\right)$ $\displaystyle\leq\mathcal{L}(\bm{\theta}_{0})-\mathbb{E}[\mathcal{L}(\bm{ \theta}_{T+1})]$ (19) $\displaystyle\quad+\sum^{T}_{t=0}\frac{\epsilon^{1/2}Ld\alpha(6+\epsilon^{3/2} Ld\alpha^{2})}{4}\eta_{t}+\sum^{T}_{t=0}\eta_{t}^{2}\cdot\left(\frac{L(1- \alpha)^{2}}{2K^{1}}\sigma^{2}+\frac{L\alpha^{2}d}{2K^{0}}\sigma^{2}\right)$ $$

Choosing $\eta_{t}=\eta\leq\frac{2\alpha}{L},\forall t$ and dividing both sides by $(1-\alpha)\eta T$, we have

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\frac{\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}}{\eta T (1-\alpha)}$ (20) $\displaystyle\quad+\frac{\epsilon^{1/2}Ld\alpha(6+\epsilon^{3/2}Ld\alpha^{2})} {4(1-\alpha)}+\frac{\eta L}{(1-\alpha)}\left(\frac{(1-\alpha)^{2}}{2K^{1}}+ \frac{\alpha^{2}d}{2K^{0}}\right)\sigma^{2}$ $$

where the expectation is taken over $t$ (uniformly) and the randomness of the algorithm. This completes the proof.

###### Corollary G.11 .

By choosing $\eta=\min\left\{\frac{2\alpha}{L},\sqrt{\frac{2(\mathcal{L}(\bm{\theta}_{0})-
\mathcal{L}_{\star})}{TL\sigma^{2}\left(\frac{(1-\alpha)^{2}}{K^{1}}+\frac{
\alpha^{2}d}{K^{0}}\right)}}\right\}$ and

$$ $\epsilon\leq\min\left\{\begin{array}[]{c}\frac{1}{\left\lVert\nabla\mathcal{L} (\bm{\theta}_{t})\right\rVert^{2}}\\ \left(\frac{(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star})\sigma^{2}\left( (1-\alpha)^{2}/K^{1}+\alpha^{2}d/K^{0}\right)}{2T}\right)^{1/4}\cdot\frac{2}{L ^{3/4}d\alpha^{3/2}}\\ \frac{2(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star})\sigma^{2}\left((1- \alpha)^{2}/K^{1}+\alpha^{2}d/K^{0}\right)}{9TLd^{2}\alpha^{2}}\end{array}\right\}$ $$

Addax converges with rate

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\frac{\sqrt{2L}}{2}\cdot\frac{\sqrt{\frac{(1-\alpha)^{2}}{K^{ 1}}+\frac{\alpha^{2}d}{K^{0}}}}{1-\alpha}\cdot\sigma\sqrt{\frac{\mathcal{L}( \bm{\theta}_{0})-\mathcal{L}_{\star}}{T}}$ $\displaystyle=\mathcal{O}\left(\frac{1}{\sqrt{T}}\cdot\sqrt{\frac{(1-\alpha)^{ 2}}{K^{1}}+\frac{\alpha^{2}d}{K^{0}}}\right)$ $$

###### Theorem G.10 .

###### Corollary G.11 .

### G.5 Convergence of Addax with low efficient rank Hessian

###### Theorem G.12 .

Under Assumption G.1-Assumption G.3, by running Algorithm 1 for T iterations with $\eta_{t}=\eta\leq\min\{\frac{1}{(1-\alpha)L},\frac{2-\alpha}{1-\alpha+2\alpha^
{2}L(2+r)}\},\forall t,$ the output satisfies

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\frac{\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}}{\eta C _{1}T}+\frac{\alpha\epsilon^{2}L^{2}d^{2}\left(1+2\eta\alpha Lr\right)}{8C_{1}}$ $\displaystyle\quad+\frac{\eta L\sigma^{2}}{2C_{1}}\left(\frac{(1-\alpha)^{2}}{ K^{1}}+\frac{2(2+r)\alpha^{2}}{K^{0}}\right),$ (21) $$

where $C_{1}=1-\frac{\alpha}{2}-\frac{\eta L}{2}\left(1-\alpha+2\alpha^{2}L(2+r)
\right).$

Proof:
Using the Taylor expansion with Lagrange remainder, we have:

$$ $\displaystyle\mathcal{L}(\bm{\theta}_{t+1})=\mathcal{L}(\bm{\theta}_{t})+\left \langle\nabla\mathcal{L}(\bm{\theta}_{t}),\bm{\theta}_{t+1}-\bm{\theta}_{t} \right\rangle+\frac{1}{2}(\bm{\theta}_{t+1}-\bm{\theta}_{t})^{\top}\nabla \mathcal{L}(\bm{\theta}^{\prime})(\bm{\theta}_{t+1}-\bm{\theta}_{t}),$ (22) $$

where $\bm{\theta}^{\prime}=\lambda\bm{\theta}_{t}+(1-\lambda)\bm{\theta}_{t+1},$ for some $\lambda\in[0,1].$
Taking expectation conditioned on everything until $t$, we have:

$$ $\displaystyle\mathbb{E}_{t}$ $\displaystyle[\mathcal{L}(\bm{\theta}_{t+1})]=\mathcal{L}(\bm{\theta}_{t})+ \left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),\mathbb{E}_{t}[\bm{\theta}_{t+1 }-\bm{\theta}_{t}]\right\rangle+\frac{1}{2}\mathbb{E}_{t}\left[(\bm{\theta}_{t +1}-\bm{\theta}_{t})^{\top}\nabla\mathcal{L}(\bm{\theta}^{\prime})(\bm{\theta} _{t+1}-\bm{\theta}_{t})\right]$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),(1-\alpha)\nabla \mathcal{L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla} \mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{\eta_{t}^{2}}{2}\mathbb{E}\left[\left\langle(1-\alpha )\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{1})+\alpha\hat{\nabla}\mathcal {L}(\bm{\theta}_{t};\mathcal{B}^{0}),\right.\right.$ $\displaystyle\qquad\qquad\left.\left.{\bm{H}}\left((1-\alpha)\nabla\mathcal{L} (\bm{\theta}_{t};\mathcal{B}^{1})+\alpha\hat{\nabla}\mathcal{L}(\bm{\theta}_{t };\mathcal{B}^{0})\right)\right\rangle\right]$ $\displaystyle=\mathcal{L}(\bm{\theta}_{t})-\eta_{t}(1-\alpha)\left\lVert\nabla \mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}-\eta_{t}\alpha\left\langle\nabla \mathcal{L}(\bm{\theta}_{t}),\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal {L}(\bm{\theta}_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{\eta_{t}^{2}(1-\alpha)^{2}}{2}\mathbb{E}_{\mathcal{B} _{1}}\left[\left\langle\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{1}),{\bm {H}}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{1})\right\rangle\right]$ $\displaystyle\quad+\frac{\eta_{t}^{2}\alpha^{2}}{2}\mathbb{E}_{\mathcal{B}^{0} }\left[\left\langle\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}),{ \bm{H}}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right\rangle\right]$ $\displaystyle\quad+\eta_{t}^{2}\alpha(1-\alpha)\left\langle\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})],{ \bm{H}}\mathbb{E}_{\mathcal{B}^{1}}[\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal {B}^{1})]\right\rangle$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}\mathcal{L}(\bm{\theta}_{t})- \eta_{t}(1-\alpha)\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2 }-\eta_{t}\alpha\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\quad+\frac{\eta_{t}^{2}(1-\alpha)^{2}L}{2}\left(\left\lVert \nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}+\frac{\sigma^{2}}{K^{1}}\right)$ $\displaystyle\quad+\frac{\eta_{t}^{2}\alpha^{2}}{2}\mathbb{E}_{\mathcal{B}^{0} }\left[\left\langle\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}),{ \bm{H}}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right\rangle\right]$ $\displaystyle\quad+\eta_{t}^{2}\alpha(1-\alpha)\left\langle\nabla\mathcal{L}( \bm{\theta}_{t}),{\bm{H}}\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}( \bm{\theta}_{t};\mathcal{B}^{0})]\right\rangle,$ (23) $$

where $(a)$ substitute the update rule of Algorithm 1; $(b)$ uses the fact that $\mathcal{B}^{0}$ and $\mathcal{B}^{1}$ are independent to the last term, and applies Assumption G.2 to the fourth term. Next, we bound the last two terms separately. For the fifth term, we have:

$$ $\displaystyle\mathbb{E}_{\mathcal{B}^{0}}$ $\displaystyle\left[\left\langle\hat{\nabla}\mathcal{L}(\bm{\theta}_{t}; \mathcal{B}^{0}),{\bm{H}}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{ 0})\right\rangle\right]=\mathbb{E}_{\mathcal{B}^{0}}\left[\mathrm{tr}\left( \left\langle\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}),{\bm{H}} \hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right\rangle\right)\right]$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}\mathbb{E}_{\mathcal{B}^{0}} \left[\mathrm{tr}\left({\bm{H}}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t}; \mathcal{B}^{0})^{\top}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right)\right]$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{=}}\mathrm{tr}\left({\bm{H}}\mathbb {E}_{\mathcal{B}^{0}}\left[\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B} ^{0})^{\top}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right]\right)$ (24) $$

where the $(a)$ uses the property to trace that $\mathrm{tr}\left(ABC\right)=\mathrm{tr}\left(BCA\right)$, and $(b)$ uses the fact that trace is a linear operator so $\mathbb{E}[\mathrm{tr}\left(\cdot\right)]=\mathrm{tr}\left(\mathbb{E}[\cdot]\right)$.
We have:

$$ $\displaystyle\mathbb{E}_{\mathcal{B}^{0},\mathbf{z}}$ $\displaystyle\left[\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})^{ \top}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right]=\mathbb{E }_{\mathcal{B}^{0},\mathbf{z}}\left[\left(\frac{\mathcal{L}(\bm{\theta}_{t}+ \epsilon\mathbf{z};\mathcal{B}^{0})-\mathcal{L}(\bm{\theta}_{t}-\epsilon \mathbf{z};\mathcal{B}^{0})}{2\epsilon}\right)^{2}\mathbf{z}\mathbf{z}^{\top}\right]$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\frac{1}{2\epsilon^{2}} \mathbb{E}_{\mathcal{B}^{0},\mathbf{z}}\left[(2\epsilon\mathbf{z}^{\top}\nabla \mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}))^{2}\mathbf{z}\mathbf{z}^{\top}\right]$ $\displaystyle\quad+\frac{1}{2\epsilon^{2}}\mathbb{E}_{\mathcal{B}^{0},\mathbf{ z}}\left[\left(\mathcal{L}(\bm{\theta}_{t}+\epsilon\mathbf{z};\mathcal{B}^{0}) -\mathcal{L}(\bm{\theta}_{t}-\epsilon\mathbf{z};\mathcal{B}^{0})-2\epsilon \mathbf{z}^{\top}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right)^{2} \mathbf{z}\mathbf{z}^{\top}\right]$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}2\mathbb{E}_{\mathcal{B}^{0}, \mathbf{z}}\left[(\mathbf{z}^{\top}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{ B}^{0}))^{2}\mathbf{z}\mathbf{z}^{\top}\right]$ $\displaystyle\quad+\frac{1}{\epsilon^{2}}\mathbb{E}_{\mathcal{B}^{0},\mathbf{z }}\left[\left(\mathcal{L}(\bm{\theta}_{t}+\epsilon\mathbf{z};\mathcal{B}^{0})- \mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})-\epsilon\mathbf{z}^{\top}\nabla \mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right)^{2}\mathbf{z}\mathbf{z}^{ \top}\right]$ $\displaystyle\quad+\frac{1}{\epsilon^{2}}\mathbb{E}_{\mathcal{B}^{0},\mathbf{z }}\left[\left(\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})-\mathcal{L}(\bm{ \theta}_{t}-\epsilon\mathbf{z};\mathcal{B}^{0})-\epsilon\mathbf{z}^{\top} \nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right)^{2}\mathbf{z}\mathbf {z}^{\top}\right]$ $\displaystyle\stackrel{{\scriptstyle Assumption\leavevmode\nobreak\ \ref{as: smooth}}}{{\leq}}2\mathbb{E}_{\mathcal{B}^{0},\mathbf{z}}\left[(\mathbf{z}^{ \top}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}))^{2}\mathbf{z}\mathbf{ z}^{\top}\right]+\frac{2}{\epsilon^{2}}\mathbb{E}_{\mathcal{B}^{0},\mathbf{z}} \left[\left(\frac{dL\epsilon^{2}}{2}\right)^{2}\mathbf{z}\mathbf{z}^{\top}\right]$ $\displaystyle\stackrel{{\scriptstyle(c)}}{{=}}2\mathbb{E}_{\mathcal{B}^{0}, \mathbf{z}}\left[(\mathbf{z}^{\top}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{ B}^{0}))^{2}\mathbf{z}\mathbf{z}^{\top}\right]+\frac{d^{2}L^{2}\epsilon^{2}}{2 }{\bm{I}}_{d},$ (25) $$

where $(a)$ extracts the constant, add and subtract $2\epsilon\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})$ and uses the Cauchy–Schwarz inequality; $(b)$ add and subtract $\mathcal{L}(\bm{\theta}_{t};\mathcal{B}_{0})$ to the second term, then applies the Cauchy–Schwarz inequality; by Assumption G.1, we have $\left\lvert\mathcal{L}(\bm{\theta}+\epsilon\mathbf{z};\mathcal{B})-\mathcal{L}
(\bm{\theta};\mathcal{B})-\epsilon\mathbf{z}^{\top}\nabla\mathcal{L}(\bm{
\theta};\mathcal{B})\right\rvert\leq\frac{L\epsilon^{2}d}{2};$ and $(c)$ uses the fact that $\mathbb{E}[\mathbf{z}\mathbf{z}^{\top}]={\bm{I}}_{d}$ as $\mathbf{z}\sim\mathcal{N}(0,{\bm{I}}_{d}).$
Substitute equation (25) to equation (G.5), we have:

$$ $\displaystyle\mathbb{E}_{\mathcal{B}^{0}}$ $\displaystyle\left[\left\langle\hat{\nabla}\mathcal{L}(\bm{\theta}_{t}; \mathcal{B}^{0}),{\bm{H}}\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{ 0})\right\rangle\right]$ $\displaystyle\leq 2\mathrm{tr}\left({\bm{H}}\mathbb{E}_{\mathcal{B}^{0}, \mathbf{z}}\left[(\mathbf{z}^{\top}\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{ B}^{0}))^{2}\mathbf{z}\mathbf{z}^{\top}\right]\right)+\mathrm{tr}\left(\frac{d ^{2}L^{2}\epsilon^{2}}{2}{\bm{H}}\right)$ $\displaystyle=2\mathbb{E}_{\mathcal{B}^{0},\mathbf{z}}\left[(\mathbf{z}^{\top} \nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}))^{2}\mathbf{z}^{\top}{\bm{H }}\mathbf{z}\right]+\frac{rd^{2}L^{3}\epsilon^{2}}{2}$ $\displaystyle\stackrel{{\scriptstyle Lemma\leavevmode\nobreak\ \ref{le:zz:exp} }}{{=}}\frac{2d}{d+2}\mathbb{E}_{\mathcal{B}^{0}}\left[2\nabla\mathcal{L}(\bm{ \theta}_{t};\mathcal{B}^{0})^{\top}{\bm{H}}\nabla\mathcal{L}(\bm{\theta}_{t}; \mathcal{B}^{0})+\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0}) \right\rVert^{2}\mathrm{tr}\left({\bm{H}}\right)\right]+\frac{rd^{2}L^{3} \epsilon^{2}}{2}$ $\displaystyle\stackrel{{\scriptstyle Assumption\leavevmode\nobreak\ \ref{as: low_rank}}}{{\leq}}\frac{2dL(2+r)}{d+2}\mathbb{E}_{\mathcal{B}_{0}}\left[\left \lVert\nabla\mathcal{L}(\bm{\theta}_{t};\mathcal{B}^{0})\right\rVert^{2}\right ]+\frac{rd^{2}L^{3}\epsilon^{2}}{2}$ $\displaystyle\stackrel{{\scriptstyle Assumption\leavevmode\nobreak\ \ref{as: variance}}}{{\leq}}\frac{2dL(2+r)}{d+2}\left(\left\lVert\nabla\mathcal{L}(\bm{ \theta}_{t})\right\rVert^{2}+\frac{\sigma^{2}}{K^{0}}\right)+\frac{rd^{2}L^{3} \epsilon^{2}}{2}.$ (26) $$

For the last term in equation (23), we applies the Cauchy–Schwarz inequality:

$$ $\displaystyle\left\langle\nabla\mathcal{L}(\bm{\theta}_{t}),{\bm{H}}\mathbb{E} _{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right \rangle\stackrel{{\scriptstyle(a)}}{{\leq}}\frac{L}{2}\left(\left\lVert\nabla \mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}+\left\lVert\mathbb{E}_{\mathcal{B }^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rVert^{2} \right),$ (27) $$

where $(a)$ applies the fact that $\left\langle a,b\right\rangle\leq\frac{1}{2}(\left\lVert a\right\rVert^{2}+
\left\lVert b\right\rVert^{2})$. Substitute equation (G.5), equation (27), and equation (6) back to equation (23), we have:

$$ $\displaystyle\mathbb{E}_{t}$ $\displaystyle[\mathcal{L}(\bm{\theta}_{t+1})]\leq\mathcal{L}(\bm{\theta}_{t})- \eta_{t}\left(1-\frac{\alpha}{2}-\frac{\eta_{t}L}{2}\left(1-\alpha+2\alpha^{2} L(2+r)\right)\right)\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^ {2}$ $\displaystyle\quad-\frac{\eta_{t}\alpha(1-\eta_{t}(1-\alpha)L)}{2}\left\lVert \mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\bm{\theta}_{t};\mathcal{ B}^{0})]\right\rVert^{2}$ $\displaystyle\quad+\frac{\eta_{t}\alpha\epsilon^{2}L^{2}d^{2}\left(1+2\eta_{t} \alpha Lr\right)}{8}+\frac{\eta_{t}^{2}L\sigma^{2}}{2}\left(\frac{(1-\alpha)^{ 2}}{K^{1}}+\frac{2(2+r)\alpha^{2}}{K^{0}}\right).$ $$

By setting $\eta_{t}=\eta\leq\min\{\frac{1}{(1-\alpha)L},\frac{2-\alpha}{1-\alpha+2\alpha^
{2}L(2+r)}\},$ summing from $t=0,\dots,T-1$, and divide both side by $\eta C_{1}T$, with $C_{1}=1-\frac{\alpha}{2}-\frac{\eta L}{2}\left(1-\alpha+2\alpha^{2}L(2+r)\right)$, we have:

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\frac{\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}}{\eta C _{1}T}+\frac{\alpha\epsilon^{2}L^{2}d^{2}\left(1+2\eta\alpha Lr\right)}{8C_{1}}$ $\displaystyle\quad+\frac{\eta L\sigma^{2}}{2C_{1}}\left(\frac{(1-\alpha)^{2}}{ K^{1}}+\frac{2(2+r)\alpha^{2}}{K^{0}}\right).$ (28) $$

The theorem is proved.

###### Corollary G.13 .

By choosing

$$ $\eta=\min\left\{\frac{1}{(1-\alpha)L},\frac{2-\alpha}{1-\alpha+2\alpha^{2}L(2+ r)},\sqrt{\frac{2(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star})}{TL\sigma^ {2}\left(\frac{(1-\alpha)^{2}}{K^{1}}+\frac{2(2+r)\alpha^{2}}{K^{0}}\right)}}\right\}$ $$

and

$$ $\epsilon\leq\left(\frac{32(\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star}) \sigma^{2}\left((1-\alpha)^{2}/K^{1}+2(2+r)\alpha^{2}/K^{0}\right)}{T}\right)^ {1/4}\cdot\frac{1}{L^{3/4}d\sqrt{\alpha}},$ $$

Algorithm 1 converges with rate

$$ $\displaystyle\mathbb{E}[\left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})\right \rVert^{2}]$ $\displaystyle\leq\sqrt{2L}\cdot\frac{\sqrt{\frac{(1-\alpha)^{2}}{K^{1}}+\frac{ 2(2+r)\alpha^{2}}{K^{0}}}}{2-\alpha-\eta L\left(1-\alpha+2\alpha^{2}L(2+r) \right)}\cdot\sigma\sqrt{\frac{\mathcal{L}(\bm{\theta}_{0})-\mathcal{L}_{\star }}{T}}$ $\displaystyle=\mathcal{O}\left(\frac{1}{\sqrt{T}}\sqrt{\frac{(1-\alpha)^{2}}{K ^{1}}+\frac{2(2+r)\alpha^{2}}{K^{0}}}\right)$ $$

###### Theorem G.12 .

###### Corollary G.13 .

### G.6 Convergence analysis of Addax in smooth strongly convex setting

###### Theorem G.14 .

Under Assumptions G.1, G.2, and G.4, by running Algorithm 1 for $T$ iterations with $0<\eta_{t}=\eta\leq\frac{1}{2L},\forall t$, the output satisfies

$$ $\displaystyle\mathbb{E}_{t}[\left\lVert\bm{\theta}_{T}-\bm{\theta}_{\star} \right\rVert^{2}]$ $\displaystyle\leq\left(1-\frac{\eta_{t}\mu}{2}\right)^{T}\left\lVert\bm{\theta }_{0}-\bm{\theta}_{\star}\right\rVert^{2}$ (29) $\displaystyle\quad+\frac{\alpha^{2}(1/\mu+\eta_{t})\epsilon^{2}L^{2}d^{2}}{\mu }+\frac{2\eta_{t}(1-\alpha)^{2}}{K^{1}\mu}\sigma^{2}+\frac{2\eta_{t}\alpha^{2} d}{K^{0}\mu}\sigma^{2}.$ $$

By Assumption G.4, with $\mu>0$, we have:

$$ $\displaystyle\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{\star} \right\rVert^{2}]$ $\displaystyle=\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{t}+\bm{ \theta}_{t}-\bm{\theta}_{\star}\right\rVert^{2}]$ $\displaystyle=\left\lVert\bm{\theta}_{t}-\bm{\theta}_{\star}\right\rVert^{2}+ \mathbb{E}_{t}\left[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{t}\right\rVert^{ 2}+2\left\langle\bm{\theta}_{t+1}-\bm{\theta}_{t},\bm{\theta}_{t}-\bm{\theta}_ {\star}\right\rangle\right]$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{=}}\left\lVert\bm{\theta}_{t}-\bm{ \theta}_{\star}\right\rVert^{2}+\eta_{t}^{2}\left\lVert(1-\alpha)\nabla \mathcal{L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla} \mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rVert^{2}$ $\displaystyle\quad+\eta_{t}^{2}(1-\alpha)^{2}\mathbb{E}_{\mathcal{B}^{1}}[ \left\lVert\nabla\mathcal{L}(\bm{\theta}_{t})-\nabla\mathcal{L}(\bm{\theta}_{t };\mathcal{B}^{1})\right\rVert^{2}]+\eta_{t}^{2}\alpha^{2}\mathrm{Var}(\hat{ \nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0}))$ $\displaystyle\quad-2\eta_{t}\left\langle\bm{\theta}_{t}-\bm{\theta}_{\star},(1 -\alpha)\nabla\mathcal{L}(\bm{\theta}_{t})+\alpha\mathbb{E}_{\mathcal{B}^{0}}[ \hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]\right\rangle$ $\displaystyle\stackrel{{\scriptstyle(b)}}{{\leq}}\left\lVert\bm{\theta}_{t}- \bm{\theta}_{\star}\right\rVert^{2}+2\eta_{t}^{2}\left\lVert\nabla\mathcal{L}( \bm{\theta}_{t})\right\rVert^{2}+\frac{\eta_{t}^{2}\alpha^{2}\epsilon^{2}L^{2} d^{2}}{2}+\frac{\eta_{t}^{2}(1-\alpha)^{2}}{K^{1}}\sigma^{2}+\frac{\eta_{t}^{2 }\alpha^{2}d}{K^{0}}\sigma^{2}$ $\displaystyle\quad-2\eta_{t}\left\langle\bm{\theta}_{t}-\bm{\theta}_{\star}, \nabla\mathcal{L}(\bm{\theta}_{t})\right\rangle-2\alpha\eta^{t}\left\langle\bm {\theta}_{t}-\bm{\theta}_{\star},\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla} \mathcal{L}(\theta_{t};\mathcal{B}^{0})]-\nabla\mathcal{L}(\bm{\theta}_{t})\right\rangle$ $\displaystyle\stackrel{{\scriptstyle(c)}}{{\leq}}\left\lVert\bm{\theta}_{t}- \bm{\theta}_{\star}\right\rVert^{2}+4\eta_{t}^{2}L\left(\mathcal{L}(\bm{\theta }_{t})-\mathcal{L}_{\star}\right)-\eta_{t}\left(2(\mathcal{L}(\bm{\theta}_{t}) -\mathcal{L}_{\star})+\mu\left\lVert\bm{\theta}_{t}-\bm{\theta}_{\star}\right \rVert^{2}\right)$ $\displaystyle\quad-2\alpha\eta^{t}\left\langle\bm{\theta}_{t}-\bm{\theta}_{ \star},\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t}; \mathcal{B}^{0})]-\nabla\mathcal{L}(\bm{\theta}_{t})\right\rangle$ $\displaystyle\quad+\frac{\eta_{t}^{2}\alpha^{2}\epsilon^{2}L^{2}d^{2}}{2}+ \frac{\eta_{t}^{2}(1-\alpha)^{2}}{K^{1}}\sigma^{2}+\frac{\eta_{t}^{2}\alpha^{2 }d}{K^{0}}\sigma^{2},$ (30) $$

where $(a)$ substitutes the update of $\bm{\theta}$ and takes expectations to $\bm{g}^{0},\bm{g}^{1}$ and conditions on $\bm{\theta}_{t}$;$(b)$ plugs in equation (7) to the second term, and the third term follows from  Lemma G.6; $(c)$ uses the fact that $\mathcal{L}(\bm{\theta})\leq\mathcal{L}(\bm{\theta}_{\star})+\frac{1}{2L}\left
\lVert\nabla\mathcal{L}(\bm{\theta})\right\rVert^{2}$ for convex and smooth $\mathcal{L}(\cdot)$. This implies that $\left\lVert\nabla\mathcal{L}(\bm{\theta})\right\rVert^{2}\leq 2L(\mathcal{L}(
\bm{\theta})-\mathcal{L}(\bm{\theta}_{\star}))$ and applies to the second term. We apply Assumption G.4 to the sixth term in $(c)$ by setting $\bm{\theta}$, $\bm{\theta}^{\prime}$ to $\bm{\theta}_{\star}$ and $\bm{\theta}_{t}$, respectively. The middle term can be further bounded as:

$$ $\displaystyle-2$ $\displaystyle\left\langle\bm{\theta}_{t}-\bm{\theta}_{\star},\mathbb{E}_{ \mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t};\mathcal{B}^{0})]-\nabla \mathcal{L}(\bm{\theta}_{t})\right\rangle$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\frac{\mu}{2\alpha}\left \lVert\bm{\theta}_{t}-\bm{\theta}_{\star}\right\rVert^{2}+\frac{2\alpha}{\mu} \left\lVert\mathbb{E}_{\mathcal{B}^{0}}[\hat{\nabla}\mathcal{L}(\theta_{t}; \mathcal{B}^{0})]-\nabla\mathcal{L}(\bm{\theta}_{t})\right\rVert^{2}$ $\displaystyle\leq\frac{\mu}{2\alpha}\left\lVert\bm{\theta}_{t}-\bm{\theta}_{ \star}\right\rVert^{2}+\frac{\alpha\epsilon^{2}L^{2}d^{2}}{2\mu},$ (31) $$

where $(a)$ applies Young’s inequality for inner products, i.e., $-2\langle\mathbf{a},\mathbf{b}\rangle\leq\frac{1}{\tau}\|\mathbf{a}\|^{2}+\tau
\|\mathbf{b}\|^{2}$ with $\tau=\frac{2\alpha}{\mu}$ in our case. Then we have:

$$ $\displaystyle\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{\star} \right\rVert^{2}]$ $\displaystyle\leq\left(1-\frac{\eta_{t}\mu}{2}\right)\left\lVert\bm{\theta}_{t }-\bm{\theta}_{\star}\right\rVert^{2}-2\eta_{t}(1-2\eta_{t}L)\left(\mathcal{L} (\bm{\theta}_{t})-\mathcal{L}_{\star}\right)$ $\displaystyle\quad+\frac{\eta_{t}\alpha^{2}(1/\mu+\eta_{t})\epsilon^{2}L^{2}d^ {2}}{2}+\frac{\eta_{t}^{2}(1-\alpha)^{2}}{K^{1}}\sigma^{2}+\frac{\eta_{t}^{2} \alpha^{2}d}{K^{0}}\sigma^{2},$ (32) $$

By setting $\eta_{t}\leq\frac{1}{2L}$, we have $1-2\eta_{t}L\geq 0$. Then we have:

$$ $\displaystyle\mathbb{E}_{t}[\left\lVert\bm{\theta}_{t+1}-\bm{\theta}_{\star} \right\rVert^{2}]$ $\displaystyle\leq\left(1-\frac{\eta_{t}\mu}{2}\right)\left\lVert\bm{\theta}_{t }-\bm{\theta}_{\star}\right\rVert^{2}+\frac{\eta_{t}\alpha^{2}(1/\mu+\eta_{t}) \epsilon^{2}L^{2}d^{2}}{2}$ $\displaystyle\quad+\frac{\eta_{t}^{2}(1-\alpha)^{2}}{K^{1}}\sigma^{2}+\frac{ \eta_{t}^{2}\alpha^{2}d}{K^{0}}\sigma^{2},$ (33) $$

Recursively apply the above equation (G.6) and sum from $t=0$ to $T-1$ by setting $\eta_{t}=\eta\leq\frac{1}{2L}$, we have

$$ $\displaystyle\mathbb{E}[\left\lVert\bm{\theta}_{T}-\bm{\theta}_{\star}\right \rVert^{2}]$ $\displaystyle\leq\left(1-\frac{\eta\mu}{2}\right)^{T}\left\lVert\bm{\theta}_{0 }-\bm{\theta}_{\star}\right\rVert^{2}+\sum_{j=0}^{T-1}\left(1-\frac{\eta\mu}{2 }\right)^{j}\frac{\eta\alpha^{2}(1/\mu+\eta)\epsilon^{2}L^{2}d^{2}}{2}$ $\displaystyle\quad+\sum_{j=0}^{T-1}\left(1-\frac{\eta\mu}{2}\right)^{j}\left( \frac{\eta^{2}(1-\alpha)^{2}}{K^{1}}\sigma^{2}+\frac{\eta^{2}\alpha^{2}d}{K^{0 }}\sigma^{2}\right)$ $\displaystyle\stackrel{{\scriptstyle(a)}}{{\leq}}\left(1-\frac{\eta\mu}{2} \right)^{T}\left\lVert\bm{\theta}_{0}-\bm{\theta}_{\star}\right\rVert^{2}+ \frac{\alpha^{2}(1/\mu+\eta)\epsilon^{2}L^{2}d^{2}}{\mu}$ $\displaystyle\quad+\frac{2\eta(1-\alpha)^{2}}{K^{1}\mu}\sigma^{2}+\frac{2\eta \alpha^{2}d}{K^{0}\mu}\sigma^{2}$ (34) $$

where (a) comes from $0\leq 1-\frac{1-\eta\mu}{2}<1$. This completes the proof

###### Corollary G.15 .

By choosing $\eta=\min\left\{\frac{1}{2L},\frac{2}{\mu T}\ln\left(T\frac{\mu^{2}\left\lVert
\bm{\theta}^{0}-\bm{\theta}_{\star}\right\rVert^{2}}{4\left(\frac{(1-\alpha)^{
2}}{K^{1}}+\frac{\alpha^{2}d}{K^{0}}\right)\sigma^{2}}\right)\right\}$ and

$$ $\epsilon\leq\frac{\sigma}{Ld}\sqrt{\frac{2\left(\frac{(1-\alpha)^{2}}{K^{1}}+ \frac{\alpha^{2}d}{K^{0}}\right)}{T\alpha(1/\mu+\eta\alpha)}},$ $$

Algorithm 1 converges with rate

$$ $\displaystyle\mathbb{E}[\left\lVert\bm{\theta}_{T}-\bm{\theta}_{\star}\right \rVert^{2}]$ $\displaystyle\leq\frac{9}{\mu T}\ln\left(T\frac{\mu^{2}\left\lVert\bm{\theta}^ {0}-\bm{\theta}_{\star}\right\rVert^{2}}{4\left(\frac{(1-\alpha)^{2}}{K^{1}}+ \frac{\alpha^{2}d}{K^{0}}\right)\sigma^{2}}\right)\left(\frac{(1-\alpha)^{2}}{ K^{1}}+\frac{\alpha^{2}d}{K^{0}}\right)\sigma^{2}$ $\displaystyle=\mathcal{O}\left(\frac{\ln(T)}{T}\left(\frac{(1-\alpha)^{2}}{K^{ 1}}+\frac{\alpha^{2}d}{K^{0}}\right)\right).$ $$

###### Theorem G.14 .

###### Corollary G.15 .

## Peer Reviews

confidence: 4
contribution: 3
initial_rating: 5
presentation: 3
questions: - the experiments done here are all done with high-end h100 gpus, I am curious who are actually the targeted users for Addax? does this work on lower-end GPUs? say 3090s?
- with the empirical improvement presented, and the complexity of the methods. I am curious if the authors could further list your No.1 selling point vs. well-established first-order finetuning methods, what would be your pitch to convince the community to adopt Addax in practise?
soundness: 3
strengths: The concept behind Addax is promising. By selectively applying zeroth-order and first-order updates depending on memory requirements, Addax cleverly attempts to sidestep some of the limitations of both IP-SGD and MeZO. The added benefit of using zeroth-order gradients as a regularizer for first-order gradients is an interesting approach that theoretically could lead to better model generalization.

- it assigns data points with higher memory demands to a zeroth-order gradient estimation, while data points with lower memory demands use a more standard first-order gradient approach.

- the wallclock time details provided are very helpful.
summary: This paper presents Addax, a novel approach to fine-tuning large language models (LMs) with reduced memory usage and improved convergence speed. Addax aims to bridge the gap between two existing methods—IP-SGD, which is memory-intensive, and MeZO, which suffers from slow convergence due to its zeroth-order gradient estimation. By combining zeroth-order and first-order gradient estimates based on the memory consumption of different data points, Addax attempts to balance the benefits of each approach, reducing memory requirements without sacrificing performance.
weaknesses: - Addax introduces an additional layer of complexity by dynamically selecting gradient types based on memory consumption, which may require extra engineering effort to implement effectively in various environments. 
-  The algorithm involves splitting data into two subsets, resetting random seeds, and clearing gradients for each update step. This is quite complicated.
- While the hybrid gradient approach is novel, it’s unclear from the presented results to what extent this technique actually enhances performance, or to be specific, in results shown in figure 1 e.g. some of the tasks's improvement seem very marginal compared to MEZO.

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: 1. From my experience about MeZO, it usually begin to work after a large number of epochs. So I would like to ask whether Addax and SGD use a same epoch value?
soundness: 3
strengths: 1. The intuition and motivation are very easy to understand and the paper is also easy to follow. 

2. The paper provides the results on different models with different sizes to verify the performance of the proposed method, which also makes the paper more convincing.
summary: This paper proposes a novel LLM fine-tuning methods, which try to combine the first-order (sgd) and zeroth-order (mezo) to efficiently fine-tune LLM. The experiments on OPT and LLaMA Illustrate that the proposed method can achieve a better performance than SGD and faster convergence than MeZO.
weaknesses: 1. The opinion that "SGD can match the performance of Adam in fine-tuning tasks." is not very reasonable to me. I think the main reason why the authors reached this conclusion is because the tasks in this paper are too easy (mainly focusing on classification tasks). If the authors conduct some experiments on math and code generation tasks, Adam could be better than vanilla SGD. 

2. Ablation Study. We can notice that the paper provides the results of ip-sgd and addax in Table 1, 2, 3. And the main difference of these two methods is some long sequences use different optimizers. Specially, for addax, the long sequences use zero-order optimization. What is the result if we set the learning rate of these zeroth order optimization to 0 (That means we can skip these long sequences and no update with these data). I just want to see whether the zeroth-order optimization really works. I guess update too much times with sgd may cause overfitting and just skip some training steps (long sequences in addax) can improve the performance (even if don't use zeroth-order on this data). So I would like to see the results if we just skip these long sequence data in addax. 

3. The paper mainly focuses on the tasks on SuperGulu. These tasks are too easy to LLM fine-tuning with first-order methods. It would be better if the authors could provide the results of complex tasks. This is just a suggestion and should not be a weakness.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 4
questions: Please refer to the Weaknesses.
soundness: 3
strengths: -	The motivation of the proposed method is well supported by the preliminary experiments.
-	This paper provides theoretical guarantee that the propose method enjoys faster convergence and less restrictive hyper-parameter choices than MeZO.
-	This paper conducts extensive experiments to demonstrate its effectiveness on models with various sizes ranging from 350M to 70B, achieving superior performance both in test accuracy, memory and time efficiency.
summary: This paper proposes Addax, which assigns different mini-batch of data to compute zeroth-order and first-order gradients respectively based on the sequence length of the data, and combines the two kinds of gradients to update the model parameter. Addax outperforms existing zeroth-order method MeZO in accuracy/F1 score and achieves comparable memory footprint with MeZO. Furthermore, it surpasses IP-SGD and Adam with significantly less memory requirement.
weaknesses: - In Algorithm 1 step 7, the mini-batch $\beta^1$ is sampled from $D^1$, while in Line 298, it is claimed that $\beta^1$ is sampled from $\beta^0$, which is inconsistent. 
- The performance of the proposed method is sensitive to the mixing constant $\alpha$ for combining the zeroth-order and first-order gradients. Also, it may be sensitive to the length threshold $L_T$ and the random seed. 
- It would be better to further demonstrate the effectiveness of the proposed method on more challenged tasks such as commonsense reasoning tasks and mathematics tasks.

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: How would results look like when we run IP-SGD with gradient checkpointing?
soundness: 3
strengths: An excellent description of problems with MeZO and IP-SGD. 
Better results than MeZO while keeping memory consumtion low.
summary: Authors propose Addax, algorithm which adaptively combined zero-order (MeZO) and in place first-order (IP-SGD) optimization methods, to achieve LLM fine-tuning with low memory requirement.
weaknesses: Authors do memory profiling without gradient checkpointing, a very common technique to lower memory requirements for storing activations for backward computation. I believe this overestimates the memory requirements of IP-SGD. 
The main selling point is that Addax has lower memory requirements than IP-SGD. However, this selling point vanishes the moment we turn gradient checkpointing on. 

A minor selling point of Addax is that it sometimes produces better results even when zero-order gradients are computed concurrently with first-order ones (Addax-WA). However, it is hard to find which results actually belong to Addax-WA in the paper. E.g. section 4 says "we plot the convergence curves of Addax-WA and MeZO using the same batch size in Figure 11", but figure 11 label says "Addax with 4×
less first-order samples achieves a convergence speed similar to SGD", which suggest we are not running Addax-WA here.

Nitpick: Figure 4 just feels wrong, because SGD should always have higher memory requirements than IP-SGD).

Meta-review: This paper introduces Addax, a novel fine-tuning algorithm for large language models (LLMs) that efficiently combines zeroth-order and first-order gradient optimization techniques to address memory and convergence challenges. The approach dynamically allocates zeroth-order gradients to memory-intensive sequences and first-order gradients to less demanding ones, optimizing memory usage without compromising performance. The hybrid gradient strategy is innovative, leveraging zeroth-order gradients as implicit regularizers, which improves generalization. The authors provide both theoretical guarantees and extensive empirical evidence, demonstrating faster convergence and superior accuracy compared to existing methods like MeZO and IP-SGD across a variety of models and tasks. The implementation's adaptability to hardware constraints and its open-source availability further enhance its practical appeal.

Decision: Accept (Poster)