1-Bit FQT: Pushing the Limit of Fully Quantized Training to 1-bit

## Abstract

Abstract Fully quantized training (FQT) accelerates the training of deep neural networks by quantizing the activations, weights, and gradients into lower precision. To explore the ultimate limit of FQT (the lowest achievable precision), we make a first attempt to 1-bit FQT. We provide a theoretical analysis of FQT based on Adam and SGD, revealing that the gradient variance influences the convergence of FQT. Building on these theoretical results, we introduce an Activation Gradient Pruning (AGP) strategy. The strategy leverages the heterogeneity of gradients by pruning less informative gradients and enhancing the numerical precision of remaining gradients to mitigate gradient variance. Additionally, we propose Sample Channel joint Quantization (SCQ), which utilizes different quantization strategies in the computation of weight gradients and activation gradients to ensure that the method is friendly to low-bitwidth hardware. Finally, we present a framework to deploy our algorithm. For fine-tuning VGGNet-16 and ResNet-18 on multiple datasets, our algorithm achieves an average accuracy improvement of approximately 6%, compared to per-sample quantization. Moreover, our training speedup can reach a maximum of 5.13× compared to full precision training. Ours code is available at https://github.com/Gaochang-bjtu/1-bit-FQT .

## 1 Introduction

Training neural networks has a high computational cost and memory footprint. Training with low-precision arithmetic (a.k.a., fully quantized training or FQT) can enhance computational and memory efficiency. FQT quantizes weights, activations, and gradients into low-bitwidth numerical formats, enabling a fast implementation of both forward and backward propagation on low-precision hardware.

The speedup potential of FQT depends on the numerical precision. Research aims to reduce the training numerical precision, without compromising convergence speed or accuracy. The required precision has been reduced from FP/INT16 Micikevicius et al. (); Das et al. () to FP/INT8 Wang et al. (); Banner et al. (); Zhu et al. (); Yang et al. (). As of now, some work Sun et al. (); Chmiel et al. (); Xi et al. () have successfully pushed precision down to 4 bits.

As the training numerical precision continues to decrease, a natural question arises:

*What is the ultimate limit of FQT (i.e., the minimum achievable bitwidth)? *

Answering this question not only advances our understanding of FQT but also provides a crucial direction for future hardware design strategies. Ideally, if we can push the bitwidth down to 1-bit, the training can be implemented with binary operations, such as XNOR and bitcounting operations Courbariaux et al. (), and hardware design might be greatly simplified. Binary computation is already shown possible for *inference* acceleration, such as XNOR-Net Rastegari et al. (), but 1-bit *training* remains unexplored.

Figure: Figure 1: Gradient numerical precision (“bits”) vs. test accuracy of VGGNet16 on CIFAR-10, trained with Adam and SGD.
Refer to caption: x1.png

Reducing the bitwidth for FQT is challenging because of (1) the lack of theoretical understanding, especially how gradient quantization affects the convergence; (2) the large quantization error of gradients, which causes a sharp performance drop or even divergence when reducing gradient bitwidth lower than 4-bit (Fig. 1). Due to these challenges, current research frontier is still 4-bit FQT.

In this work, we make a first attempt towards achieving 1-bit FQT. Firstly, we provide a theoretical analysis for FQT based on both Adam Kingma and Ba () and SGD. Our analysis links the convergence with gradient variance. Specifically, our analysis reveals that Adam is more suitable for FQT than SGD in the low-bitwidth regime, due to their different sensitivity to gradient variance.

Inspired by the above theory, we propose a hardware-friendly algorithm for 1-bit FQT. Our algorithm consists of an Activation Gradient Pruning (AGP) method to reduce gradient variance, which is an improvement based on per-group quantizers Chen et al. (); Cho and Yoo (). AGP utilizes gradient heterogeneity by discarding less informative groups, and allocate saved resources to improve the numerical precision of more informative ones.
Additionally, we propose Sample Channel joint Quantization (SCQ), an effective quantization scheme for accelerated performance. SCQ employs different quantization methods for computing weight gradients and activation gradients, ensuring both can be effectively implemented on low bitwidth computing units.

We examine the potential of 1-bit FQT on transfer learning tasks in both vision and NLP domain. In this task, 1-bit FQT algorithm is used for on-device finetuning a pretrained 1-bit model to adapt new data. On all the datasets, our 1-bit FQT algorithm can successfully *converge* and demonstrate significantly superior performance compared to directly applying the previous FQT method to the task. The average accuracy drop on visual classification datasets is approximately 5%, compared to training the binary model with full-precision gradients. Notably, the average accuracy loss is negligible (less than 1%) on Flowers Nilsback and Zisserman () dataset and Pets Parkhi et al. () dataset, indicating that 1-bit FQT might indeed be useful in some cases.
We implement our algorithm on Hygon and Raspberry Pi devices as a PyTorch-based library binop. Accelerated on-device training can be achieved with simple layer substitution, e.g., replace torch.nn.Conv2d with binop.Conv2d. In practice, our method can achieve up to 5.13× speedup, compared to FP32 PyTorch. These results indicate that in some specific tasks, FQT precision can be pushed to the ultimate 1-bit.

## 2 Related Works

Quantization Aware Training.
QAT is a method designed to accelerate *inference* by quantizing the activations and weights.
Various works Zhou et al. (); Choi et al. (); Zhang et al. (); Jacob et al. (); Dong et al. (); Tang et al. (); Liu et al. () have been developed to quantize weights and activations into lower bitwidth. Furthermore, some studies Rastegari et al. (); Bulat and Tzimiropoulos (); Wang et al. (); Bai et al. (); Wu et al. (); Qin et al. () have reduced the numerical precision of weights and activation values to 1 bit. However, QAT does not quantize gradients, and as a result, the backward propagation cannot be accelerated.

Fully Quantized Training. FQT further quantizes the gradients into lower precision, compared with QAT. Hence, FQT allows for efficient implementation of both forward and backward propagation on low-bitwidth computational units. FQT, unlike optimizer quantization Lin et al. (), involves quantizing weights, activations, and gradients altogether. Optimizer quantization only quantizes weight update (weight gradients), thus reducing communication costs but not accelerating computation Saha et al. (). Early works on FQT use FP16 Gupta et al. (); Micikevicius et al. () or INT16 Das et al. () values to constrain weights, activations, and gradients. After that, various 8-bit numerical formats Wang et al. (); Banner et al. (); Zhu et al. (); Yang et al. (); Xi et al. () have been proposed that further push the bitwidth of data to 8 bits. Subsequently, Chen et al. () provides theoretical bounds on how the quantization scheme (bitwidth, type of quantizer) affects the quality of the quantized gradient. Based on that, some works have successfully trained several networks with 4-bit activations/weights/gradients Sun et al. (); Chmiel et al. (); Xi et al. (). The current research frontier is 4-bit FQT, but it still is not the ultimate limit.

## 3 Framework

To better describe our approach, necessary notations are introduced first. We denote the DNN model composed of $L$ layers with the learnable parameter $\boldsymbol{\Theta}$ as $\mathbf{F}(.;\boldsymbol{\Theta})$. In each training iteration, we sample a minibatch ($\mathbf{X},\mathbf{Y}$) from the dataset and input it into the model. The process is

$$ $\mathbf{H}^{(0)}=\mathbf{X},\mathbf{H}^{(l)}=\mathbf{F}^{(l)}\left(\mathbf{H}^ {(l-1)};\boldsymbol{\Theta}^{(l)}\right),\forall l\in[L]_{+},$ (1) $$

where $\mathbf{H}^{(l)}\in\mathbb{R}^{N\times D^{(l)}}$ is a feature map ($N$ is the batch size, $D^{(l)}$ is the number of features), and $[L]_{+}=\{1,2,\ldots,L\}$ are sets of integers. $\mathbf{F}^{(l)}$ is the $l$-th layer of the model with parameter $\boldsymbol{\Theta}^{(l)}$.
Given the minibatch loss $\mathcal{L}(\mathbf{H}^{(L)},\mathbf{Y})$, we compute the gradient $\nabla_{\boldsymbol{\Theta}^{(l)}}\mathcal{L}$, and update the parameter. For simplicity, we use $\nabla_{\mathbf{H}^{(l)}}$ and $\nabla_{\boldsymbol{\Theta}^{(l)}}$ represent the activation/parameter gradient. The back-propagation is
$\nabla_{\mathbf{H}^{(l-1)}},\nabla_{\boldsymbol{\Theta}^{(l)}}=\mathbf{B}^{(l)
}(\nabla_{\mathbf{H}^{(l)}},\mathbf{H}^{(l-1)},\boldsymbol{\Theta}^{(l)}),$
where the function $\mathbf{B}^{(l)}$(·) takes the gradient of the output $\nabla_{\mathbf{H}^{(l)}}$ and the information kept in memory ($\mathbf{H}^{(l)}$, $\boldsymbol{\Theta}^{(l)}$), and computes the gradient of the input. For example, consider a linear layer $\mathbf{H}^{(l)}=\mathbf{H}^{(l-1)}\mathbf{\Theta}^{(l)}$ and its gradient is

$$ $\nabla_{\mathbf{H}^{(l-1)}}=\nabla_{\mathbf{H}^{(l)}}\boldsymbol{\Theta}^{(l)^ {\top}},\quad\nabla_{\boldsymbol{\Theta}^{(l)}}=\mathbf{H}^{(l-1)^{\top}} \nabla_{\mathbf{H}^{(l)}}.$ (2) $$

### 3.1 Quantized Training

Here, we describe Quantization-Aware Training (QAT) and Fully Quantized Training (FQT). QAT is employed to accelerate *inference*, while FQT is designed to accelerate both inference and *training*.

Before embarking on QAT, the initial step involves quantizing the parameters and activations of the model:
$\forall l\in[L]_{+},\tilde{\mathbf{H}}^{(l-1)}=Q_{f}(\mathbf{H}^{(l-1)}),
\tilde{\boldsymbol{\Theta}}^{(l)}=Q_{\boldsymbol{\Theta}}(\boldsymbol{\Theta}^
{(l)})$,
where $Q_{f}$(·) and $Q_{\boldsymbol{\Theta}}$(·) are quantizers for activations and weights, and $\tilde{\mathbf{H}}^{(l-1)}$ and $\tilde{\boldsymbol{\Theta}}^{(l)}$ are quantized activations and weights. The forward propagation Eq. 1 is quantized as
$\forall l\in[L]_{+},\mathbf{H}^{(l)}=\mathbf{F}^{(l)}(\tilde{\mathbf{H}}^{(l-1
)};\tilde{\boldsymbol{\Theta}}^{(l)}),$
where $\tilde{\mathbf{H}}^{(l-1)}$ and $\tilde{\boldsymbol{\Theta}}^{(l)}$ represent low-bit data. Therefore, the inference can be efficiently implemented on low-bitwidth computing kernels. QAT leverages the straight-through estimator Bengio et al. () to train quantized models.
The back-propagation Eq. 2 becomes:
$\tilde{\nabla}_{\mathbf{H}^{(l-1)}}=\nabla_{\mathbf{H}^{(l)}}\tilde{
\boldsymbol{\Theta}}^{(l)^{\top}},\tilde{\nabla}_{\boldsymbol{\Theta}^{(l)}}=
\tilde{\mathbf{H}}^{(l-1)^{\top}}\nabla_{\mathbf{H}^{(l)}}.$
Since gradients are not quantized, the backpropagation cannot be accelerated.

The forward propagation of FQT is identical to QAT, FQT further quantizes the gradients at each layer as
$\forall l\in[L]_{+},\hat{\nabla}_{\mathbf{H}^{(l)}}=Q_{g}\left({\nabla}_{
\mathbf{H}^{(l)}}\right),$ where
$Q_{g}$(·) is a quantizer for gradients. The backpropagation is quantized as
$\hat{\nabla}_{\mathbf{H}^{(l-1)}}=\hat{\nabla}_{\mathbf{H}^{(l)}}\tilde{
\boldsymbol{\Theta}}^{(l)^{\top}},\hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}=
\tilde{\mathbf{H}}^{(l-1)^{\top}}\hat{\nabla}_{\mathbf{H}^{(l)}},$
where $\hat{\nabla}_{\mathbf{H}^{(l)}}$ and $\hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}$ represent the FQT gradient. Now, with all operands quantized, the backpropagation can be efficiently implemented on low-bitwidth kernels.

### 3.2 FQT with Unbiased Quantizer

In our framework, $Q_{f}$(·) and $Q_{\boldsymbol{\Theta}}$(·) are deterministic quantizers, while $Q_{g}$(·) is an unbiased quantizer. This configuration follows Chen et al. (). In this framework, the gradients in FQT are unbiased estimates of QAT, ensuring both converge to the same point in expectation.

