OneBit: Towards Extremely Low-bit Large Language Models

Authors: yuzhuang  xu
xu  han
zonghan  yang
shuo  wang
qingfu  zhu
zhiyuan  liu
weidong  liu
wanxiang  che
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-14 04:43:26

Abstract: Model quantification uses low bit-width values to represent the weight matrices of existing models to be quantized, which is a promising approach to reduce both storage and computational overheads of deploying highly anticipated LLMs. However, current quantization methods suffer severe performance degradation when the bit-width is extremely reduced, and thus focus on utilizing 4-bit or 8-bit values to quantize models. This paper boldly quantizes the weight matrices of LLMs to 1-bit, paving the way for the extremely low bit-width deployment of LLMs. For this target, we introduce a 1-bit model compressing framework named OneBit, including a novel 1-bit parameter representation method to better quantize LLMs as well as an effective parameter initialization method based on matrix decomposition to improve the convergence speed of the quantization framework. Sufficient experimental results indicate that OneBit achieves good performance (at least 81% of the non-quantized performance on LLaMA models) with robust training processes when only using 1-bit weight matrices.

Main paper: 
 introduction: 
 Transformer [36] has emerged as the pivotal architecture in large language models (LLMs), fundamentally reshaping the approach to natural language processing in deep learning era [6, 34, 4] . Despite their popularity, deploying transformer-based LLMs presents significant challenges due to their computational intensity and considerable memory requirements as the parameters of LLMs become more and more. For instance, even moderately-sized LLMs like LLaMA-13B [34] require around 26GB of memory to load its all parameters in FP16 format. Such overheads make deploying LLMs difficult beyond mid-to-high-end GPUs like the A100, let alone on mobile devices. The high demand for resources not only drives up usage costs, but also restricts their wider application.Numerous efforts [10, 14, 13] have been devoted to reducing the computational and memory overheads of LLMs, while still preserving most of their original model capabilities. Among these efforts, quantization has gained widespread attention, particularly Post-Training Quantization (PTQ), benefitted from its lower transferring costs. Seminal studies such as GPTQ [14] , SpQR [12] , and AWQ [20] successfully compress the weight matrices of LLMs to 4-bit values while maintaining the main abilities of LLMs. Efficient quantization represents significant advances in LLM optimization, by achieving a balance between time and space efficiency as well as model performance.Unfortunately, the efficacy of PTQ rapidly diminishes when the quantization bit-width is extremely low, as shown in Figure 1 . Existing PTQ methods managed to compress weight matrices down to at least 3-bit [9] . Recent researches hope to leverage Quantization-Aware Training (QAT) to The perplexity (lower scores mean better performance) of existing widely-used lowbit quantization methods on LLaMA-7B, reported on Wikitext2 [23] . All the examined previous approaches suffer from significant performance degradation when quantizing models to 2-bit values. Our 1-bit quantization method can outperform these 2-bit baselines.overcome the bottlenecks faced by PTQ. LLM-QAT [21] introduces a few learnable parameters into the quantization process, achieving notable results. OmniQuant [30] , integrating learnable equivalent transformation, presents promising results in 2-bit quantization. However, existing methods decline when compressing model weights to 1 bit, struggling to maintain effectiveness. This mainly stems from the drastic precision loss at extremely low bit-width representation in weight matrix W, significantly increasing loss in linear projection WX, which is the core operator within LLMs.In this paper, we propose a novel Linear layer and Sign-Value-Independent Decomposition (SVID) for weight matrices to represent LLMs using approximately 1-bit values. In our novel layer architecture, each original high-bit weight matrix is represented as one sign matrix (±1) and two value vectors. The value vectors provide necessary floating-point precision in linear projection at little cost and help the model to be trained easily. The sign matrix maintains the high rank of the original weight matrix with a small space cost, thereby preserving high information capacity. SVID offers a better parameter initialization for 1-bit models from the non-quantized model and we employ quantization-aware knowledge distillation to transfer the capabilities of the original model to the proposed 1-bit counterpart. Experiments demonstrate that our method performs well at the W1A16 (1-bit weight and 16-bit activation) quantization level. Furthermore, our 1-bit model is more amenable to training and knowledge transfer than previous works. In summary, our contributions are 3-fold:• We propose a novel and efficient 1-bit model architecture for LLMs, which can improve both the time and space efficiency during model inference. Moreover, our architecture is more stable during quantizing LLMs.• We propose SVID to decompose high-bit matrices into low-bit ones, which is essential for the initialization of our 1-bit architecture. Experiments demonstrate that the SVID-based initialization can improve the model performance and convergence speed.• Extensive experiments demonstrate that our method works well in model sizes from 1.3B to 13B in OPT, LLaMA, and LLaMA2, showcasing its generalizability.2 Related Work 
large language model compression: 
 Quantization, pruning, and knowledge distillation (KD) are the mainstream methods for model compression. Quantization compresses model weights into low-bit values [14, 20, 11] . For data type alignment in computation and reducing memory, it also involves quantizing activation [10, 39] and key-value cache [30] . Pruning simplifies model complexity by removing unimportant weights or modules, thereby sparsifying the original larger models [13, 31, 22] . KD trains a smaller student model under the guidance of a larger teacher model [16, 1, 16] , achieving the purpose of compressing the larger one. Beyond these methods, low-rank factorization approximates the original weight matrix W with the product of two lower-rank matrices [40] and also achieves promising results. Our work belongs to quantization, using KD for knowledge transfer from the original LLM and uniquely focusing on extremely low bit-width quantization. More details about model compression can refer to existing survies [37, 43] .Since this paper aims to obtain extremely low-bit LLMs, here we thus introduce more details about LLM quantization. Quantization stands as a popular and crucial method for model compression, capable of achieving a significant compression ratio with a relatively small loss. It can be classified into Post-Training Quantization (PTQ) and Quantization-Aware Training (QAT) according to when quantization is applied.PTQ directly converts trained models into lower-bit counterparts using accurate solvers and limited calibration data without additional training. Typically, GPTQ [14] row-wisely quantizes weight matrices and adjusts remaining weights to compensate for the precision loss caused by quantization, achieving nearly lossless 4-bit weight quantization. Moreover, numerous studies observed the effect of "outliers" in quantization [10, 18, 20] . LLM.int8() [10] suggests mixed-precision decomposition to ensure the accuracy of a few outliers in activations. SmoothQuant [39] reduces the difficulty of quantization by smoothing the outliers of activation. SpQR [12] identifies sensitive weights to ensure their precision, while quantizing other weights to lower bit-width.QAT integrates quantization steps within the model, applying them during training or fine-tuning. It allows the model to better adapt to the reduced precision induced by quantization, leading to improved performance compared to PTQ. LLM-QAT [21] introduces a small number of learnable parameters into quantization and employs KD using data generated by the original model itself. OmniQuant (30; we classify it as QAT) further introduces learnable equivalent transformation, achieving acceptable results in 2-bit weight quantization. Contemporary work QuIP# [35] combines randomized Hadamard transform, vector quantization techniques, and fine-tuning to achieve better performance in 2-bit level. PEQA [17] and QLoRA [11] focus on fine-tuning a limited number of extra parameters to mitigate the precision loss caused by sub-4bit weight quantization. Our work is closely related to QAT, but due to the unique challenges posed by 1-bit quantization, our representation and initialization methods of quantized weights are distinct from any existing work. 