Consider $Q_{g}$ as an unbiased stochastic quantizer, i.e., $\mathbb{E}\left[Q_{g}({\nabla}_{\mathbf{H}})\right]={\nabla}_{\mathbf{H}}$, for any ${\nabla}_{\mathbf{H}}$, which are already widely adopted in existing FQT approaches Banner et al. (); Xi et al. (), thereby enabling $\mathbb{E}[\hat{\nabla}_{\mathbf{H}^{(l)}}]={\nabla}_{\mathbf{H}^{(l)}}$. The activation gradients of FQT is
$\mathbb{E}[\hat{\nabla}_{\mathbf{H}^{(l-1)}}]=\mathbb{E}[\hat{\nabla}_{\mathbf
{H}^{(l)}}]\tilde{\boldsymbol{\Theta}}^{(l)^{\top}}=\tilde{\nabla}_{\mathbf{H}
^{(l-1)}},$
which implies FQT and QAT convergence to a stationary point in expectation. Given an activation gradient tensor ${\nabla}_{\mathbf{H}}$, we quantize it to $b$-bit. We first compute the range of the tensor, and scale each element:
$\overline{\nabla}_{\mathbf{H}_{i,j}}=\operatorname{SR}(B({\nabla}_{\mathbf{H}_
{i,j}}-Z)/R),$
where $B=2^{b}-1$ are the number of quantization bins, $R=\max\left\{{\nabla}_{\mathbf{H}}\right\}-\min\left\{{\nabla}_{\mathbf{H}}\right\}$ is the range, $Z=\min\left\{{\nabla}_{\mathbf{H}}\right\}$ is the zero point, the stochastic rounding Courbariaux et al. () operation $\operatorname{SR}$(·) convert input to integers, and $\overline{\nabla}_{\mathbf{H}_{i,j}}$ is the gradient quantized to $b$ bits. The dequantization is
$\hat{\nabla}_{\mathbf{H}_{i,j}}=\overline{\nabla}_{\mathbf{H}_{i,j}}R/B+Z.$
Due to the utilization of stochastic rounding, it is clear that $\mathbb{E}[\hat{\nabla}_{\mathbf{H}_{i,j}}]={\nabla}_{\mathbf{H}_{i,j}}$.

The unbiased quantizer widely adopted in FQT is the per-group quantizer, including per-tensor quantizer (PTQ) Banner et al. (), per-sample quantizer (PSQ) Chen et al. (), and per-channel quantizer (PCQ) Cho and Yoo (). In these strategies, each group computes its own range and zero point, rather than sharing a common one, which addresses the large variation of dynamic range across groups.

## 4 Theoretical Results

In this section, we analyze the convergence behavior of FQT under two different optimizers, Adam and SGD. The proof of theorems follows the framework in Kingma and Ba (), which can be found in Appendix A.

### 4.1 Optimizer Impact on Convergence

Quantized training with the Adam optimizer achieved much higher accuracy than those with SGD (Fig. 1). Although some prior studies Bulat and Tzimiropoulos (); Lin et al. () have highlighted this issue, the theoretical understanding of FQT with Adam is still lacking. To fill this gap, we will provide theoretical bounds on the convergence of FQT based on both Adam and SGD optimizers in the following part.

We use the framework proposed in Zinkevich () to analyze the convergence. We adopt the assumption made by Zinkevich () that the loss function $\mathcal{L}$ is convex. At each iteration $t$, we predict using the parameter ${\boldsymbol{\Theta}}_{t}$ and evaluate it on the loss function ${\mathcal{L}}_{t}$. We evaluate the convergence of FQT using the regret:
$R(T)=\sum_{t=1}^{T}\left[{\mathcal{L}}_{t}\left({\boldsymbol{\Theta}}_{t}
\right)-{\mathcal{L}}_{t}\left({\boldsymbol{\Theta}}^{*}\right)\right],$
where ${\boldsymbol{\Theta}}^{*}$ are the best fixed point parameter. We define ${\nabla}_{{\boldsymbol{\Theta}}_{1:t,i}}\in\mathbb{R}^{t}$ as a vector that contains the $i$-th dimension of the gradients over all iterations till $t$, ${\nabla}_{{\boldsymbol{\Theta}}_{1:t,i}}=[{\nabla}_{{\boldsymbol{\Theta}}_{1,i
}},{\nabla}_{{\boldsymbol{\Theta}}_{2,i}},\ldots,{\nabla}_{{\boldsymbol{\Theta
}}_{t,i}}]$,
$\hat{{\nabla}}_{{\boldsymbol{\Theta}}_{1:t,i}}$ is the quantized version of ${\nabla}_{{\boldsymbol{\Theta}}_{1:t,i}}$.

###### Assumption 4.1

There exists ${\sigma},e>0$, such that $\forall{\boldsymbol{\Theta}}_{t,i}$, $\operatorname{Var}\left[\hat{\nabla}_{\boldsymbol{\Theta}_{t,i}}\right]\leq
\sigma^{2}$, $-e\leq\mathbb{E}\left[\hat{\nabla}_{\boldsymbol{\Theta}_{t,i}}\right]\leq e$.

###### Assumption 4.2

The distance between any $\boldsymbol{\Theta}_{t}$ is bounded, $\left\|\boldsymbol{\Theta}_{n}-\boldsymbol{\Theta}_{m}\right\|_{2}\leq D$, $\left\|\boldsymbol{\Theta}_{n}-\boldsymbol{\Theta}_{m}\right\|_{\infty}\leq D_
{\infty},$ for any $m,n\in\{1,\ldots,T\}$.

Given an unbiased gradient, we now establish the convergence of quantized training under SGD. The iteration form of SGD is $\boldsymbol{\Theta}_{t+1}\leftarrow\boldsymbol{\Theta}_{t}-{\alpha}_{t}\hat{
\nabla}_{{\boldsymbol{\Theta}}_{t}}$.

###### Theorem 4.3

If Assumption 4.1 and 4.2 holds, let $\alpha_{t}=\frac{\alpha}{\sqrt{t}}$ and the number of elements in the gradient is $d$. SGD achieves the following guarantee, for all $T\geq 1$.
$R^{SGD}(T)\leq\frac{D^{2}}{2\alpha}+\frac{\alpha Td({\sigma}^{2}+e^{2})}{2}.$

The iteration form of Adam is expressed as follows:

$$ $\displaystyle\left\{\begin{array}[]{l}m_{t}=\beta_{1,t}\cdot m_{t-1}+\left(1- \beta_{1,t}\right)\cdot\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}},v_{t}=\beta_{2 }\cdot v_{t-1}+\left(1-\beta_{2}\right)\cdot\left(\hat{\nabla}_{{\boldsymbol{ \Theta}}_{t}}\right)^{2},\\ \hat{m}_{t}=\frac{m_{t}}{1-\beta_{1}^{t}},\hat{v}_{t}=\frac{v_{t}}{1-\beta_{2} ^{t}},\boldsymbol{\Theta}_{t+1}=\boldsymbol{\Theta}_{t}-\frac{\alpha}{\sqrt{ \hat{v}}+\epsilon}\cdot\hat{m}_{t}.\end{array}\right.$ $$

###### Assumption 4.4

The function ${\mathcal{L}}_{t}$ has bounded gradients, $\forall{\boldsymbol{\Theta}}$, $\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}\right\|_{2}\leq G$, $\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}\right\|_{\infty}\leq G_{\infty}$.

###### Theorem 4.5

If Assumption 4.1, 4.2 and 4.4 holds, let $\beta_{1},\beta_{2}\in[0,1)$ satisfy $\frac{\beta_{1}^{2}}{\sqrt{\beta_{2}}}<1$, $\alpha_{t}=\frac{\alpha}{\sqrt{t}}$, and $\beta_{1,t}=\beta_{1}\lambda^{t-1},\lambda\in(0,1)$. Adam achieves the following guarantee, for all $T\geq 1$.
$\begin{aligned} R^{Adam}(T)\leq\frac{((1-\lambda)^{2}D^{2}{T}+D_{\infty}^{2})d
}{2\alpha\left(1-\beta_{1}\right)(1-\lambda)^{2}}\sqrt{\sigma^{2}+e^{2}}+\frac
{\alpha\left(1+\beta_{1}\right)G_{\infty}\sqrt{T}d}{\left(1-\beta_{1}\right)
\sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sqrt{\sigma^{2}+e^{2}}.\end{aligned}$

Based on Theorem 4.3, 4.5, Adam and SGD achieve the following guarantee, for $T\rightarrow\infty$.
$\frac{R^{SGD}(T)}{T}\leq\alpha d(\sigma^{2}+e^{2})/2,\frac{R^{Adam}(T)}{T}\leq
\frac{D^{2}d}{2\alpha\left(1-\beta_{1}\right)}\sqrt{\sigma^{2}+e^{2}}.$
From the inquation, it is straightforward to conclude that $\frac{R^{SGD}(T)}{T}=O(\sigma^{2})+O(1)$, $\frac{R^{Adam}(T)}{T}=O(\sigma)+O(1)$. This implies that the convergence of FQT based on both Adam and SGD is influenced by the gradient variance, with SGD being more sensitive to variations in gradient variance.

###### Assumption 4.1

###### Assumption 4.2

###### Theorem 4.3

###### Assumption 4.4

###### Theorem 4.5

### 4.2 Quantizer Impact on Gradient Variance

Based on our theory, gradient variance plays a crucial role in convergence. Gradient variance is primarily composed of two components: the variance of QAT gradients and the variance introduced by the gradient quantizers. Chen et al. () reduced the complicated problem of gradient variance into the simple problem of quantizer variance. Thus, we need to minimize the quantizer variance.

The fundamental form of an unbiased quantizer $Q_{g}$ is given by Sec. 3.2, and its variance is
$\begin{aligned} \operatorname{Var}[Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})\mid
\hat{\nabla}_{\mathbf{H}^{(l)}}]=\frac{R^{2}}{B^{2}}\operatorname{Var}[
\operatorname{SR}(\cdot)\mid\hat{\nabla}_{\mathbf{H}^{(l)}}]\leq\frac{ND^{(l)}
}{4B^{2}}R^{2},\end{aligned}$
where the maximum variance of stochastic rounding $\operatorname{SR}(\cdot)$ is 1/4. The expression reveals that as the bitwidth $b$ decreases, the variance significantly increases. Furthermore, due to the sensitivity of SGD to gradient variance, SGD performs less effectively than Adam in low precision scenarios (large gradient variance) (Fig. 1). Therefore, in scenarios with larger gradient variances, such as in quantized training, the Adam optimizer is recommended. Additionally, the variance is highly sensitive to the gradient range $R$, with outliers in the gradient expanding the range and consequently increasing the quantizer’s variance.

## 5 1-bit FQT Algorithm

In this section, we propose our 1-bit FQT algorithm, including the quantization of weights, activation, and gradients.

### 5.1 Forward Propagation

In the forward propagation, both $Q_{f}$ and $Q_{\boldsymbol{\Theta}}$ are deterministic quantizers, taking the form:
$\operatorname{sign}(x)=-1\text{ if }x\leq 0\text{ otherwise }1\text{. }$
For a fully connected layer, the forward propagation is
${\mathbf{H}}^{(l)}=(\operatorname{sign}({\mathbf{H}}^{(l-1)})\operatorname{
sign}({\boldsymbol{\Theta}}^{(l)}))\odot\Gamma,$
where $\Gamma\in\mathbb{R}^{D^{(l)}}$ represents the shared scaling factor for both weights and activations, and it is learnable parameters. The form follows Bulat and Tzimiropoulos ().

### 5.2 Backward Propagation

The form of backpropagation is

$$ $\hat{\nabla}_{\mathbf{H}^{(l-1)}}=Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}}) \operatorname{sign}({\boldsymbol{\Theta}}^{(l)^{\top}}),\hat{\nabla}_{ \boldsymbol{\Theta}^{(l)}}=\operatorname{sign}({\mathbf{H}}^{(l-1)^{\top}})Q_{ g}(\hat{\nabla}_{\mathbf{H}^{(l)}}).$ (3) $$

Based on our theory, reducing quantizer variance is crucial to ensure the convergence of the model. However, outliers in the gradients can widen the range of gradients, thereby increasing variance.

To mitigate the impact of outliers on variance, per-group quantization is widely employed. Per-group quantization reduces variance by assigning a separate range to each group instead of sharing a large range among all. For example, we perform per-sample quantization on $\hat{\nabla}_{\mathbf{H}^{(l)}}\in\mathbb{R}^{N\times D^{(l)}}$ and its form is
$Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}_{i,j}})=\operatorname{SR}(B(\hat{\nabla}_
{\mathbf{H}^{(l)}_{i,j}}-Z_{i})/R_{i})R_{i}/B+Z_{i},$
where $R_{i},Z_{i}$ represent the range and zero point of activation gradients for the $i$-th sample.
Its variance is $\operatorname{Var}[Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})\mid\hat{\nabla}_{
\mathbf{H}^{(l)}}]\leq\frac{D^{(l)}}{4B^{2}}\sum_{i=1}^{N}R_{i}^{2}.$ However, the variance of PSQ is still too large for 1-bit FQT.

To address this, we propose Activation Gradient Pruning (AGP) to reduce quantizer variance. The gradients exhibit heterogeneity Xi et al. (), with some samples showing large gradient ranges, while the remaining gradients have smaller ranges. This pattern still holds true along the channel dimension, as illustrated in Fig. 2. Additionally, from the visualizations of gradient distributions, we observe that the elements in groups with smaller ranges are close to zero, indicating that less information stored in these groups. Therefore, we can prune groups with smaller ranges,

Figure: Figure 2: Heterogeneity in a ResNet18’s gradients. (a) Heatmap of the per-group range at the conv2.1.2 layer; (b) Histogram of the gradient in a certain group.
Refer to caption: x2.png

reallocating the saved computational cost to groups with larger ranges, consequently enhancing the bitwidth of elements within those groups. Since variance mainly originates from groups with larger ranges, this approach effectively reduces variance.