methodology: 
 This section demonstrates our 1-bit architecture of the Linear layer to be quantized and discuss how to initialize the quantized model to achieve better performance in knowledge distillation. We start with a short review of classical weight quantization methods in Section 3.1 and then formulate our OneBit from Section 3.2 to Section 3.4 in detail.The main idea of model quantization is to compress each weight matrix W within models in FP32 or FP16 format to a low-bit counterpart. Specifically, we often quantize the weight matrices of Linear layers in transformer to 8, 4, and even 2 bits.The majority of quantization studies primarily employ the round-to-nearest (RTN) method, by which the weight w is rounded to the nearest value in the quantization grid. It can be formulated asEQUATIONwhere s denotes the quantization scale parameter, z denotes the zero point parameter, and N is the quantization bit-width. Clip(•) truncates the result in the range of 0 to 2 N -1. With the bit-width being lower and lower, the quantization grid also becomes sparser. When we quantize a LLM to 1-bit values, there are only 2 available numbers to be chosen in the quantized model. Existing study [9] points out that quantization based on the RTN method may get their best performance at the 4-bit level. Further quantizing to 2-bit values following this paradigm would result in a substantial degradation [30] as shown in Figure 1 .Furthermore, when N equals 1, quantization based on RTN method is essentially equivalent to setting a threshold, with weight w on either side of it being converted to corresponding integer value ŵ. In such a scenario, the parameters s and z in Eq. ( 1) effectively lose their practical significance. Consequently, when quantizing weights to 1 bit, the element-wise RTN operation drastically undermines the precision of the weight matrix W, leading to poor performance of the quantized model.Due to the severe precision loss of 1-bit weight quantization, converting weight matrices in Linear layers directly from FP32/16 to 1-bit format based on RTN is challenging. Wang et al. [38] explore this possibility by studying the capabilities of purely 1-bit weight matrices, training the 1-bit model from scratch. In the W1A16 setting, their Linear layers are designed asEQUATIONwhere W denotes the quantized weight matrix with the shape m × n and W ±1 denotes the 1-bit quantized matrix. X is the input of Linear layer and Y is the output. Sign(•), Mean(•) and Abs(•) functions return the sign matrix, average and absolute value matrix. Unfortunately, this approach reduces computational demands but also leads to a marked decrease in performance [38] . Moreover, due to training difficulties, experiments show that this method is challenging to use for quantizing existing models and can only be applied to training models from scratch.Inspired by Wang et al. [38] , we also quantize the weight matrix using the function Sign(•), and the element of the quantized matrix is set to +1 or -1 as well. Moreover, we also notice that although W ±1 maintains a high rank of W, the missed floating-point precision still destroys the model performance. Therefore, different from previous work, we introduce 2 value vectors with an FP16 format to compromise the precision loss in the quantization process. During training, our proposed Linear layers are designed asEQUATIONwhere g and h are the two FP16 value vectors. During inference, W ±1 is packed with an INT1 format, and Sign(•) will not be used, as shown in Figure 2 . Note that we specify the calculation order using brackets in Eq. (3) for minimizing the time and space cost. The main difference between Wang et al. [38] and OneBit is the extra parameter g and h. Even if additional parameters are brought in, the benefits far outweigh its small cost. For instance, when we quantize one weight matrix with the shape 4096 × 4096, the average bit-width of the quantized result is 1.0073. See A.7 for the details.In our proposed 1-bit architecture, the weight matrix W is mathematically divided into two components: one sign matrix W ±1 in INT1 format and two value vector g/h in FP16 format. To initialize the 1-bit model with the help of the fully trained weight, we introduce the Sign-Value-Independent Decomposition (SVID) of the weight matrix W, which can be formulated as W = W sign ⊙ W value . Here we have W value = |W| and W sign = Sign(W). For W value , we further approximately decompose it into the outer product of two vectors a and b, which is also known as rank-1 approximation. Hence, our proposed matrix decomposition method can be represented asEQUATIONWe can employ some widely used matrix decomposition methods to perform the rank-1 approximation, such as SVD [2] and NMF [25] .Proposition 1 Given the weight matrix W and input X, the Linear layer can be reformulated as the following according to SVID:EQUATIONWe prove this approximation in Appendix A.1. This bridges the gap between the architecture of the quantized model and its original weights. It indicates that if we assign W sign to W ±1 , a T to h and b T to g, the quantized model is an approximate initialization of the original model. Moreover, compared to restoring the original matrix W first (such as in Eq. ( 4)), the computational order in Eq. ( 5) saves approximately one matrix W in FP16 format in memory as there is no need to restore W in FP16 format.The main objective of SVID is to involve the sign matrix W sign in approximating matrix W, rather than solely relying on value vectors in FP16 format. To substantiate the role of the sign matrix W sign in matrix approximation, we present the following proposition.Proposition 2 Given matrices W and |W|, W = W sign ⊙ |W|. We decompose these matrices in the way W = ab T + E 1 and |W| = ãbT + E 2 , where E i denotes the error matrices. In terms of the Frobenius-norm, the SVID is closer to the original matrix W:EQUATIONWe also prove this proposition in Appendix A.1. It clearly demonstrates the practical role of the sign matrix W sign in matrix approximation.Note that, given the predominantly low precision of most parameters, it is quite challenging to approximate the weight matrix W accurately. SVID is not aimed to precisely replicate the original model's parameters, but to provide an effective starting point for further training, leveraging the extensive training of the original model. Details on transferring knowledge from the original model to the quantized counterpart are in Section 3.4.We employ quantization-aware knowledge distillation to transfer knowledge from the original model (i.e. teacher model) to the quantized one (i.e. student model). In the student model, the element in matrix W and vectors g/h in Eq. ( 3) will be trained. We use cross-entropy based logits and mean-square-error based hidden state of the full-precision teacher model to direct the quantized student model [32] . Language modeling loss is not used. The cross-entropy is defined asEQUATIONwhere c denotes the number of classes and n s denotes the number of training samples in the current batch. T and S are the teacher model and student model, respectively. The error of hidden states is defined asEQUATIONwhere n l denotes the number of layers and q denotes the hidden state. Hence the final objective function can be formulated asEQUATIONwhere α is the hyper-parameter that balances the importance of the cross-entropy loss and the features in the intermediate layers. Please refer to A.6 for further discussions of this part. 