Achieving 1-bit FQT based on the above idea requires ensuring three conditions: (1) if the bitwidth of retained groups is $b$, only $1/b$ of the groups can be preserved, thereby maintaining an average bitwidth of 1; (2) adopting random pruning to ensure the unbiased nature of quantization; (3) groups with larger ranges are more likely to be retained. Based on that, we first assign each group a probability $p_{i}\in[0,1],i=1,\cdots,N$. To retain $\frac{N}{b}$ groups and ensure the retained groups have a large range, $p_{i}$ needs to satisfy $\sum_{i=1}^{N}p_{i}=\frac{N}{b}$ and $p_{i}\propto R_{i}$, i.e., $p_{i}=\frac{NR_{i}}{bR_{total}}$, $R_{total}=\sum_{i=1}^{N}R_{i}$. Then we define random masks $m_{i}\sim\operatorname{Bern}\left(p_{i}\right)$ to prune unimportant groups, and perform per-group quantization on the remaining ones. Its form is:
$Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})=Q_{PSQ}^{b}({\mathbf{M}}\hat{\nabla}_{
\mathbf{H}^{(l)}}),$
where ${\mathbf{M}}=\operatorname{diag}(\frac{m_{1}}{p_{1}},\ldots,\frac{m_{N}}{p_{N}})$, $Q_{PSQ}^{b}$ is $b$-bit PSQ. $Q_{g}$ is an unbiased quantizer since $\mathbb{E}[Q_{PSQ}^{b}({\mathbf{M}}\hat{\nabla}_{\mathbf{H}^{(l)}})]=\mathbb{E
}[{\mathbf{M}}]\hat{\nabla}_{\mathbf{H}^{(l)}}=\mathbf{I}\hat{\nabla}_{\mathbf
{H}^{(l)}}$. The variance is

$$ $\operatorname{Var}\left[Q_{g}\left(\hat{\nabla}_{\mathbf{H}^{(l)}}\right)\mid \hat{\nabla}_{\mathbf{H}^{(l)}}\right]\leq\frac{D^{(l)}}{4B^{2}}\sum_{i=1}^{ \frac{N}{b}}R_{i}^{2}.$ (4) $$

From Eq. 4, it can be observed that the variance of our quantizer is significantly smaller than that of 1-bit PSQ ($\frac{D^{(l)}}{4}\sum_{i=1}^{N}R_{i}^{2}$). The proof is given
in Appendix B.

Despite reducing the average precision of each element to 1 bit through pruning, the practical acceleration is hindered by the fact that the retained groups maintain a precision of $b$-bit. We perform a lossless decomposition of the $b$-bit element: $x=\sum_{i=1}^{b}2^{(i-1)}x^{i}$, where $x^{i}$ represents the value at $i$-th bit of the $b$-bit element. Extend the decomposition operation to the entire tensor, Eq. 3 becomes:$\hat{\nabla}_{\mathbf{H}^{(l-1)}}=\sum_{i=1}^{b}{2^{(i-1)}{(Q_{g}(\hat{\nabla}
_{\mathbf{H}^{(l)}}))}^{i}\operatorname{sign}({\boldsymbol{\Theta}}^{(l)^{\top
}})},\hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}=\sum_{i=1}^{b}{2^{(i-1)}{
\operatorname{sign}({\mathbf{H}}^{(l-1)^{\top}}){(Q_{g}(\hat{\nabla}_{\mathbf{
H}^{(l)}}))}^{i}}},$ where ${(Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}}))}^{i}$ represents the $i$-th binarized slice tensor of ${Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})}$, where each element represents the value at the $i$-th bit of the corresponding element in ${Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})}$. Due to the removal of some groups, the shape of the result differs from the original, and we fill the gaps with zeros. The entire process is illustrated in Fig. 3.

### 5.3 Practical Acceleration

In order to ensure the compatibility of our method with low-bit hardware, we first illustrate the necessary conditions for achieving practical acceleration through a PSQ example. The form of PSQ can be rewritten as: $Q_{PSQ}(\hat{\nabla}_{\mathbf{H}^{(l)}})=\mathbf{S}_{float}\overline{\nabla}_{
\mathbf{H}^{(l)}}$, where $\mathbf{S}_{float}=\operatorname{diag}\left\{\frac{R_{1}}{B},\ldots,\frac{R_{N
}}{B}\right\}$ is a FP32 tensor and $\overline{\nabla}_{\mathbf{H}^{(l)}}$ is a 1-bit tensor. The Eq. 3 can be rewritten as: $\hat{\nabla}_{\mathbf{H}^{(l-1)}}=\mathbf{S}_{float}\overline{\nabla}_{\mathbf
{H}^{(l)}}\operatorname{sign}({\boldsymbol{\Theta}}^{(l)^{\top}}),\hat{\nabla}
_{\boldsymbol{\Theta}^{(l)}}=\operatorname{sign}({\mathbf{H}}^{(l-1)^{\top}})
\mathbf{S}_{float}\overline{\nabla}_{\mathbf{H}^{(l)}},$

Figure: Figure 3: The process of AGP and binary matrix multiplication. $BIT$ represents the bitwidth of full precision data. Here, we removed half of the groups, thus the bitwidth of the remaining groups is 2.
Refer to caption: x4.png

Figure: Figure 4: The computational graph of 1-bit FQT. The figure only shows the forward propagation of the last two layers and the backward propagation of the final layer.
Refer to caption: x5.png

where the computation of activation gradients $\hat{\nabla}_{\mathbf{H}^{(l-1)}}$ can be accelerated, as 1-bit matrix multiplication (MM) $\overline{\nabla}_{\mathbf{H}^{(l)}}\operatorname{sign}({\boldsymbol{\Theta}}^
{(l)^{\top}})$ can be implemented efficiently on hardware. However, weight gradients $\hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}$ cannot be efficiently computed, as one of the two 1-bit tensors $\overline{\nabla}_{\mathbf{H}^{(l)}}$ needs to be dequantized to a full-precision tensor before their multiplication. This severely limits the acceleration.

To address this issue, we propose Sample Channel joint Quantization (SCQ), wherein PCQ is employed during the computation of weight gradients, while PSQ is utilized for the computation of activation gradients. Building upon this quantization strategy, the backpropagation process can be rewritten as:
$\hat{\nabla}_{\mathbf{H}^{(l-1)}}=\mathbf{S}_{PSQ}\overline{\nabla}_{\mathbf{H
}_{PSQ}^{(l)}}\operatorname{sign}({\boldsymbol{\Theta}}^{(l)^{\top}}),\hat{
\nabla}_{\boldsymbol{\Theta}^{(l)}}=\operatorname{sign}({\mathbf{H}}^{(l-1)^{
\top}})\overline{\nabla}_{\mathbf{H}_{PCQ}^{(l)}}\mathbf{S}_{PCQ},$
where $\mathbf{S}_{PCQ}=\operatorname{diag}\left\{\frac{R_{1}^{c}}{B},\ldots,\frac{R^
{c}_{D^{(l)}}}{B}\right\}$, $R_{i}^{c}$ represents the range of $i$-th channel. This strategy facilitates the acceleration of both weight and activation gradient computations. We integrate this strategy with the previously proposed AGP (Fig. 4), resulting in the final formulation:
$\hat{\nabla}_{\mathbf{H}^{(l-1)}}=Q_{PSQ}^{b}\left({\mathbf{M}}_{PSQ}\hat{
\nabla}_{\mathbf{H}^{(l)}}\right)\operatorname{sign}({\boldsymbol{\Theta}}^{(l
)^{\top}}),\hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}=\operatorname{sign}({
\mathbf{H}}^{(l-1)^{\top}})Q_{PCQ}^{b}\left(\hat{\nabla}_{\mathbf{H}^{(l)}}{
\mathbf{M}}_{PCQ}\right).$
Since PCQ treats a channel as a group, pruning operations also need to be performed along the channel dimension. Due to space constraints, decomposition and implementation details are provided in Appendix C.

## 6 Experiments

We evaluate our approach on transfer learning tasks. Although our approach is constrained to transfer learning, it still holds practical value in on-device training Lin et al. (). Due to challenges such as environmental constraints and limited memory, it is impractical to perform training from scratch on edge devices Ren et al. (). The experiment details and results from training from scratch are in Appendix D.

**Table 1: Experimental results on multiple downstream datasets. “(W, A, G)" denote the bitwidth of weight, activations, and gradients, respectively. $b$ represents the bitwidth of the remaining groups.**
| Method | Precision | Accuracy(%) |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| (W, A, G) | CIFAR-10 | CIFAR-100 | Flowers | Cars | Pets | CUB | Average |  |
| ResNet-18 |  |  |  |  |  |  |  |  |
| QAT | 1, 1, 32 | 87.31$\pm$.25 | 65.82$\pm$.43 | 78.85$\pm$.80 | 50.81$\pm$.38 | 71.68$\pm$.21 | 42.13$\pm$.43 | 66.10 |
| PSQ | 8, 8, 8 | 92.90$\pm$.03 | 75.83$\pm$.05 | 85.96$\pm$.44 | 71.09$\pm$.71 | 87.86$\pm$.20 | 61.22$\pm$.05 | 79.14 |
| \hdashlinePSQ | 1, 1, 1 | 71.04$\pm$.61 | 47.71$\pm$.98 | 78.91$\pm$.10 | 23.14$\pm$.91 | 68.93$\pm$.39 | 34.29$\pm$.62 | 54.01 |
| Ours ($b=2$) | 1, 1, 1 | 74.10$\pm$.21 | 52.19$\pm$.62 | 79.93$\pm$.20 | 26.51$\pm$.76 | 70.47$\pm$.52 | 36.59$\pm$.31 | 56.63 |
| Ours ($b=4$) | 1, 1, 1 | 78.52$\pm$.56 | 56.83$\pm$.61 | 79.28$\pm$.50 | 37.88$\pm$.36 | 71.17$\pm$.16 | 39.47$\pm$.25 | 60.53 |
| Ours ($b=8$) | 1, 1, 1 | 73.73$\pm$.99 | 52.64$\pm$.36 | 78.10$\pm$.65 | 29.78$\pm$.89 | 69.98$\pm$.32 | 37.01$\pm$.53 | 56.87 |
| VGGNet-16 |  |  |  |  |  |  |  |  |
| QAT | 1, 1, 32 | 89.80$\pm$.36 | 71.70$\pm$.17 | 86.86$\pm$.35 | 67.65$\pm$.03 | 79.49$\pm$.44 | 53.39$\pm$.57 | 74.82 |
| PSQ | 8, 8, 8 | 90.88$\pm$.07 | 73.12$\pm$.09 | 88.59$\pm$.15 | 81.27$\pm$.05 | 90.33$\pm$.03 | 69.49$\pm$.09 | 82.28 |
| \hdashlinePSQ | 1, 1, 1 | 80.60$\pm$.20 | 59.81$\pm$.20 | 84.65$\pm$.05 | 40.01$\pm$.88 | 77.20$\pm$.38 | 43.17$\pm$.44 | 64.24 |
| Ours ($b=2$) | 1, 1, 1 | 82.66$\pm$.44 | 62.04$\pm$.01 | 85.75$\pm$.29 | 44.40$\pm$.92 | 77.77$\pm$.35 | 46.33$\pm$.53 | 66.49 |
| Ours ($b=4$) | 1, 1, 1 | 84.38$\pm$.12 | 63.65$\pm$.19 | 87.12$\pm$.20 | 57.06$\pm$.60 | 78.48$\pm$.21 | 49.10$\pm$.17 | 69.97 |
| Ours ($b=8$) | 1, 1, 1 | 78.14$\pm$.86 | 60.20$\pm$.08 | 86.24$\pm$.15 | 46.95$\pm$.21 | 77.39$\pm$.26 | 47.48$\pm$.20 | 66.07 |

**Table 2: Comparison of training speedup across different input resolutions. "-Basic" and "Basic" represent unoptimized FQT and unoptimized FP32 training. The baseline is FP32 Pytorch.**
| Model | Method | Precision | Hygon | Raspberry Pi 5 |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| (W, A, G) | 32 | 64 | 128 | 224 | average | 32 | 64 | average |  |  |
| VGGNet-16 | Basic | 32, 32, 32 | 0.04× | 0.03× | 0.03× | 0.02× | 0.03× | 0.05× | 0.02× | 0.04× |
| PSQ-Basic | 8, 8, 8 | 0.08× | 0.06× | 0.06× | 0.06× | 0.07× | 0.10× | 0.04× | 0.07× |  |
| SCQ-Basic | 8, 8, 8 | 0.24× | 0.18× | 0.17× | 0.15× | 0.19× | 0.23× | 0.08× | 0.16× |  |
| Ours-Basic | 1, 1, 1 | 4.36× | 3.25× | 3.19× | 1.86× | 3.17× | 3.47× | 1.17× | 2.32× |  |
|  | Ours | 1, 1, 1 | 5.13× | 3.71× | 3.38× | 2.73× | 3.74× | 3.72× | 1.25× | 2.49× |
| ResNet-18 | Basic | 32, 32, 32 | 0.03× | 0.03× | 0.03× | 0.02× | 0.03× | 0.02× | 0.02× | 0.02× |
| PSQ-Basic | 8, 8, 8 | 0.07× | 0.07× | 0.06× | 0.06× | 0.07× | 0.05× | 0.03× | 0.04× |  |
| SCQ-Basic | 8, 8, 8 | 0.17× | 0.17× | 0.16× | 0.16× | 0.17× | 0.11× | 0.08× | 0.10× |  |
| Ours-Basic | 1, 1, 1 | 2.69× | 2.75× | 2.31× | 1.30× | 2.26× | 1.33× | 0.92× | 1.13× |  |
|  | Ours | 1, 1, 1 | 2.93× | 2.88× | 2.62× | 2.15× | 2.65× | 1.42× | 0.97× | 1.20× |