experiments: 
 We experiment with 1-bit weight-only quantizaton and maintain 16-bit activation (W1A16) in this work. We evaluate our approach by performing experiments on OPT-1.3B/2.7B models, LLaMA-7B/13B models and LLaMA2-7B/13B models, and present results on various tasks.Data For the training data of our quantization-aware knowledge distillation, we follow Liu et al. [21] to synthesize corpus using next token generation from the original teacher model. It randomizes the first token from vocabulary and generates the next token iteratively until reaching either the <EOS> token or the maximum length. Specially, the top-1 predictions are selected deterministically for the first 3 to 5 tokens, followed by stochastic sampling for the remaining tokens. We utilized LLaMA-7B to generate a total of 132k data entries, each with a maximum length of 2,048.Training Details Every KD experiment learns the training data over 50 epochs, from which 2048token segments are selected. We employ NMF in scikit-learn1 to decompose the weight matrices in SVID. The quantized student models are optimized by Adam [19] with β 1 = 0.9, β 2 = 0.98. The learning rate for all experiments is scheduled by cosine strategy. We use NVIDIA A100 GPUs and maintain FP16 precision while training quantized models. For additional details such as learning rate, please refer to Table 1 . # GPUs OPT-1.3B 4e-4 1.0 1 × 8 OPT-2.7B 2e-4 1.0 1 × 8 LLaMA-7B 4e-4 1.0 1 × 8 LLaMA-13B 2e-4 1.0 2 × 8 LLaMA2-7B 1e-4 1.0 1 × 8 LLaMA2-13B 2e-4 1.0 2 × 8Baselines To our knowledge, there is no previous work exploring the 1-bit quantization of LLMs from a knowledge transfer perspective. To this end, we relax the quantization bit-width of baselines to 2 bits (W2A16) while maintaining the W1A16 setting in our method. We compare our method with GPTQ [14] , LLM-QAT [21] and OmniQuant [30] . To ensure a fair comparison in terms of space usage, baselines do not employ grouped quantization. Additionally, we included the results of vanilla transformers with FP16 precision as a reference. While the recent work BitNet [38] also introduced one 1-bit model architecture, it only worked for training models from scratch. We also analyze its capability to transfer knowledge from the original models in Appendix A.5.Evaluation Metrics Basically, we evaluate quantized models by testing the perplexity on the validation set, specifically on WikiText2 [23] and C4 [28] . Lower perplexity indicates that the compressed model is better at preserving the output distribution of the original model. Furthermore, accuracies of zero-shot tasks including Winograde [29] , HellaSwag [41] , PIQA [4] , BoolQ [7] , and ARC [8] are also reported. They evaluate if the capabilities of the original model on downstream tasks are retained. We utilize the open-sourced toolkit "LM-Evaluation-Harness"2 to perform the perplexity test and all zero-shot tasks. . This demonstrates that QAT-based method can achieve stable results in extremely low-bit quantization. Specifically, our method approaches the performance of FP16 more closely as the model size increases. For instance, when scaling from LLaMA-7B to LLaMA-13B, the perplexity (on C4) of the FP16 model decreases by only 0.47, whereas our method sees a reduction of 1.15.For perplexity, only our method achieves comparable results to the strongest FP16 baseline. For instance, our method achieves 9.18 in the Wiki2 dataset on LLaMA-13B model and the FP16 baseline is 5.09. The performance loss of other methods is significant, even though they use 2-bit quantization, which is more than our 1 bit. For GPTQ and LLM-QAT, the performance degradation after quantization is pretty severe. As for OmniQuant, even though it is the strongest baseline under the W2A16 setting, it still suffers greater performance loss compared to our W1A16 setting.For zero-shot accuracy, although all methods inevitably have some degradation, our method achieves the closest performance to the FP16 baseline among most models. On the OPT-1.3B/2.7B model, our method shows smaller performance loss on most tasks such as PIQA and ARC-e. Additionally, the loss of other tasks is negligible compared with the second-best baseline, OmniQuant. On the LLaMA-7B model, our method also notably outperforms OmniQuant in most tasks except BoolQ/ARC-e, averaging about a 4% improvement overall.We have demonstrated the superior performance of our method under the W1A16 setting, compared to other representative baselines. Although all methods inevitably face performance degradation in 1-bit weight quantization, it remains of interest how our method fares in solving practical problems among the various approaches to reducing model size. For instance, directly training smaller models [42] or employing low-rank decomposition to reduce the number of parameters.To this end, we consider two crucial abilities of LLMs: commonsense reasoning and world knowledge.For commonsense reasoning, we use the 6 tasks (Hellaswag, etc.) and settings described in Section 4.2.For world knowledge, we examine it using the Massive Multi-task Language Understanding (MMLU; 15), a benchmark that covers wide domains and knowledge. We compare the following 4 models:Pythia-1.0B [3]A well-trained model released by EleutherAI whose memory footprint is 1.54x that of our OneBit-7B model.A model with the same structure as the LLaMA models, which undergoes continued training. To compare fairly, we use the checkpoint at 10k training steps, which is 2x that of our OneBit-7B model.LowRank LLaMA [24] Decompose every weight matrix in Linear layers to two low-rank matrices and learn from the original LLaMA-7B model by KD in the same setting of OneBit-7B.The model that we use in Section 4.2, which is built with OneBit.Figure 3a and 3b demonstrate common sense reasoning ability and general world knowledge of different models. We can observe that, although other models have more parameters and are more thoroughly trained than ours, our model still has advantages in common sense reasoning. This reflects the benefits inherited from the larger 7B model. In terms of world knowledge, despite a significant loss in social sciences, our model outperforms the fully trained Pythia-1B in other domains. These results demonstrate the practical usability of OneBit. 5 Analysis and Discussion 
efficiency: 
 It is evident that extremely low-bit quantization of weights can significantly reduce the memory footprint of models. As shown in Table 3 , the actual compression ratio increases as the model size increases. This is particularly meaningful for larger models, making it possible to fit the model into one GPU. While there is a performance loss, Figure 4 illustrates that our method achieves a good trade-off between space occupancy and model performance. For example, we can achieve comparable performance to FP16 with only 0.2x the model space. Furthermore, quantizing to ±1 also aids in accelerating matrix multiplication on CPUs. It is because the floating-point multiplication of elements in two matrices can be converted into much faster bit operations on these chips. Thus the substantial reduction in memory overhead makes these low-bit LLMs meet the requirements for deployment on PCs and smartphones.Existing work [38] has already noted the instability within QAT. Extremely low-bit quantization makes the training process highly sensitive to the learning rate, making it difficult for the model to converge when the rate is too small or too large. This is primarily due to the large magnitude of gradients generated as the weight elements fluctuate between +1 and -1, leading to substantial fluctuations in the output of Linear layers. Experiments demonstrate that OneBit shows more stable training process and is not sensitive to learning rates. Please refer to Appendix A.5 for more details.The variable components in our method primarily include Post-LayerNorm, value vectors, and parameter initialization.Post-LayerNorm We discover that there might be floating-point overflow during the QAT process. As depth increases, the activation can become progressively larger. We tackle it using Post-LayerNorm instead of Pre-LayerNorm. In contrast, Pre-LayerNorm may occasionally be ineffective. Value Vectors The main structural difference between OneBit and BitNet [38] is the two value vectors, which are demonstrated to be effective in Section 4.2. They facilitate stable training and the knowledge transfer process. Please refer to Appendix A.5 for more details of comparison.Parameter Initialization In our proposed SVID, both NMF and SVD can be used to decompose |W| and we recommend using the former. This is because we find that NMF may make the training more faster to converge. Figure 5 shows that initializing by NMF facilitates better performance. 