### 6.1 Main Results

We employed two DNN architectures, ResNet18 He et al. () and VGGNet16 Simonyan and Zisserman (). We pre-trained them on ImageNet Deng et al. () and subsequently conducted QAT. The quantized models are fine-tuned on downstream datasets to evaluate our approach. Following Lin et al. (), we utilize various datasets, including Cars Krause et al. (), CIFAR-10 Krizhevsky et al. (), CIFAR-100 Krizhevsky et al. (), CUB Welinder et al. (), Flowers Nilsback and Zisserman () and Pets Parkhi et al. ().

Converged model accuracy.
To evaluate the performance of our method, we report the accuracy of two model architectures, VGG16 and ResNet18, across various datasets in Table 1. We report the mean and stddev of 3 runs. The compared approaches include QAT Bulat and Tzimiropoulos () and PSQ. Since QAT employs training with full precision gradients, it can be considered as an upper bound for the accuracy of 1-bit FQT. Existing work has not tried 1-bit FQT, so we did not compare more methods. On VGGNet16, our method achieves $<10\%$ average accuracy degradation across all configurations, as compared to the baseline QAT with 32-bit gradients. Moreover, in the optimal configuration ($b$=4), our method exhibit only approximately 5% average accuracy drop. On the more challenging ResNet18, the worst configuration ($b$=2) and the optimal configuration ($b$=4) achieves 9.47% and 5.57% average accuracy degradation, respectively, compared to QAT. Furthermore, on some datasets such as Flowers and Pets, our method exhibits minimal accuracy loss, indicating its suitability for these datasets. In summary, while our approach exhibits a notable decrease in accuracy compared to QAT, the incurred gap remains acceptable considering the benefits gained from reducing the numerical precision of gradients to 1 bit. Additionally, we compared our method with 1-bit PSQ. Across both frameworks, our approach consistently outperformed it in terms of average accuracy across all configurations. Moreover, except for individual outcomes in the worst configuration, our method also exhibited superior accuracy across all datasets.

Figure: Figure 5: Our method (left) vs. PSQ (right): Testing accuracy on VGGNet16 for CIFAR-10.
Refer to caption: x6.png

The value of $b$.
We investigate the impact of hyperparameter $b$ on performance and determine the optimal choice for $b$. From Eq. 4, as $b$ increases, the variance of the quantizer gradually decreases, suggesting an improvement in training convergence. However, the increase in $b$ also implies more discarded groups, leading to larger losses. Therefore, the choice of $b$ becomes a trade-off issue. In Table 1, we report the accuracy of our method across various datasets under three different configurations ($b=2$, $b=4$, and $b=8$). On VGGNet16 and ResNet18, the configuration with $b=4$ consistently outperforms the others ($b=2$ and $b=8$) in terms of average accuracy. Moreover, this observation extends to the majority of datasets, where, even on a few datasets, the results for the configuration

Figure: Figure 6: Quantizer variances across different datasets.
Refer to caption: x8.png

with $b=4$ may not be optimal, the performance difference remains marginal compared to the optimal results. In conclusion, the optimal configuration is $b=4$.

Effect of the optimizer.
To validate our theory that the SGD optimizer is more sensitive to the variance of gradients compared to the Adam optimizer, we conduct a performance comparison of different optimizers on the CIFAR-10 dataset. We present
the test accuracy curves of our method and PSQ across
different optimizers in Fig. 5. For both methods, model performance degrades when using the SGD compared to the Adam. This is primarily attributed to the sensitivity of SGD to gradient variance. In addition, we observed that our method with SGD experienced only a modest accuracy drop, whereas the PSQ method with SGD failed to converge entirely. We attribute this observation to the larger variance introduced by PSQ compared to our quantizer, resulting in divergence.

Variance.To demonstrate the advantages of our quantizer in reducing variance, we present the quantizer variance of ResNet18 in
Fig. 6. In general, the quantizer variance of our method is lower than that of PSQ across all datasets. Additionally, the variance on the Flowers and Pets is lowest, explaining why the impact of quantization on accuracy is minor for them.

Other results.
We report results for other architectures and tasks in Table 4. The details can be found in Appendix D. On Faster R-CNN Ren et al. (), our approach with 1-bit gradients achieves 1.66% mAP degradation, as compared to the baseline QAT with 32-bit gradients. In addition, for Mixer-MLP Tolstikhin et al. (), an all-MLP architecture, our approach shows a decrease of 3.52% in classification accuracy compared to the baseline. For BERT, our approach achieves 8.39% average performance degradation. These results indicate the potential of our approach to transfer to other architectures and tasks.

### 6.2 Computational Efficiency

We discuss the computational overhead of our method. Our implementation is not fully optimized, as the comprehensive hardware-algorithm co-design is beyond the scope of this paper. Our experiments are conducted on a single-core Hygon CPU and edge device (Raspberry Pi 5).

Training speedup. We compare the training time of the FP32 PyTorch and our 1-bit FQT for VGGNet16 and ResNet18. We vary the resolution of the input and summarize the speedup of our method in Table 2. For VGGNet16, our algorithm achieves an average speedup of 3.74× and 2.49× on the Hygon and edge device, respectively. For ResNet18, our algorithm achieves 2.65× and 1.20× average speedup. Additionally, to assess the acceleration potential of 1-bit FQT, we compare their speedup under the condition without optimization (Ours-Basic and Basic). The results indicate that across multiple cases, the speedup is well above a *hundredfold*. On edge devices, our method achieves a speedup of over 50×. This gap indicates significant acceleration potential for 1-bit FQT. Finally, we compare the speedup across layers of VGGNet16 and the time consumption for each operation in Appendix D, providing guidance for future optimization directions.

8-bit PSQ vs. Ours.
To demonstrate the advantages of our method over other high-bit-width FQT methods, we compare our approach with 8-bit PSQ in terms of both speedup and classification performance (there is no 4-bit format among the standard data types). Table 1 reveals that compared to 8-bit PSQ, our method experiences an average accuracy reduction of 18.61% and 12.31% on ResNet18 and VGG16, respectively. Despite significant performance degradation, our approach achieves an average speedup of 32.28× and 45.28× over 8-bit PSQ on ResNet18 and VGG16, respectively. On Raspberry Pi 5, our speedup can also reach approximately 30×. Even when compared to hardware-friendly SCQ, 1-bit FQT achieves a speedup of over 10× (Table 2) Therefore, our method can be particularly beneficial in scenarios sensitive to time overhead.

Average 1-bit vs. 1-bit. We compared the runtime of average 1-bit matrix multiplication and 1-bit matrix multiplication across different matrix sizes in Table 4. The results demonstrate that the difference in runtime between these two methods is minimal, indicating similarity in the runtime of our average 1-bit FQT and 1-bit FQT. The analysis is provided in the Appendix C.

**Table 3: Object detection on PASCAL VOC, classification on CIFAR-100 and NLP tasks on GLUE.**
| Task | Model | Method | Bits | mAP/Acc./Avg. |
| --- | --- | --- | --- | --- |
| Det. | Faster R-CNN | QAT | 32 | 52.34 |
| Faster R-CNN | Ours | 1 | 50.68 |  |
| Cls. | MLP-Mixer | QAT | 32 | 52.17 |
| MLP-Mixer | Ours | 1 | 48.65 |  |
| NLP | BERT | QAT | 32 | 63.20 |
| BERT | Ours | 1 | 54.81 |  |

## 7 Conclusion

We propose a hardware-friendly 1-bit FQT method in this work, which pushes the limit of FQT. Through convergence analysis, we propose AGP to reduce the variance of the quantizer, thereby enhancing the convergence of quantized training. Subsequently, to address the issue of unacceleratable weight gradient computation, we present a SCQ strategy. Finally, we propose a framework that practically accelerates training, achieving a speedup of up to 5.13× compared to full precision training. While our approach focuses solely on convolutional neural networks in this study, experiments indicate its potential applicability to other architectures.

Limitations: The primary limitation of this work lies in its ability to achieve 1-bit FQT in transfer learning tasks but not in training from scratch. To the best of our knowledge, even the 3-bit FQT from scratch is still an open problem.

## Broader Impact

The introduction of 1-bit Fully Quantized Training (FQT) presents a significant advancement in deep neural network training, promising accelerated model training. Recently, huge models Brown et al. () have achieved remarkable results across various domains. However, the training cost of these models is becoming increasingly expensive. The escalating training costs are leading to a growing dependence on computational resources in machine learning research, which raises concerns about fairness. FQT can effectively reduce the training expenses, thereby democratizing model training for a broader audience. Additionally, 1-bit FQT makes training on edge devices feasible. The models deployed on edge devices require updates when learning new data. However, due to environmental and memory constraints, these models cannot be directly updated Ren et al. (). One straightforward approach is to conduct training directly on the edge device. However, the computational resources of edge devices are often insufficient to support model training. 1-bit FQT holds the promise of addressing this challenge.

## Appendix A Proof of Theorems

###### Lemma A.1

If a function $\mathcal{L}:R^{d}\rightarrow R$ is convex, then for all $x,y\in R^{d}$,

$$ $\mathcal{L}(y)\geq\mathcal{L}(x)+\nabla\mathcal{L}(x)^{T}(y-x).$ $$

###### Lemma A.2

Let $\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}=\hat{\nabla}\mathcal{L}_{t}\left(
\boldsymbol{\Theta}_{t}\right)$ and $\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:t}}$ be defined as above and bounded, $\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}\right\|_{2}\leq G,\left\|\hat{
\nabla}_{{\boldsymbol{\Theta}}_{t}}\right\|_{\infty}\leq$ $G_{\infty}$. Then,

$$ $\sum_{t=1}^{T}\sqrt{\frac{\hat{\nabla}_{{\boldsymbol{\Theta}}_{t,i}^{2}}}{t}} \leq 2G_{\infty}\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:T,i}}\right\|_{2}.$ $$

###### Lemma A.3

Let $\gamma\triangleq\frac{\beta_{1}^{2}}{\sqrt{\beta_{2}}}$. For $\beta_{1},\beta_{2}\in[0,1)$ that satisfy $\frac{\beta_{1}^{2}}{\sqrt{\beta_{2}}}<1$ and bounded $\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}},\left\|\hat{\nabla}_{{\boldsymbol{
\Theta}}_{t}}\right\|_{2}\leq G$, $\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}\right\|_{\infty}\leq G_{\infty}$, the following inequality holds

$$ $\sum_{t=1}^{T}\frac{\widehat{m}_{t,i}^{2}}{\sqrt{t\widehat{v}_{t,i}}}\leq\frac {2}{1-\gamma}\frac{1}{\sqrt{1-\beta_{2}}}\left\|\hat{\nabla}_{{\boldsymbol{ \Theta}}_{1:T,i}}\right\|_{2}.$ $$

The above lemma has been previously proven in Kingma and Ba (), and we omit its reproof here for brevity.

###### Lemma A.4

For a random matrix $\mathbf{X}$, the following inequality holds

$$ $\mathbb{E}[\|\mathbf{X}\|_{2}]\leq\sqrt{\mathbb{E}[\|\mathbf{X}\|_{2}^{2}]}$ $$

Proof. According to the formula $\mathbb{E}[{x}^{2}]=\operatorname{Var}[x]+{\mathbb{E}^{2}[x]}$, we can derive:

$$ $\displaystyle\sqrt{\mathbb{E}[\|\mathbf{X}\|_{2}^{2}]}$ $\displaystyle=\sqrt{\mathbb{E}^{2}[\|\mathbf{X}\|_{2}]+\operatorname{Var}[\| \mathbf{X}\|_{2}]}$ $\displaystyle\geq\sqrt{\mathbb{E}^{2}[\|\mathbf{X}\|_{2}]}$ $\displaystyle=\mathbb{E}[\|\mathbf{X}\|_{2}].$ $$

###### Lemma A.1

###### Lemma A.2

###### Lemma A.3

###### Lemma A.4

### A.1 Theorem 4.3: Convergence of SGD

Proof. The iteration form of SGD is

$$ $\boldsymbol{\Theta}_{t+1}\leftarrow\boldsymbol{\Theta}_{t}-{\alpha}_{t}\hat{ \nabla}_{{\boldsymbol{\Theta}}_{t}}.$ $$

Subtract the scalar $\boldsymbol{\Theta}^{*}$ and square both sides of the above update, we have,

$$ $\|\boldsymbol{\Theta}_{t+1}-\boldsymbol{\Theta}^{*}\|^{2}-\|\boldsymbol{\Theta }_{t}-\boldsymbol{\Theta}^{*}\|^{2}=-2{\alpha}_{t}\hat{\nabla}_{{\boldsymbol{ \Theta}}_{t}}(\boldsymbol{\Theta}_{t}-\boldsymbol{\Theta}^{*})+{\alpha}^{2}_{t }\hat{\nabla}_{\boldsymbol{\Theta}_{t}^{2}}.$ $$

Taking exception on both sides and use Assumption4.1, 4.2 and Lemma A.1, we have

$$ $\displaystyle\|\boldsymbol{\Theta}_{t+1}-\boldsymbol{\Theta}^{*}\|^{2}-\| \boldsymbol{\Theta}_{t}-\boldsymbol{\Theta}^{*}\|^{2}$ $\displaystyle=-2{\alpha}_{t}{\nabla}_{{\boldsymbol{\Theta}}_{t}}(\boldsymbol{ \Theta}_{t}-\boldsymbol{\Theta}^{*})+{\alpha}^{2}_{t}\mathbb{E}[\hat{\nabla}_{ \boldsymbol{\Theta}_{t}^{2}}]$ $\displaystyle\leq-2{\alpha}_{t}\left[{\mathcal{L}}_{t}\left({\boldsymbol{ \Theta}}_{t}\right)-{\mathcal{L}}_{t}\left({\boldsymbol{\Theta}}^{*}\right) \right]+{\alpha}_{t}^{2}\sum_{i=1}^{d}(\mathbb{E}[\hat{\nabla}_{\boldsymbol{ \Theta}_{t,i}^{2}}])$ $\displaystyle\leq-2{\alpha}_{t}\left[{\mathcal{L}}_{t}\left({\boldsymbol{ \Theta}}_{t}\right)-{\mathcal{L}}_{t}\left({\boldsymbol{\Theta}}^{*}\right) \right]+{\alpha}_{t}^{2}d({\sigma}^{2}+e^{2}).$ $$

Using $\alpha\geq\alpha_{t}$, we have

$$ $\|\boldsymbol{\Theta}_{t+1}-\boldsymbol{\Theta}^{*}\|^{2}-\|\boldsymbol{\Theta }_{t}-\boldsymbol{\Theta}^{*}\|^{2}\leq-2{\alpha}\left[{\mathcal{L}}_{t}\left( {\boldsymbol{\Theta}}_{t}\right)-{\mathcal{L}}_{t}\left({\boldsymbol{\Theta}}^ {*}\right)\right]+{\alpha}^{2}d({\sigma}^{2}+e^{2})$ $$

Sum up for $t=1,\ldots,T$,

$$ $\|\boldsymbol{\Theta}_{T+1}-\boldsymbol{\Theta}^{*}\|^{2}-\|\boldsymbol{\Theta }_{1}-\boldsymbol{\Theta}^{*}\|^{2}\leq-2\alpha R^{SGD}(T)+{\alpha}^{2}Td({ \sigma}^{2}+e^{2}).$ $$

We can rearrange the above equation and $\left\|\boldsymbol{\Theta}_{n}-\boldsymbol{\Theta}_{m}\right\|_{2}\leq D$,

$$ $\displaystyle R^{SGD}(T)$ $\displaystyle\leq\frac{\|\boldsymbol{\Theta}_{1}-\boldsymbol{\Theta}^{*}\|^{2} -\|\boldsymbol{\Theta}_{T+1}-\boldsymbol{\Theta}^{*}\|^{2}}{2\alpha}+\frac{ \alpha Td({\sigma}^{2}+e^{2})}{2}$ $\displaystyle\leq\frac{D^{2}}{2\alpha}+\frac{\alpha Td({\sigma}^{2}+e^{2})}{2}$ $$

### A.2 Theorem 4.5: Convergence of Adam

Proof. The iteration of Adam is

$$ $\displaystyle\left\{\begin{array}[]{l}m_{t}=\beta_{1,t}\cdot m_{t-1}+\left(1- \beta_{1,t}\right)\cdot\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}},\\ v_{t}=\beta_{2}\cdot v_{t-1}+\left(1-\beta_{2}\right)\cdot\left(\hat{\nabla}_{ {\boldsymbol{\Theta}}_{t}}\right)^{2},\\ \hat{m}_{t}=\frac{m_{t}}{1-\beta_{1}^{t}},\hat{v}_{t}=\frac{v_{t}}{1-\beta_{2} ^{t}}\\ \boldsymbol{\Theta}_{t+1}=\boldsymbol{\Theta}_{t}-\frac{\alpha}{\sqrt{\hat{v}} +\epsilon}\cdot\hat{m}_{t}.\end{array}\right.$ $$

Using Lemma A.1, we have,

$$ $\mathcal{L}_{t}\left(\boldsymbol{\Theta}_{t}\right)-\mathcal{L}_{t}\left( \boldsymbol{\Theta}^{*}\right)\leq{\nabla}_{{\boldsymbol{\Theta}}_{t}}^{T} \left(\theta_{t}-\theta^{*}\right)=\sum_{i=1}^{d}{\nabla}_{{\boldsymbol{\Theta }}_{t,i}}\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right).$ $$

From the above update rules presented, we have

$$ $\displaystyle\boldsymbol{\Theta}_{t+1}$ $\displaystyle=\boldsymbol{\Theta}_{t}-\alpha_{t}\widehat{m}_{t}/\sqrt{\widehat {v}_{t}}$ $\displaystyle=\boldsymbol{\Theta}_{t}-\frac{\alpha_{t}}{1-\beta_{1}^{t}}\left( \frac{\beta_{1,t}}{\sqrt{\widehat{v}_{t}}}m_{t-1}+\frac{\left(1-\beta_{1,t} \right)}{\sqrt{\widehat{v}_{t}}}\hat{\nabla}_{{\boldsymbol{\Theta}}_{t}}\right).$ $$

For the $i^{th}$ dimension of the parameter, we subtract the scalar $\boldsymbol{\Theta}_{,i}^{*}$ and square both sides of the above update rule, we have,

$$ $\displaystyle\left(\boldsymbol{\Theta}_{t+1,i}-\boldsymbol{\Theta}_{,i}^{*} \right)^{2}=$ $\displaystyle\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*} \right)^{2}-\frac{2\alpha_{t}}{1-\beta_{1}^{t}}\left(\frac{\beta_{1,t}}{\sqrt{ \widehat{v}_{t,i}}}m_{t-1,i}+\frac{\left(1-\beta_{1,t}\right)}{\sqrt{\widehat{ v}_{t,i}}}\hat{\nabla}_{{\boldsymbol{\Theta}}_{t,i}}\right)\left(\boldsymbol{ \Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)$ $\displaystyle+\alpha_{t}^{2}\left(\frac{\widehat{m}_{t,i}}{\sqrt{\widehat{v}_{ t,i}}}\right)^{2}.$ $$

We can rearrange the above equation and use Young’s inequality, $ab\leq a^{2}/2+b^{2}/2$. Also, it can be shown that

$$ $\sqrt{\widehat{v}_{t,i}}=\sqrt{\sum_{j=1}^{t}\left(1-\beta_{2}\right)\beta_{2} ^{t-j}\hat{\nabla}_{{\boldsymbol{\Theta}}_{j,i}^{2}}}/\sqrt{1-\beta_{2}^{t}} \leq\left\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:t,i}}\right\|_{2},$ (5) $$

and ${\beta}_{1,t}\leq\beta_{1}$. Then

$$ $\displaystyle\hat{\nabla}_{{\boldsymbol{\Theta}}_{t,i}}\left(\boldsymbol{ \Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)=$ $\displaystyle\frac{\left(1-\beta_{1}^{t}\right)\sqrt{\widehat{v}_{t,i}}}{2 \alpha_{t}\left(1-\beta_{1,t}\right)}\left(\left(\boldsymbol{\Theta}_{t,i}- \boldsymbol{\Theta}_{,i}^{*}\right)^{2}-\left(\boldsymbol{\Theta}_{t+1,i}- \boldsymbol{\Theta}_{,i}^{*}\right)^{2}\right)$ $\displaystyle+\frac{\beta_{1,t}}{\left(1-\beta_{1,t}\right)}\frac{\widehat{v}_ {t-1,i}^{\frac{1}{4}}}{\sqrt{\alpha_{t-1}}}\left(\boldsymbol{\Theta}_{,i}^{*}- \boldsymbol{\Theta}_{t,i}\right)\sqrt{\alpha_{t-1}}\frac{m_{t-1,i}}{\widehat{v }_{t-1,i}^{\frac{1}{4}}}$ $\displaystyle+\frac{\alpha_{t}\left(1-\beta_{1}^{t}\right)\sqrt{\widehat{v}_{t ,i}}}{2\left(1-\beta_{1,t}\right)}\left(\frac{\widehat{m}_{t,i}}{\sqrt{ \widehat{v}_{t,i}}}\right)^{2}$ $\displaystyle\leq$ $\displaystyle\frac{1}{2\alpha_{t}\left(1-\beta_{1}\right)}\left(\left( \boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)^{2}-\left( \boldsymbol{\Theta}_{t+1,i}-\boldsymbol{\Theta}_{,i}^{*}\right)^{2}\right) \sqrt{\widehat{v}_{t,i}}$ $\displaystyle+\frac{\beta_{1,t}}{2\alpha_{t-1}\left(1-\beta_{1,t}\right)}\left (\boldsymbol{\Theta}_{,i}^{*}-\boldsymbol{\Theta}_{t,i}\right)^{2}\sqrt{ \widehat{v}_{t-1,i}}$ $\displaystyle+\frac{\beta_{1}\alpha_{t-1}}{2\left(1-\beta_{1}\right)}\frac{m_{ t-1,i}^{2}}{\sqrt{\widehat{v}_{t-1,i}}}+\frac{\alpha_{t}}{2\left(1-\beta_{1} \right)}\frac{\widehat{m}_{t,i}^{2}}{\sqrt{\widehat{v}_{t,i}}}.$ $$

We apply Lemma A.3 to the above inequality and sum across all the dimensions for $i\in 1,\dots,d$ and the iterations for $t\in 1,\dots,T$:

$$ $\displaystyle\sum_{i=1}^{d}\sum_{t=1}^{T}\hat{\nabla}_{{\boldsymbol{\Theta}}_{ t,i}}\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)\leq$ $\displaystyle\sum_{i=1}^{d}\frac{1}{2\alpha\left(1-\beta_{1}\right)}\left( \boldsymbol{\Theta}_{1,i}-\boldsymbol{\Theta}_{,i}^{*}\right)^{2}\sqrt{ \widehat{v}_{1,i}}$ $\displaystyle+\sum_{i=1}^{d}\sum_{t=2}^{T}\frac{1}{2\left(1-\beta_{1}\right)} \left(\boldsymbol{\boldsymbol{\Theta}}_{t,i}-\boldsymbol{\Theta}_{,i}^{*} \right)^{2}\left(\frac{\sqrt{\widehat{v}_{t,i}}}{\alpha_{t}}-\frac{\sqrt{ \widehat{v}_{t-1,i}}}{\alpha_{t-1}}\right)$ $\displaystyle+\frac{\alpha(1+\beta_{1})G_{\infty}}{\left(1-\beta_{1}\right) \sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sum_{i=1}^{d}\left\|\hat{\nabla}_{{ \boldsymbol{\Theta}}_{1:T,i}}\right\|_{2}$ $\displaystyle+\sum_{i=1}^{d}\sum_{t=1}^{T}\frac{\beta_{1,t}}{2\alpha_{t}\left( 1-\beta_{1,t}\right)}\left(\boldsymbol{\Theta}_{,i}^{*}-\boldsymbol{\Theta}_{t ,i}\right)^{2}\sqrt{\widehat{v}_{t,i}}$ $$

From the assumption, $\left\|\boldsymbol{\Theta}_{t}-\boldsymbol{\Theta}^{*}\right\|_{2}\leq D,\left
\|\boldsymbol{\Theta}_{m}-\boldsymbol{\Theta}_{n}\right\|_{\infty}\leq D_{\infty}$, we have

$$ $\displaystyle\sum_{i=1}^{d}\sum_{t=1}^{T}\hat{\nabla}_{{\boldsymbol{\Theta}}_{ t,i}}\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)\leq$ $\displaystyle\frac{D^{2}}{2\alpha\left(1-\beta_{1}\right)}\sum_{i=1}^{d}\sqrt{ T\widehat{v}_{T,i}}+\frac{D_{\infty}^{2}}{2\alpha}\sum_{i=1}^{d}\sum_{t=1}^{T} \frac{\beta_{1,t}}{\left(1-\beta_{1,t}\right)}\sqrt{t\widehat{v}_{t,i}}$ $\displaystyle+\frac{\alpha\left(1+\beta_{1}\right)G_{\infty}}{\left(1-\beta_{1 }\right)\sqrt{1-\beta_{2}}(1-\gamma)^{2}}.\sum_{i=1}^{d}\left\|\hat{\nabla}_{{ \boldsymbol{\Theta}}_{1:T,i}}\right\|_{2}$ $$

We apply Eq. 5 to the above inequality, we have