conclusion: 
 We propose a novel model structure for 1-bit weight quantization and a corresponding parameter initialization method to address the difficulty in 1-bit quantization. Extensive experiments on LLMs of various sizes and series demonstrate that OneBit has clear advantages over representative strong baselines and achieves a good tradeoff between model size and performance. We further analyze the capabilities of such extremely low-bit quantized models and provide guidance for future research. 
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: [Yes]Justification: We describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse in Ethics Statement, Sec. C.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: We cite these works accurately.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 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. • 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. 
 
 Appendix: In this section, we provide the necessary and detailed proofs for the propositions presented in this paper. All symbols have the same definition as in the main text.Proposition 1 Given the weight matrix W and input X, the Linear layer can be reformulated as the following according to SVID:XW T ≈ X ⊙ b T W T sign ⊙ a T .Proof From Eq. ( 4), we havew ij ≈ s ij • a i b j, where s ij is the element of W sign . Hence we haveXW T ij ≈ k x ik w T kj = k x ik w jk = k x ik s jk a j b k = k x ik b k s jk a j = k X ⊙ b T ik s T kj a j = X ⊙ b T W T sign ij a j = X ⊙ b T W T sign ⊙ a T ij .This proposition is proved.Lemma 1 Let σ i (W) denote the i-th biggest singular value of matrix W. The following inequality holds:σ 1 (|W|) ≥ σ 1 (W) .Proof According to the definition of induced norm, there areσ 1 (W) = ∥W∥ 2 = max x,∥x∥2=1 ∥Wx∥ 2 , σ 1 (|W|) = ∥|W|∥ 2 = max y,∥y∥2=1 ∥|W|y∥ 2 .Note that for ∀x, ∥x∥ 2 = 1 and we have∥|W||x|∥ 2 2 = i j |w ij ||x j | 2 ≥ i | j w ij x j | 2 = i j w ij x j 2 = ∥Wx∥ 2 2 .Therefore max y,∥y∥2=1∥|W|y∥ 2 ≥ max x,∥x∥2=1 ∥Wx∥ 2 .This lemma is proved.Proposition 2 Given matrices W and |W|, W = W sign ⊙ |W|. We decompose these matrices in the way W = ab T + E 1 and |W| = ãbT + E 2 , where E i denotes the error matrices. In terms of the Frobenius-norm, the SVID is closer to the original matrix W:W -W sign ⊙ ãb T 2 F ≤ W -ab T 2 F .Proof Here we consider SVD to prove it. For SVD, the norm of the error matrix E in the rank-1 approximation is sum of the squares of all singular values except for the largest one. We have∥E 1 ∥ 2 F = n i=2 σ 2 i (W) , ∥E 2 ∥ 2 F = n i=2 σ 2 i (|W|) . Based on ∥W∥ 2 F = ∥|W|∥ 2 F , we have n i=1 σ 2 i (W) = n i=1 σ 2 i (|W|) .According to Lemma 1, we can conclude∥E 2 ∥ 2 F ≤ ∥E 1 ∥ 2 F .From the equation in this proposition, we can formulateW sign ⊙ |W| = W sign ⊙ ãb T + W sign ⊙ E 2 .Hence we haveW -W sign ⊙ ãb T = W sign ⊙ E 2 .Therefore∥W sign ⊙ E 2 ∥ 2 F = i,j s 2 ij e 2 ij = i,j e 2 ij = ∥E 2 ∥ 2 F ≤ ∥E 1 ∥ 2 F, where s ij = ±1 is the element of W sign . Hence the inequation in this proposition is proved.In this subsection, we provide the essential details of the baselines in this work:• GPTQ [14] : We employ the open-source code released by the author. Both OPT models and LLaMA models take 128 2048-token samples from the C4 dataset to calibrate the quantized model. For LLaMA models, we apply the activation order heuristic according to the recommendation from the code. • LLM-QAT [21] : We reimplement this method to adapt the W2A16 setting, as LLM-QAT is not designed for 2-bit weight quantization. We also do not quantize the KV Cache. When quantizing the weight matrix in Linear layer, we use symmetric MinMax quantization in which the zero-point is set to 0. The training hyper-parameters are the same as ours. Please refer to the training details in Section 4.1. • OmniQuant [30] : We employ the open-source code released by the author. Both OPT models and LLaMA models take 128 2048-token samples from the WikiText2 dataset to calibrate the quantized model. The learning rate for learnable weight clipping and equivalent transformation is set to 5e-3 and 1e-2, respectively. We use a batch size of 1 and train 40 epochs for each model. For OPT models, both learnable weight clipping and equivalent transformation are leveraged. For LLaMA models, only learnable weight clipping is used.Table 4 compares the results on LLaMA2-7B/13B. Obviously, our method has advantages in both perplexity and zero-shot accuracy. It also reflects that the advantages of our method are more pronounced in larger models. For instance, when scaling from LLaMA2-7B to LLaMA2-13B, the perplexity of the FP16 model decreases by around only 0.5, whereas our method reduces it by around 1.0 on both Wiki2 and C4 datasets. Instruction following is an important ability of LLMs [27, 5, 26] . Beyond the discussion on model abilities and efficiency before, we also focus on the instruction following ability of extremely low-bit models, which is closely related to their practical usability. In this subsection, we empirically study this capability of our quantized model. We fine-tune the model for 3 epochs using the alpaca_en_52k dataset and alpaca templates [33] , then observe the generation in both zero-shot and few-shot settings before and after fine-tuning. During training, the learning rate is set to 1e-7 and the batch size to 32.Other parameters are consistent with Section 4.1.Table 5 demonstrates the content generation and instruction following abilities of our 7B model. Under the zero-shot setting, the model without SFT produced verbose, repetitive, and low-quality text. However, once experienced to SFT, our model is able to smoothly output high-quality content, exhibiting excellent instruction following ability. For the few-shot setting, our model exhibits instruction following ability both before and after SFT.Recently, BitNet [38] introduces a 1-bit model architecture and applies the architecture to train models from scratch, demonstrating the feasibility and application value of the 1-bit model structure.In this paper, we attempt to combine 1-bit quantization with knowledge distillation to quantize the LLaMA-7B model. Unfortunately, despite following the suggestion to use larger learning rates, the behavior remains unstable during training.Figure 6 shows that the training process of BitNet may suffer from instability during knowledge distillation. We conjecture that it is because the gradient is pretty large when the weight elements fluctuate between +1 and -1, further aggravating the output of the Linear layer.As a more effective measure, the value vectors we propose for quantization not only supplement the necessary floating-point numerical precision but also limit the fluctuation range of the matrix multiplication results after quantization. This can be understood from forward and backward computation, respectively.Forward stability. Quantized matrix multiplication is more prone to overflow than FP16 counterparts in response to minor perturbations of input activations. This is because the magnitude of elements in quantized matrices, particularly the value ±1, is far greater than the parameters of most FP16 matrices. By multiplying by value vectors of a magnitude similar to that of the FP16 model, the range of variation in model output activations can be restored to the level of FP16. Furthermore, we also avoid the increasingly large "drift phenomenon" of activations through Post-LayerNorm.Backward stability. Since Sign(•) function is not differentiable, when the elements of the matrix change, their gradient may become infinite. Similar to forward stability, by multiplying two numerically smaller value vectors, we avoid layer-by-layer accumulation and explosion during gradient back-propagation. Moreover, we implement the derivative function of Sign(•) using the derivative of the hyperbolic tangent function, thereby avoiding the problem of gradient explosion at the zero point of every weight. L KD + L MSE + L ATTN NAN NAN - - - - - - -Although knowledge distillation is not the main contribution of this paper, we nevertheless provide the rationale behind certain settings used in our experiments to explain the necessity of these configurations.We firstly explain the role of different loss functions in guiding the process of knowledge transfer. Fundamentally, distillation loss alone can achieve a satisfactory transfer process (comparing to other baselines). Additionally, as shown in the Table 6 , aligning the hidden states between layers can result in a quantized model with better perplexity. However, further incorporating attention score alignment on this basis leads to the model failing to converge. LLM-QAT [21] has conducted similar experiments on quantization-aware knowledge distillation loss and concluded that using only the distillation loss yields the best results. The difference in conclusions may stem from two factors. On one hand, due to our adoption of a novel model architecture, which differs from theirs, the optimal usage of loss functions may be different as well. On the other hand, as we focus on extremely low bit-width compression, each layer of the model suffers significant information loss compared to the teacher model. The regularization of hidden states between layers may help reduce the variance in the learning process, thus demonstrating stronger generalization.Furthermore, we also discuss the cost of our quantization method. Using LLaMA-7B as an example, quantizing the model with our method requires approximately 7 days on 8 A100-80GB GPUs. In comparison, training the LLaMA-7B model from scratch consumes 82,432 GPU hours [34] . The quantization time, being less than 2% of the pretraining time, is still an acceptable cost.This subsection formulates the calculation of the average bit-width of Linear layers. Assume there is a weight matrix with a shape of 4096 × 4096 in such a layer, the number of bits in every component is1 × 4096 × 4096, 16 × 1 × 4096 × 2,where the first is for the 1-bit quantized weight matrix and the second is for the two FP16 value vectors. Hence the overall number of bits is Although our proposed method significantly reduces the memory footprint of LLMs, bringing hope for efficient deployment of them, there are still some limitations. Firstly, compared to the original model, our extremely low-bit quantization inevitably incurs a performance loss. Additionally, we are yet to understand the mathematical principles behind the optimal parameters of the 1-bit quantized model, thus capability transfer can only be achieved through the relatively costly process of KD. Fortunately, this cost is a one-time expense. Moreover, due to the unique nature of 1-bit quantization, our method can not be naturally extended to higher bit-width. Lastly, we have not considered the activation quantization and leave it as future work.Answer 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).38th Conference on Neural Information Processing Systems (NeurIPS 2024).https://scikit-learn.org/https://github.com/EleutherAI/lm-evaluation-harness 


Decision: This paper introduces an aggressive quantization technique that is of interest to the community. However, I would recommend the authors moderate some of their claims. For instance, it is not, strictly speaking, 1-bit quantization when considering the two vector values.

Reviews: review: paper_summary: paper_summary: This paper proposes OneBit, which quantizes the LLM weight matrices to 1-bit and achieves good performance and improved convergence speed by using two additional vectors with FP16 per one linear layer.
strength_weakness: strength_weakness: 1. It will be great if they compare with other one-bit based quantization methods such as BitNet.

2. I recommend authors to add empirical results for larger models like Llama-70b.
questions: questions: 1. Would it be possible to compare the inference speed of this method and other methods? I am curious about the potential delay in inference caused by using additional FP16 vectors.
limitations: limitations: N/A
paper_summary: paper_summary: This paper proposes OneBits, a novel quantization-aware training methodology for 1-bit large language models (LLMs). OneBits introduces two key contributions for training 1-bit models. First, it presents a new 1-bit binary quantization linear design that separates the weight matrix into sign and value components. The sign is packed into INT1, while the value is decomposed using a 1-rank decomposition factor added to the linear operation. Second, to train the 1-bit models in the linear layers of BitNets, OneBits modifies the traditional quantization-aware training (QAT) method by augmenting the cross-entropy loss function with an additional term for the reconstruction error of each layer, resulting in the final objective loss function.

Using the proposed approach, OneBits is applied to various decoder-only LLM models. The comparisons between OneBits (W1A16) and other methods like LLM-QAT, AWQ, and OmniQuant (W2A16) demonstrate that OneBits achieves superior performance in common sense reasoning tasks.
strength_weakness: strength_weakness: - While the paper demonstrates zero-shot performance in terms of PPL and CSR, it lacks experiments on how the same model maintains performance in few-shot scenarios, such as the MMLU benchmark.
- If the quality of this generated data is poor, it could negatively impact the performance of the OneBit LLM. The paper does not clearly explain why self-generated data was used instead of public datasets like C4.
- The analysis of OneBit LLM's benefits in terms of inference latency and throughput relative to accuracy is insufficient. A detailed examination of these metrics would provide a more comprehensive understanding of the advantages of using OneBit LLM.
questions: questions: - While the OneBit method has demonstrated independent evaluation of zero-shot and few-shot performance, showing effectiveness compared to LLM-QAT and OmniQuant, it does not provide evidence of a single OneBit model performing well in both zero-shot and few-shot scenarios simultaneously. It would be valuable to present combined performance results, such as including MMLU results in Table 2 for a comprehensive comparison.
- When comparing the quality of output generated by OneBit LLM to other models using metrics like AlpacaEval, what trends or patterns emerge regarding the quality of generated data?
limitations: limitations: Since OneBit LLM is applied only to weights, this method is likely to be effective in improving latency and throughput, particularly in scenarios involving small batch sizes during the generation phase. In this paper, activation quantization has not been considered, and further research in this area is necessary to optimize performance.
paper_summary: paper_summary: This paper explores an innovative 1-bit quantization framework for Large Language Models (LLMs) to significantly reduce their memory and computational demands. Traditional methods face severe performance drops with reduced bit-width; however, this paper introduces a novel quantization and initialization approach that maintains at least 81% of the original model’s performance, even with extreme bit-width reduction. The proposed method, which includes a specialized matrix decomposition and parameter initialization, demonstrates strong performance and robustness in experiments, establishing a new direction for deploying LLMs on resource-constrained environments.
strength_weakness: strength_weakness: A significant issue discussed in the paper is the lack of a specialized CUDA kernel for optimizing binary operations, which hinders accurate evaluation of the additional computational costs associated with the two FP vectors $\mathbf{a}$ and $\mathbf{b}$. This limitation complicates the assessment of their impact on overall performance. Furthermore, despite the inclusion of $\mathbf{a}$ and $\mathbf{b}$, there remains a considerable performance decline compared to FP16 models, challenging the practical applicability of this approach in real-world settings.
questions: questions: 1. The experiments described in Section 4.3 may not provide an appropriate comparison. Assessing the proposed method alongside directly training smaller models or utilizing low-rank decomposition to minimize parameter counts involves fundamentally different approaches to reducing model size. Additionally, the proposed method incorporates knowledge distillation, which is not employed in the baseline methods being compared, potentially skewing performance comparisons.