$$ $\displaystyle\sum_{i=1}^{d}\sum_{t=1}^{T}\hat{\nabla}_{{\boldsymbol{\Theta}}_{ t,i}}\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)\leq$ $\displaystyle\frac{D^{2}\sqrt{T}}{2\alpha\left(1-\beta_{1}\right)}\sum_{i=1}^{ d}\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:T,i}}\|_{2}+\frac{D_{\infty}^{2}}{2 \alpha}\sum_{i=1}^{d}\sum_{t=1}^{T}\frac{\beta_{1,t}\sqrt{t}}{\left(1-\beta_{1 ,t}\right)}\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:t,i}}\|_{2}$ $\displaystyle+\frac{\alpha\left(1+\beta_{1}\right)G_{\infty}}{\left(1-\beta_{1 }\right)\sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sum_{i=1}^{d}\left\|\hat{\nabla}_{{ \boldsymbol{\Theta}}_{1:T,i}}\right\|_{2}$ $$

Take expectation on both sides of the above inequality and apply Lemma A.4, Assumption 4.1,

$$ $\displaystyle\sum_{i=1}^{d}\sum_{t=1}^{T}{\nabla}_{{\boldsymbol{\Theta}}_{t,i} }\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)\leq$ $\displaystyle\frac{D^{2}\sqrt{T}}{2\alpha\left(1-\beta_{1}\right)}\sum_{i=1}^{ d}\mathbb{E}[\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:T,i}}\|_{2}]$ $\displaystyle+\frac{\alpha\left(1+\beta_{1}\right)G_{\infty}}{\left(1-\beta_{1 }\right)\sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sum_{i=1}^{d}\mathbb{E}[|\hat{\nabla }_{{\boldsymbol{\Theta}}_{1:T,i}}\|_{2}]$ $\displaystyle+\frac{D_{\infty}^{2}}{2\alpha}\sum_{i=1}^{d}\sum_{t=1}^{T}\frac{ \beta_{1,t}\sqrt{t}}{\left(1-\beta_{1,t}\right)}\mathbb{E}[\|\hat{\nabla}_{{ \boldsymbol{\Theta}}_{1:t,i}}\|_{2}]$ $\displaystyle\leq$ $\displaystyle\frac{D^{2}\sqrt{T}}{2\alpha\left(1-\beta_{1}\right)}\sum_{i=1}^{ d}\sqrt{\mathbb{E}[\|\hat{\nabla}_{{\boldsymbol{\Theta}}_{1:T,i}}\|_{2}^{2}]}$ $\displaystyle+\frac{\alpha\left(1+\beta_{1}\right)G_{\infty}}{\left(1-\beta_{1 }\right)\sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sum_{i=1}^{d}\sqrt{\mathbb{E}[|\hat{ \nabla}_{{\boldsymbol{\Theta}}_{1:T,i}}\|_{2}^{2}]}$ $\displaystyle+\frac{D_{\infty}^{2}}{2\alpha}\sum_{i=1}^{d}\sum_{t=1}^{T}\frac{ \beta_{1,t}\sqrt{t}}{\left(1-\beta_{1,t}\right)}\sqrt{\mathbb{E}[\|\hat{\nabla }_{{\boldsymbol{\Theta}}_{1:t,i}}\|_{2}^{2}]}$ $\displaystyle\leq$ $\displaystyle\frac{D^{2}{T}}{2\alpha\left(1-\beta_{1}\right)}\sum_{i=1}^{d} \sqrt{\sigma^{2}+e^{2}}+\frac{\alpha\left(1+\beta_{1}\right)G_{\infty}\sqrt{T} }{\left(1-\beta_{1}\right)\sqrt{1-\beta_{2}}(1-\gamma)^{2}}\sum_{i=1}^{d}\sqrt {\sigma^{2}+e^{2}}$ $\displaystyle+\frac{D_{\infty}^{2}}{2\alpha}\sum_{i=1}^{d}\sum_{t=1}^{T}\frac{ \beta_{1,t}{t}}{\left(1-\beta_{1,t}\right)}\sqrt{\sigma^{2}+e^{2}}.$ $$

We can use arithmetic geometric series upper bound for the last term:

$$ $\displaystyle\sum_{t=1}^{T}\frac{\beta_{1,t}}{\left(1-\beta_{1,t}\right)}{t}$ $\displaystyle\leq\sum_{t=1}^{T}\frac{1}{\left(1-\beta_{1}\right)}\lambda^{t-1} {t}\leq\frac{1}{\left(1-\beta_{1}\right)(1-\lambda)^{2}}$ $$

Therefore, we have the following regret bound:

$$ $\displaystyle R(T)\leq$ $\displaystyle\sum_{i=1}^{d}\sum_{t=1}^{T}{\nabla}_{{\boldsymbol{\Theta}}_{t,i} }\left(\boldsymbol{\Theta}_{t,i}-\boldsymbol{\Theta}_{,i}^{*}\right)$ $\displaystyle\leq$ $\displaystyle\frac{((1-\lambda)^{2}D^{2}{T}+D_{\infty}^{2})d}{2\alpha\left(1- \beta_{1}\right)(1-\lambda)^{2}}\sqrt{\sigma^{2}+e^{2}}+\frac{\alpha\left(1+ \beta_{1}\right)G_{\infty}\sqrt{T}d}{\left(1-\beta_{1}\right)\sqrt{1-\beta_{2} }(1-\gamma)^{2}}\sqrt{\sigma^{2}+e^{2}}$ $$

## Appendix B Variance of Specific Quantizers

###### Proposition B.1

(Variance of stochastic rounding) For any number ${X}\in\mathbb{R}$, $\operatorname{Var}[\operatorname{SR}({X})]\leq\frac{1}{4}$.

Proof. For any real number $X$, let $p:=X-\lfloor X\rfloor\in[0,1)$, then

$$ $\displaystyle\operatorname{Var}[\operatorname{SR}(X)]=\mathbb{E}[\operatorname {SR}(X)-X]^{2}=p(\lceil X\rceil-X)^{2}+(1-p)(\lfloor X\rfloor-X)^{2}$ $\displaystyle=$ $\displaystyle p(1-p)^{2}+p^{2}(1-p)=p(1-p)(1-p+p)=p(1-p)\leq\frac{1}{4}.$ $$

###### Proposition B.1

### B.1 Per-sample Quantizer

Given an activation gradient $\hat{\nabla}_{\mathbf{H}^{(l)}}$, its per-sample quantization is:

$$ $Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}_{i,j}})=\operatorname{SR}(B(\hat{\nabla}_ {\mathbf{H}^{(l)}_{i,j}}-Z_{i})/R_{i})R_{i}/B+Z_{i},$ $$

where apply different ranges $R_{i}$ and zero points $Z_{i}$ for each sample of the gradient.
When $\mathbf{S}=\operatorname{diag}\left\{\frac{R_{1}}{B},\ldots,\frac{R_{N}}{B}\right\}$, we have

$$ $\displaystyle\operatorname{Var}\left[Q_{g}\left(\hat{\nabla}_{\mathbf{H}^{(l)} }\right)\right]$ $\displaystyle=\operatorname{Var}\left[\mathbf{S}\operatorname{SR}\left(( \mathbf{S}^{{-1}}\left(\hat{\nabla}_{\mathbf{H}^{(l)}}-\mathbf{1}\mathbf{Z} \right)\right)/+\mathbf{1}\mathbf{Z}\right]$ $\displaystyle\leq\sum_{i=1}^{N}\sum_{j=1}^{D^{(l)}}\operatorname{Var}[\frac{R_ {i}}{B}\operatorname{SR}(\frac{B}{R_{i}}(\hat{\nabla}_{\mathbf{H}^{(l)}_{i,j}} -Z_{i}))+Z_{i})]$ $\displaystyle=\sum_{i=1}^{N}\sum_{j=1}^{D^{(l)}}\frac{R_{i}^{2}}{B^{2}} \operatorname{Var}[\operatorname{SR}(\frac{B}{R_{i}}(\hat{\nabla}_{\mathbf{H}^ {(l)}_{i,j}}-Z_{i}))]$ $\displaystyle\leq\frac{D^{(l)}}{4B^{2}}\sum_{i=1}^{N}R_{i}^{2}.$ $$

### B.2 Per-sample Quantizer with AGP

Place the groups with the largest range in the first $N/b$ rows, and let the range of these groups be denoted by $R_{1},\dots,R_{N/b}$, groups in the remaining rows are denoted by $r_{N/b+1},\dots,r_{N}$. We assume that $r/R\approx 0$.

$$ $Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})=({\mathbf{M}}\mathbf{S})\operatorname{ SR}\left({(\mathbf{M}\mathbf{S}})^{-1}\left(\mathbf{M}\hat{\nabla}_{\mathbf{H} ^{(l)}}-\mathbf{M}\mathbf{Z}\right)\right)+\mathbf{M}\mathbf{Z},$ $$

where ${\mathbf{M}}=\operatorname{diag}\left(\frac{m_{1}}{p_{1}},\ldots,\frac{m_{N}}{
p_{N}}\right)$, $p_{i}=\frac{NR_{i}}{bR_{total}}$, $R_{total}=\sum_{i=1}^{N}R_{i}$ and $m_{i}\sim\operatorname{Bern}\left(p_{i}\right)$. To simplify the problem, we assume that $R_{1}\approx R_{2}\dots\approx R_{N/b}$. And we use
$r/R\approx 0$, then $p\approx\{1,\dots,0\}$. In other words, for the first $\frac{N}{b}$ rows, $m=1$, and 0 otherwise. We substitute it into the above equation and prune the groups with smaller ranges,

$$ $Q_{g}(\hat{\nabla}_{\mathbf{H}^{(l)}})=\mathbf{S}_{1:\frac{N}{b},1:\frac{N}{b} }\operatorname{SR}\left({(\mathbf{S}_{1:\frac{N}{b},1:\frac{N}{b}}})^{-1}\left (\hat{\nabla}_{\mathbf{H}^{(l)}_{1:\frac{N}{b}}}-\mathbf{1}\mathbf{Z}_{1:\frac {N}{b}}\right)\right)+\mathbf{1}\mathbf{Z}_{1:\frac{N}{b}}.$ $$

Then we have,

$$ $\displaystyle\operatorname{Var}\left[Q_{g}\left(\hat{\nabla}_{\mathbf{H}^{(l)} }\right)\right]$ $\displaystyle\leq\sum_{i=1}^{N/b}\sum_{j=1}^{D^{(l)}}\operatorname{Var}[\frac{ R_{i}}{B}\operatorname{SR}(\frac{B}{R_{i}}(\hat{\nabla}_{\mathbf{H}^{(l)}_{i,j }}-Z_{i}))+Z_{i})]$ $\displaystyle=\sum_{i=1}^{N/b}\sum_{j=1}^{D^{(l)}}\frac{R_{i}^{2}}{B^{2}} \operatorname{Var}[\operatorname{SR}(\frac{B}{R_{i}}(\hat{\nabla}_{\mathbf{H}^ {(l)}_{i,j}}-{Z}_{i}))]$ $\displaystyle\leq\frac{D^{(l)}}{4B^{2}}\sum_{i=1}^{N/b}R_{i}^{2}.$ $$

For 1-bit quantizers, the variance of PSQ is $\frac{D^{(l)}}{4}(\sum_{i=1}^{N/b}R_{i}^{2}+\sum_{i=N/b+1}^{N}r_{i}^{2})$. It is clear that

$$ $\frac{D^{(l)}}{4B^{2}}\sum_{i=1}^{N/b}R_{i}^{2}\leq\frac{D^{(l)}}{4}(\sum_{i=1 }^{N/b}R_{i}^{2}+\sum_{i=N/b+1}^{N}r_{i}^{2}).$ $$

## Appendix C Implementation details

For simplicity, we use $\overline{\nabla}_{\mathbf{H}^{(l)}_{PSQ}}$ and $\overline{\nabla}_{\mathbf{H}^{(l)}_{PCQ}}$ to denote the low-bit versions quantized from ${\mathbf{M}}_{PSQ}\hat{\nabla}_{\mathbf{H}^{(l)}}$ and $\hat{\nabla}_{\mathbf{H}^{(l)}}{\mathbf{M}}_{PCQ}$. Extend this decomposition operation to the entire gradient tensor:

$$ $\displaystyle\left\{\begin{array}[]{l}\hat{\nabla}_{\mathbf{H}^{(l-1)}}=\sum_{ i=1}^{b}2^{(i-1)}(\mathbf{S}_{PSQ}(\overline{\nabla}_{\mathbf{H}^{(l)}_{PSQ}}) ^{i}\operatorname{sign}({\boldsymbol{\Theta}}^{(l)^{\top}})),\\ \hat{\nabla}_{\boldsymbol{\Theta}^{(l)}}=\sum_{i=1}^{b}2^{(i-1)}(\operatorname {sign}({\mathbf{H}}^{(l-1)^{\top}})(\overline{\nabla}_{\mathbf{H}^{(l)}_{PCQ}} )^{i}\mathbf{S}_{PCQ}),\end{array}\right.$ $$

where both $(\overline{\nabla}_{\mathbf{H}^{(l)}_{PSQ}})^{i}$ and $(\overline{\nabla}_{\mathbf{H}^{(l)}_{PCQ}})^{i}$ represent the 1-bit tensors obtained after the decomposition. This transformation enables the implementation of most operations in backward propagation using XNOR and bit counting.

We implemented our method as a lightweight library in PyTorch. For binary matrix multiplication and some auxiliary operations, we implemented them using C++. In Alg. 1, we illustrate the process of forward and backward propagation for quantized fully connected layers. For simplicity, certain details, such as bias terms, quantization zero points, and the decomposition operations on gradient tensors, are omitted here. The entire process primarily consists of five components: quantization (9), encoding(4-5, 10), low-bit multiplication (6, 11), pruning (8), and dequantization (12).

Figure: Algorithm 1 Linear Layer Forward and Backward Propagation

Encoder is a functional component that encodes multiple integers with values of 1 or -1 into a smaller set of elements, facilitating subsequent XNOR operations. Taking Row_Encoder as an example, its primary form is illustrated in Alg. 2, the case where the number of columns is not divisible by $b$ has been overlooked.

Figure: Algorithm 2 Row_Encoder

Binary multiplication is the crucial operation. In our approach, both forward and backward propagation are implemented through binary multiplication. For example,
For two vectors, $\mathbf{X}_{1}$
and $\mathbf{X}_{2}$, each of length 32, encode them into two unsigned 32-bit integers, $x_{1}$ and $x_{2}$. The multiplication of the two is implemented as follows:

$$ $\operatorname{SUM}(\mathbf{X}_{1}\odot\mathbf{X}_{2})=\operatorname{bitcount}( \operatorname{XNOR}(x1,x2))<<1-32$ $$

where the dot product of two vectors, each of length 32, is efficiently replaced by a single bitcount and XNOR operation, effectively reducing energy consumption and time overhead.
However, it is worth noting that an unbiased quantizer maps data to 0 or 1, rather than -1 or 1. Therefore, some conversion is required. For $\mathbf{X}_{1}\in{\{1,-1\}}^{n}$, $\mathbf{X}_{2}=\operatorname{ReLU}(\mathbf{X}_{1})$, it is clear that $(S/2)\mathbf{X}_{1}+Z+(S/2)=S\mathbf{X}_{2}+Z$. Therefore, some adjustments are needed: a straightforward modification of the scaling factor $S$ and zero point $Z$ is sufficient to achieve the transformation. This transformation requires only one multiplication and one addition for the scaling factor and zero point, thus incurring minimal overhead.

For convolutional layers, direct matrix multiplication is not feasible. To facilitate subsequent operations, an unfolder is performed on the convolutional layer before matrix multiplication. After computation, the standard form is restored through folder operations. For example, We perform a convolution operation between the input $\mathbf{X}\in\mathbb{R}^{N\times C\times H\times W}$and parameters ${\boldsymbol{\Theta}}\in\mathbb{R}^{D\times C\times K\times K}$ to obtain the output $\mathbf{Y}\in\mathbb{R}^{N\times D\times H\times W}$.

1-bit Matrix Multiplication vs. Average 1-bit Matrix Multiplication. Given that our method is not a true 1-bit FQT but rather an average 1-bit FQT, we analyze the computational differences between the two approaches. In the case of b=4, the "average 1-bit matrix multiplication" first prunes a matrix to one-fourth of its original size. The remaining elements in this pruned matrix have a bit-width of 4 bits, ensuring an average bit-width of 1 bit. Subsequently, this pruned matrix is multiplied with another true 1-bit matrix. The computation process is as follows: based on the lossless decomposition described in the paper, the 4-bit matrix is decomposed into four equally sized 1-bit matrices. Subsequently, each of these four matrices undergoes true 1-bit matrix multiplication with the genuine 1-bit matrix. Finally, the four resulting matrices are merged together (Fig. 7). The operations involved in 1-bit matrix multiplication of the four submatrices are equivalent to those used in true 1-bit matrix multiplication, so no further analysis is required. For the decomposition operation, it can be accomplished through bitwise AND and shift operations. As for the final merging operation, it can be achieved using shift operations and integer addition. Moreover, the number of computations involved in both operations is at the level of the matrix size. In summary, while average 1-bit matrix multiplication requires additional decomposition and merging operations compared to true 1-bit matrix multiplication, these operations can be achieved using bitwise AND, shift, and integer addition operations. The overhead associated with these operations is relatively low.

Unfolder treats each element involved in element-wise multiplication within the kernel as a row, and the number of times the window slides as columns, the unfolded input and parameters transform into $\mathbf{X}_{u}\in\mathbb{R}^{NHW\times CK^{2}}$, ${\boldsymbol{\Theta}}_{u}\in\mathbb{R}^{D\times CK^{2}}$. Finally, we need to restore the output $\mathbf{Y}_{u}\in\mathbb{R}^{NHW\times D}$ to its standard state.

Folder is the inverse operation of Unfolder, designed to restore the gradients of both the input and parameters $\nabla_{\mathbf{X}_{u}}\in\mathbb{R}^{NHW\times CK^{2}}$, $\nabla_{\boldsymbol{\Theta}_{u}}\in\mathbb{R}^{D\times CK^{2}}$ to their standard states.

Figure: Figure 7: The calculation process of average 1-bit matrix multiplication and 1-bit matrix multiplication.
Refer to caption: x9.png

## Appendix D Experimental Details

### D.1 Gradient distribution

From Fig. 8, it can be observed that the gradient of the activation exhibits a pattern across different epochs: the ranges of groups (both samples and dimensions) are highly uneven. Some groups have large ranges, while others have small ranges. Although we have presented results for a single batch, the same pattern persists across the remaining batches.

Figure: (a) 0
Refer to caption: x10.png

### D.2 Experimental settings

Classification task: The training process is divided into two stages: initially undergoing quantization-aware training on ImageNet and subsequently undergoing FQT on various downstream datasets. The first stage: the initial learning rate was set to $10^{-3}$ and the weight decay to $10^{-5}$, following Bulat and Tzimiropoulos (), the optimizer is Adam and use a consine learning rate schedule. We train for 90 epochs. The second stage: for all datasets, the initial learning rate for fully connected layers is set to $10^{-3}$. For portions of the network that have been previously trained, the learning rate is set to $10^{-5}$, except for car dataset Krause et al. () where it is set to $10^{-4}$. The optimizer settings are the same as the first stage. We train for 60 epochs. The batch size was assigned to be 128. We measured training latency on CPUs, but to expedite the acquisition of accuracy statistics, we simulated the training results on 4 NVIDIA RTX A4000 GPUs. Due to limited resources on terminal devices, we utilized a smaller batch size of 64. We followed the configuration of Bulat and Tzimiropoulos () by excluding quantization for sensitive layers, such as the first and last layers, as well as skip connections in residual networks, in addition to batch normalization (BN) and ReLU layers.

Detection task: We evaluate our method on a simple transfer learning task to assess its effectiveness on object detection models, specifically transferring from high-resolution object detection to low-resolution object detection. The training process is divided into two stages: initially undergoing quantization-aware training on the PASCAL VOC 2007 and VOC 2012 trainval sets with a resolution of (600*600) pixels, followed by FQT training on the same dataset with a resolution of (300*300) pixels. The first stage: We followed all the settings of BiDet Wang et al. (), including the quantization methods for both weights and activation values and training configurations. The batch size was assigned to be 32, and the Adam optimizer was applied. The learning rate started from $10^{-3}$ and dropped during training every 6 epochs by a factor of 10. We train for 20 epochs. The second stage: the initial learning rate is $10^{-5}$, the training epoch is 5 and the others are the same.

NLP tasks: We conduct experiments to validate the effectiveness of our proposed 1-bit FQT on $\text{BERT}_{\text{BASE}}$(12 hidden layers) and the GLUE benchmark Wang et al. () which consists of nine basic language tasks. We use the standard metrics for each GLUE task to evaluate our method. We use Spearman Correlation for STS-B, Mathews Correlation Coefficient for CoLA and classification accuracy for the rest tasks. As for MNLI task, we report the accuracy on both in-domain evaluation MNLI-match (MNLI-m) and cross-domain evaluation MNLI-mismatch (MNLI-mm). We exclude WNLI task as Qin et al. (). We utilized BiBERTQin et al. () as our binarized model, which is derived by directly binarizing a full-precision one. Subsequently, we fine-tune this binarized model using both full-precision gradients (QAT) and 1-bit gradients (Ours). We follow Qin et al. () by excluding quantization for classifier, position embedding layer, and token type embedding layer. We use the Adam as our optimizer. The training settings are also the same as Qin et al. ().

**Table 5: Experimental results on multiple downstream datasets. “(W, A, G)" denote the bitwidth of weight, activations, and gradients, respectively.**
| Method | Precision | Accuracy(%) |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| (W, A, G) | CIFAR-10 | CIFAR-100 | Flowers | Cars | Pets | CUB | Average |  |
| Fine-tuning-Ours | 1, 1, 1 | 78.03 | 57.47 | 79.71 | 38.27 | 71.19 | 39.64 | 60.72 |
| Training-from-scratch-Ours | 1, 1, 1 | 42.57 | 26.96 | 5.88 | 1.06 | 5.12 | 1.64 | 13.87 |
| Training-from-scratch-PSQ | 1, 1, 1 | 24.27 | 6.14 | 2.94 | 1.04 | 4.41 | 1.04 | 6.64 |

Figure: Figure 9: Gradient range analysis in ResNet18’s conv2.1.2 layer under fine-tuning (FT) and training from scratch (TFS). (left) The result from CIFAR-10. (right) The result from CIFAR-100.
Refer to caption: x20.png

### D.3 FQT from scratch

We compared the performance of our method in two scenarios: fine-tuning and training from scratch. We presented the classification results under the optimal configuration (b=4) in Table 5. From the table, it is evident that when training from scratch, the model exhibits very low classification accuracy across all datasets, and in certain datasets, it even lacks classification capability entirely. We attempted to analyze the differences between the two scenarios based on the distinct gradient distributions. From Fig. 9, we observe that the gradient range is larger in training from scratch, leading to increased gradient variance (Eq. 4) and reduced model convergence. Therefore, 1-bit FQT from scratch remains an open problem. Additionally, we also compared our method with PSQ in the scenario of training from scratch, and the results indicate that our approach still significantly outperforms PSQ in accuracy.

Figure: Figure 10: (a) The speedup of ours compared with FP32 PyTorch. (b) The compositional structure of time consumption.
Refer to caption: x22.png

### D.4 Time expenditure structure

We present the speedup across layers of VGGNet16 and the
time consumption for each operation in Fig. 10, providing guidance
for future optimization directions. It is important to note that the first and last layers were not quantized and, therefore, were not included in the analysis. From the figure, it is evident that matrix multiplication constitutes the majority of the training time, while the time overhead of other operations such as gradient pruning and quantization can be considered negligible. Therefore, the focus of future optimization efforts will remain on matrix multiplication. Furthermore, it can be observed that our implemented method is particularly friendly for layers with a large number of convolutional kernels and smaller input resolution.

## NeurIPS Paper Checklist

- 1.
Claims
- Question: Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
- Answer: [Yes]
- Justification: In Sec. 1, we state our contributions along with the scope and limitations of our method.
- Guidelines:
•
The answer NA means that the abstract and introduction do not include the claims made in the paper.
•
The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.
•
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
•
It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.
- 2.
Limitations
- Question: Does the paper discuss the limitations of the work performed by the authors?
- Answer: [Yes]
- Justification: In Sec. 1 and 7, we discuss the limitations of this study.
- Guidelines:
•
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
•
The authors are encouraged to create a separate "Limitations" section in their paper.
•
The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
•
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
•
The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
•
The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
•
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
•
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren’t acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
- 3.
Theory Assumptions and Proofs
- Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
- Answer: [Yes]
- Justification: In Sec. 4, theoretical results, including assumptions, are presented, with proofs provided in Appendix A.
- Guidelines:
•
The answer NA means that the paper does not include theoretical results.
•
All the theorems, formulas, and proofs in the paper should be numbered and cross-referenced.
•
All assumptions should be clearly stated or referenced in the statement of any theorems.
•
The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.
•
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
•
Theorems and Lemmas that the proof relies upon should be properly referenced.
- 4.
Experimental Result Reproducibility
- Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
- Answer: [Yes]
- Justification: In the supplementary materials, we offer the code to accomplish this.
- Guidelines:
•
The answer NA means that the paper does not include experiments.
•
If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
•
If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
•
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
•
While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a)
If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.
(b)
If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.
(c)
If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
(d)
We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.
- 5.
Open access to data and code
- Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?
- Answer: [Yes]
- Justification: In the supplementary materials, we offer the code.
- Guidelines:
•
The answer NA means that paper does not include experiments requiring code.
•
Please see the NeurIPS code and data submission guidelines ([https://nips.cc/public/guides/CodeSubmissionPolicy](https://nips.cc/public/guides/CodeSubmissionPolicy)) for more details.
•
While we encourage the release of code and data, we understand that this might not be possible, so “No” is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).
•
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ([https://nips.cc/public/guides/CodeSubmissionPolicy](https://nips.cc/public/guides/CodeSubmissionPolicy)) for more details.
•
The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
•
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.
•
At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
•
Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.
- 6.
Experimental Setting/Details
- Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
- Answer: [Yes]
- Justification: In Sec. 6, we outline the core experimental setup, with the complete setup detailed in Appendix D.
- Guidelines:
•
The answer NA means that the paper does not include experiments.
•
The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.
•
The full details can be provided either with the code, in appendix, or as supplemental material.
- 7.
Experiment Statistical Significance
- Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
- Answer: [Yes]
- Justification: We report the mean and stddev of 3 runs for main results (visual classification task).
- Guidelines:
•
The answer NA means that the paper does not include experiments.
•
The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.
•
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
•
The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
•
The assumptions made should be given (e.g., Normally distributed errors).
•
It should be clear whether the error bar is the standard deviation or the standard error of the mean.
•
It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.
•
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).
•
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
- 8.
Experiments Compute Resources
- Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
- Answer: [Yes]
- Justification: We describe the type and model of compute workers in Sec. 6 and report the time of execution.
- Guidelines:
•
The answer NA means that the paper does not include experiments.
•
The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
•
The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
•
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn’t make it into the paper).
- 9.
Code Of Ethics
- Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics [https://neurips.cc/public/EthicsGuidelines](https://neurips.cc/public/EthicsGuidelines)?
- Answer: [Yes]
- Justification: I confirm that the paper complies with ethical guidelines in every aspect.
- Guidelines:
•
The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
•
If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.
•
The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).
- 10.
Broader Impacts
- Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
- Answer: [Yes]
- Justification: In the discussion following the conclusion, we explored the potential positive impacts of our method; since our approach aims to accelerate network training, no significant negative effects were observed.
- Guidelines:
•
The answer NA means that there is no societal impact of the work performed.
•
If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.
•
Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
•
The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
•
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
•
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).
- 11.
Safeguards
- Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
- Answer: [N/A]
- Justification: Since this paper focuses on accelerating network training, it does not present these risks.
- Guidelines:
•
The answer NA means that the paper poses no such risks.
•
Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
•
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
•
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.
- 12.
Licenses for existing assets
- Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
- Answer: [Yes]
- Justification: The assets used in this paper are credited and the license is respected.
- Guidelines:
•
The answer NA means that the paper does not use existing assets.
•
The authors should cite the original paper that produced the code package or dataset.
•
The authors should state which version of the asset is used and, if possible, include a URL.
•
The name of the license (e.g., CC-BY 4.0) should be included for each asset.
•
For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
•
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, [paperswithcode.com/datasets](paperswithcode.com/datasets) has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.
•
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.
•
If this information is not available online, the authors are encouraged to reach out to the asset’s creators.
- 13.
New Assets
- Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
- Answer: [Yes]
- Justification: New assets introduced in the paper are well documented.
- Guidelines:
•
The answer NA means that the paper does not release new assets.
•
Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
•
The paper should discuss whether and how consent was obtained from people whose asset is used.
•
At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
- 14.
Crowdsourcing and Research with Human Subjects
- Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?
- Answer: [N/A]
- Justification: The paper does not involve crowdsourcing or research with human subjects.
- Guidelines:
•
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
•
Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.
•
According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
- 15.
Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
- Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
- Answer: [N/A]
- Justification: The paper does not involve crowdsourcing nor research with human subject.
- Guidelines:
•
The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
•
Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
•
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
•
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