2. An essential ablation study is notably absent from the discussion. The proposed method incorporates two additional floating-point vectors, $\mathbf{a}$ and $\mathbf{b}$, for binary quantization. Yet, the impact of these vectors on performance enhancement remains unclear, highlighting a gap in the evaluation of the method’s effectiveness.

3. To offer a more comprehensive evaluation, I recommend including assessments on generative tasks, such as code generation. This would provide deeper insights into the versatility and practical applicability of the proposed method across different domains.
limitations: limitations: The authors have discussed the limitations of their study.
paper_summary: paper_summary: This paper presents OneBit, a framework for quantizing large language models (LLMs) to 1-bit weight matrices. Unlike existing methods that rely on 4-bit or 8-bit quantization to avoid severe performance degradation, OneBit introduces a novel 1-bit parameter representation and an effective parameter initialization method based on matrix decomposition.
strength_weakness: strength_weakness: - Entropy Encoding: Intuitively, 1-bit compressed models should be suitable for entropy encoding. Previous work has demonstrated that quantized LLMs still have compressibility [1,2]. Have the authors tried using popular entropy encoders to further compress these weights?

- Inference Calculations: During inference, do g and h participate in the calculations? Does this mean that 1-bit net is not entirely integer-based computation? Does each layer have its own G and h?

- Dequantization: Is dequantization required between layers during inference?

- Knowledge Distillation (KD): In line 191, it is mentioned that KD does not use LM loss. Why is that?

- Comparison with 1.58bitnet: Have the authors considered comparing their method with 1.58bitnet [3]?

- Table 2 Details: Does Table 2 show the performance of W1A16 or W2A16? If it is W2A16, where is the performance of W1A16 reported? Why are there no experimental results for 16B and 60B models in Table 2? I suspect that extreme quantization has a more detrimental effect on larger models.

- Comparison in Figure 3: Figure 3 compares the performance of 1-bit quantized 7B models with smaller models. Are these smaller models in full precision? How would the results compare with 8-bit smaller models?

- Code Availability: Will the code be open-sourced?

- Minor Issues: Figures 3 and 4 are not clear when printed in gray-scale.

References:

[1] Mao Y, Wang W, Du H, et al. On the compressibility of quantized large language models. arXiv preprint arXiv:2403.01384, 2024.

[2] [2] Hershcovitch M, Choshen L, Wood A, et al. Lossless and Near-Lossless Compression for Foundation Models[J]. arXiv preprint arXiv:2404.15198, 2024.
[3] Ma S, Wang H, Ma L, et al. The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits[J]. arXiv preprint arXiv:2402.17764, 2024.
questions: questions: See above.
limitations: limitations: See above.

Comments: title: Response from Reviewer gg38
Invitation to Participate in the Discussion Period
Official comments by Reviewer mFhw
comment: Thank you very much for your continued review. We are grateful for your positive feedback and the time you have devoted to evaluating our work. Please don’t hesitate to reach out if there are any further questions or points of discussion. We remain at your disposal for any additional clarifications.
Thank you for your considerate response. While most of my concerns have been addressed, I still believe it is important to examine how the gap between Zero-shot and Few-shot performance changes before and after applying OneBits to the public LLM models in Table 2.
When performing QAT from scratch, as with OneBits-7B, I believe that training with at least a similar number of tokens to what is suggested by the Chinchilla-optimal is necessary to observe a reliable trend.
However, considering that Figures 3(a) and 3(b) show that OneBit-7B achieves performance comparable to the 1B-scale model, which was trained with a larger amount of data, and that OneBit demonstrates a meaningful performance improvement over other quantization methods on public LLMs, I have decided to raise my score from 4 to 5.
Thank you very much for your review. We have provided detailed responses to your question. If you could participate in the discussion period, we would be very grateful again.
Thank you very much for your continued review. We are grateful for your positive feedback and the time you have devoted to evaluating our work. Please don’t hesitate to reach out if there are any further questions or points of discussion. We remain at your disposal for any additional clarifications.
Thank you very much for your continued review. We are grateful for your positive feedback and the time you have devoted to evaluating our work. Please don’t hesitate to reach out if there are any further questions or points of discussion. We remain at your disposal for any additional clarifications.
Thank you very much for your continued review. We are grateful for your positive feedback and the time you have devoted to evaluating our work. Please don’t hesitate to reach out if there are any further questions or points of discussion. We remain at your disposal for any additional clarifications.
Thank you for the clarification and new sensitivity analysis. I will keep my score.
Thank you to the authors for rebuttal and the clarifications provided. Based on your responses, I remain inclined to keep the score.
Thank you for your rebuttal and clarification. I remain inclined to accept this work and will maintain my score of 6.