## Peer Reviews

confidence: 5
contribution: 2
initial_rating: 3
presentation: 3
questions: (1) Can this method be applied to larger models like transformers, or maintain convergence in training-from-scratch scenarios on various models? If not, where do you see the main challenges?

(2) Is the SCQ method scalable on resource-constrained hardware? For deployment of low-power devices, would the implementation complexity lead to additional computational overhead?

(3) What's the batch-size of the FQT on edge devices?
soundness: 3
strengths: (1) This paper presents a challenging 1-bit quantization method in the field of FQT, offering valuable insights for future low-bit quantization research through a theoretical analysis of gradient variance. 

(2) The proposed approach has been comprehensively evaluated across multiple datasets and models (such as CIFAR-10, CIFAR-100, VGGNet-16, and ResNet-18), effectively demonstrating its validity and generalizability. 

(3) The paper is well-structured, with detailed descriptions of the methodology and theoretical foundations, and the experimental results clearly showcase the potential of 1-bit FQT.
summary: This paper explores the limit of fully quantized training (FQT) by proposing a 1-bit quantization scheme for weights, activations, and gradients. 

1) The authors introduce an Average 1-bit Quantization (AQ) strategy to reduce gradient variance by pruning less informative gradients. 

2) Additionally, they propose Sample Channel joint Quantization (SCQ) to optimize quantization for weight and activation gradients, ensuring compatibility with low-bit hardware. 

Experimental results show that the proposed method achieves significant training speedup on VGGNet-16 and ResNet-18 across multiple datasets while maintaining minimal accuracy loss.
weaknesses: (1) The paper mainly compares traditional full-precision training and the existing PSQ method, lacking direct comparisons with recent low-bit quantization techniques (e.g., 2-bit or 4-bit methods), which limits the generality of its conclusions.

(2) The method’s application mainly focuses on transfer learning for edge devices. Results of training from scratch or for larger models like ResNet-50 etc are weak or missing.

(3) The SCQ method relies on per-channel and per-sample adjustments, which may increase hardware implementation complexity, especially for resource-limited devices. There is a lack of discussion on compatibility and scalability across different hardware.

(4) The proposed method first needs to conduct QAT on ImageNet and then undergoes FQT on downstream datasets for large number of epochs, which constrains the application of the proposed method.

---

confidence: 5
contribution: 2
initial_rating: 6
presentation: 4
questions: * Fig. 1 what is the quantization scheme for the gradient?
* Tables 2 & 3 are very small and hard to read. Can you please expand them a bit?
* It would be interesting to see a comparison of their method to the Per-Sample Quantizer combined with the Block Householder Quantizer for activation gradients. 
* A profiling of the training process on either of the edge devices, focusing on the compute time spent on the high-precision operations, e.g. Batch-Norm gradient estimation, and the memory bandwidth of activation gradients.
* Using the symbol of a Hessian $\mathbf{H}$ to denote activations in section 3 is a bit confusing (but this is just a remark)
* The equations in section 3.1 have no numbering. I believe that a quantization function must be applied in line 149 for the equations to hold. The product of two quantize tenses:  $\hat{\nabla}_{\mathbf{H}^{(l)}} \bar{\mathbf{\Theta}}^{(l)^T}$  will not any more be in the same precision as the two inputs. Shouldn't it be instead

 $$Q_g(\hat{\nabla}_{\mathbf{H}^{(l)}} \bar{\mathbf{\Theta}}^{(l)^T})$$
soundness: 3
strengths: A very decent effort by the authors to provide a framework for 1-bit FTQ. To my knowledge, they are the first to undertake that daunting task. Even if the results are disappointing in terms of accuracy, it can be the basis of future work that will further close the gap. I summarise their strengths:

* The first to tackle the difficult task of 1-bit FTQ, even if their contributions are limited IMO.
* Solid presentation and easy-to-read paper.
* A theoretical motivation for their suggested methods and of the optimizers.
* Extensive experimentation covering many tasks, including image classification, object detection and NLP
* A very detailed appendix including ablations studies and implementation details for reproducibility. I specifically like that they consider the generalizability of their approach by applying it to more advanced binary models and showing an improvement even at higher bits.
summary: The paper introduces the first attempt at achieving 1-bit fully quantized training (FQT), aka quantizing weights, activation and gradients at 1-bit. 

They first provided a theoretical analysis demonstrating that under the assumption of a bounded gradient, the convergence rate for a convex loss is influenced by the variance of the gradient. This informs their hypothesis that the Adam optimizer is better suited for FTQ compared to SGF. 

They also show that the quantized gradient variance increases quadratically as the bitwidth decreases, suggesting the variance of 1-bit per-sample gradient quantization is too large for training. To address this,  they propose the average 1-bit per-group quantization that randomly prunes samples proportionally to their dynamic range.  They also propose a similar scheme for weight gradient, called Sample Channel Joint Quantization, that applies the same idea to groups of channels.

They perform various fine-tuning experiments and consistently show they outperform vanilla per-sample quantization and are within an average 5.5% drop for ResNet18 and 5% for VVGNet-16 on a collection of downstream tasks. They also make the first attempt at FTQ from scratch on CIFAR-10/100 and ImageNet, but the results there are way below the QAT. They also test their implementation on Hygon and Raspberry Pi, showing consistent training speedups.
weaknesses: Whereas the paper is very well presented and tackles a novel and difficult however, its contribution is quite limited as it mainly builds on theory and methods already developed. Chen 2020 first introduces the relationship between quantized gradient and gradient range found in section 4.2. They motivate their per-sample quantization (PSQ) based on this and introduce the Block Householder Quantizer (BHQ). The authors compare their method to PSQ in their experiments but not to BHQ, which follows the same idea as their average 1-bit quantization. 

I also find their conclusion about the convergence properties problematic because there is little evidence to suggest that the loss function of neural networks is convex. In addition, they compare vanilla SGD to Adam without considering momentum SGD first.  Adam does indeed have great properties for training networks, but it’s hardly surprising that SGD without momentum fails in the high variance regime of low-bit quantization. This is why momentum is introduced to act as a low-pass filter. 

The authors introduce their FTQ method mainly for on-device fine-tuning. However, they do not discuss certain limitations regarding data movement and memory restrictions on edge devices. According to the appendix, they use large batches of size 64 for on-device fine-tuning (which may not be realistic for real edge applications). In addition, the dequantization operation in the step of algorithm 1 would require storing the large high-precision tensors (assuming this is float32) in memory to first calculate the dynamic ranges and perform the pruning/quantization later.  At such low precision, the training would most likely become memory-bound. It would be useful to see a profiling of training on the device to better understand the impact of the high-precision operations

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: - One of the initial assumption that Adam is better in low precision regime is based on the sensitivity analysis in Figure 1. However, since it is the foundational assumption of the paper (L235, L221) and I would recommend to add results for more complex datasets as CiFAR10 is too simple and other datasets may change this assumption (mid size like Flowers/Pascal VOC and large size like Image-net/coco). Although this is also proved mathematically (L221) under certain assumptions (4.1 to 4.4), it would be good to verify these on other datasets
- L270: Average 1-bit Quantization (AQ) - Is it similar to mixed precision quantization where some of the groups are quantized with higher precision (2, 4 bits etc)? If yes, what is there any information of percentage of 1-bit, other bits and %age of pruned channels for any dataset/model available ?
- Table 1, L385, L386 : what is the percentage of “remaining groups” using b bandwidth?
- L385, L386 : intuitively the accuracy of models where “remaining groups” use 8 bit should have more accuracy but Table 1 suggests otherwise. This is mentioned in L409 but adding intuition behind this would be helpful (confirmed in L426)
- Effect of optimizer (L462) - The experiment may need to be expanded for other complex datasets (apart from CIFAR10)

The rating is primary reflection of above questions and general applicability of this approach for practical use cases. I would consider to change my rating based on the answer to above questions as as well as few points mentioned in weakness section.
soundness: 3
strengths: - One of the first work to show end to end training using 1 bit which includes gradients and showed results on models like ResNet18 and VGG-16
- Mathematical foundation of the approach is solid and reasonable (with few assumptions which may not hold true always)
- Finetuning using 1 bit FQT shows promising results compared to similar QAT methods
- 1 bit FTQ practical benefits is shows by using X-NOR 1 bit operations to save memory as well as computation.
summary: First method to propose FQT where weight, activation and gradients are computed using 1 bit. The models have (average) 5% lower accuracy on classification datasets compared to 1 bit FQT using full precision gradients and less than 1% in simple datasets like Flowers and Pets dataset with an average speedup of 5.13x (training speedup) compared to FP32. The approach is explained with solid mathematical foundation and results are shown for both classification as detection models (thought only for fine-tuning in some cases). The 1 bit FTQ has a huge potential use case in memory restricted devices as the memory saving can be 32x (theoretically).
weaknesses: - Memory saving analysis using 1 bit FTQ would add a lot of value to this method. Practically this method can be used to fine tune models running to tiny devices with very small memory and latency is not a prime concern for those devices.
- The technique should be tested on deeper model to see the impact of vanishing gradient problem. This issue may be more prominent when gradient is calculated in lower precision.
- Although L083 mentions that primary aim of this paper is to explore the ultimate limit of quantization instead of focussing on practical application performance, the usefulness of this method for practical use case can strengthen the paper.
- The training speedup of 5.13x is compared with FP32 training, the Author(s) are advised to also provide speedup as well as accuracy numbers compared to full INT8 to see the extent of benefits of 1 bit FQT for real use cases.
- The approach is tested on very old models like ResNet18 and VGG16, more results on other challenging but faster models will be interesting to see (eg. Mobilenet)
- 1 bit FQT is only applicable to transfer learning and puts a big question on applicability of this approach.

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: 1) Do you try to run the proposed method on modern LLMs - opensource githubs like nanoGPT is a good baseline.
2) Is the speedup presented in Fig8 and table include all the preprocessing require in AQ when b > 1  - or it include only the matrix multiplication (which is unfair comparison)?   Can you also add comparison with BF16 which is usually ~2X and full time to train comparison.


======================================================

Dear Authors,

Thank you for your efforts in addressing the questions and concerns raised.
I decided to raise my score to 5 - still under the acceptance threshold.
I feel that the experiments still require more effort- mainly in larger dataset and more modern models.
soundness: 2
strengths: The paper introduce an interesting analysis of the difference between SGD and Adam optimizer under binary quantization.
summary: The paper aims to accelerate training by applying binary quantization to the weights, activations, and gradients, making all three matrix multiplications binary and thus accelerating the process. This approach differs from standard Quantization-Aware Training (QAT), where typically only the weights and activations are quantized.

The paper also analyzes the variance introduced by gradient quantization when using both Adam and SGD optimizers. Based on this analysis, it proposes two methods for binary quantization:
1. Activation gradient pruning, which removes less informative gradient groups to improve numerical precision in the remaining groups.
2. Sample-channel joint quantization, which applies different quantization strategies to the gradients of weights and activations.
weaknesses: I see several weaknesses in the paper, with the primary one being the experiments section, which I find very underdeveloped. Presenting results solely on small datasets like CIFAR, especially in the current era of LLMs, is not sufficient for a conference like ICLR. Additionally, the networks used, such as VGG and ResNet18, are quite outdated.

Even with these small datasets and older networks, the paper shows a significant performance gap compared to the baseline models, raising doubts about the approach's viability in real-world applications. The authors need to put more effort into this section to make the work more convincing.

Furthermore, the practical acceleration claims are also problematic. The approach requires non-trivial preprocessing of data for every General Matrix Multiply (GEMM) operation, making it challenging to support natively in hardware

Meta-review: This work proposes fully quantized training (FQT) of NNs using 1-bit precision, provides theoretical convergence analysis of SGD and Adam in this context, and proposes an Average 1-bit quantization strategy for stable training. 

The underlying problem undoubtedly is very important and highly challenging and I appreciate the efforts made my the authors. However, this work received mixed reviews (mostly negative) and the primary concerns were

- lack of proper comparison with recent low-bit quantization methods
- weak training from scratch results, evaluation is performed on simple task and small datasets
- limited contribution compared to Chen et al. 2020 (PSQ)
- evaluated only on simple tasks
- lack of other variants of SGD (e.g., momentum) to compare with Adam etc. 

I also agree with the concerns above and would like to strongly encourage the authors to incorporate them and submit a revised draft to another top venue as the problem they are working on is of high importance. Unfortunately, at this stage, the work is not polished enough to be published at ICLR.

Decision: Reject