RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization
필름·전자재료 · (13) 프리즘 필름
기본 정보
- 저자
- DOI
- 10.18653/v1/2024.findings-emnlp.444
- 저널
- –
- 발행년도
- 2024
- 발행기관
- –
- 피인용수
- 5
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.18653/v1/2024.findings-emnlp.444
- 토픽
- Analytical Chemistry and Sensors
- OpenAlex ID
- W4404781137
평가 내용
- 관련도
- 사업분야
- 필름·전자재료 · (13) 프리즘 필름
- 부 분야
- –
- R&D 측면
- –
- 확신도
- –
- 근거 용어
- –
- 판단 근거
- 임베딩 유사도 기반 평가로 '필름·전자재료 > 프리즘 필름' 분야에 선정된 논문입니다.
- R&D 활용 포인트
- –
- 평가 입력
- –
초록
본문 55,517자
본문 펼치기
섹션 본문 58문단 · 29,532자
(제목 없음)
1Low-Rank Adaptation (LoRA), as a representative Parameter-Efficient Fine-Tuning (PEFT) method, significantly enhances the training efficiency by updating only a small portion of the weights in Large Language Models (LLMs).Recently, weight-only quantization techniques have also been applied to LoRA methods to reduce the memory footprint of fine-tuning.However, applying weight-activation quantization to the LoRA pipeline is under-explored, and we observe substantial performance degradation primarily due to the presence of activation outliers.In this work, we propose RoLoRA, the first LoRA-based scheme for effective weight-activation quantization.RoLoRA utilizes rotation for outlier elimination and proposes rotation-aware fine-tuning to preserve the outlier-free characteristics in rotated LLMs.Experimental results show RoLoRA consistently improves low-bit LoRA convergence and post-training quantization robustness in weightactivation settings.We evaluate RoLoRA across LLaMA2-7B/13B, LLaMA3-8B models, achieving up to 29.5% absolute accuracy gain of 4-bit weight-activation quantized LLaMA2-13B on commonsense reasoning tasks compared to LoRA baseline.We further demonstrate its effectiveness on Large Multimodal Models (LLaVA-1.5-7B).Codes are available at https://github.com/HuangOwen/RoLoRA* All the work was done within HKUST and Zechun Liu served an advisory role.
Introduction
2While we have witnessed the success of Large Language Models (LLMs) such as GPT-4 (Achiam et al., 2023) and LLaMA (Touvron et al., 2023) across various tasks in recent years, the massive model size and expanding training cost for LLMs have necessitated the design of model compression and Parameter-Efficient Fine-Tuning (PEFT) methods.Low-rank Adaption (LoRA) (Hu et al., 2021), as the most favored PEFT method, significantly enhances the fine-tuning efficiency of LLMs.
3Recently, quantization techniques, which convert high-precision parameters into lower-bit formats such as INT4, have been integrated with LoRA methods (Dettmers et al., 2024;Li et al., 2024;Xu et al., 2024;Qin et al., 2024).Existing quantization-LoRA schemes can save memory costs during fine-tuning, and some schemes (Li et al., 2024;Xu et al., 2024) can also reduce inference costs by producing quantized LLMs directly.However, these methods only perform weight-only quantization, while LoRA weight-activation quantization is under-explored.Quantizing both weights and activations in low-bit further saves run-time GPU memory and accelerates compute-intensive matrix-multiplication operations.We observe that 4-bit or 6-bit weight-activation quantization with LoRA finetuning still incurs a high accuracy degradation in LLMs, attributing to the outliers in weight and activation distribution, which stretch the quantization range and increase the quantization error.
4Existing methods in the post-training quantization research community have endeavored to tackle the outlier challenge by mixed-precision subgrouping (Zhao et al., 2024;Chee et al., 2024) or shifting outliers from activation to weight (Xiao et al., 2023;Shao et al., 2024).More recently, applying rotation (Ashkboos et al., 2024;Liu et al., 2024c) to the weight matrices of LLMs has demonstrated effectiveness in eliminating activation outliers and keeping computational invariance (Ashkboos et al., 2023a).However, all these methods solve the problems from a post-training perspective, ignoring that outliers will emerge and change distribution during pre-training and fine-tuning (Bondarenko et al., 2021).In this work, we take a step further to utilize the rotation for outliers-removal in LoRA finetuning setting and investigate the optimal solution for dynamically integrating rotation with LoRA to preserve the outlier-free characteristics and im-prove weight-activation quantization.Motivated by this target, we propose Rotated outlier-free Low-Rank Adaptation (RoLoRA), which initially apply in-block and between-block rotation to the pretrained LLMs, and then utilize rotation-aware finetuning to produce outlier-free fine-tuned LLMs as shown in Figure 1.We explore the optimal rotationaware fine-tuning scheme based on approximation error analysis.
5Extensive experimental results prove the effectiveness of RoLoRA across diverse LLMs, tasks, and quantization settings.RoLoRA improves the 4-bit quantization for weights and activations (W4A4) performance up to 14.6 points on the MMLU benchmark compared to LoRA.Compared with existing low-bit LoRA methods, RoLoRA outperforms previous SOTA IR-QLoRA (Qin et al., 2024) with up to 6.0 points on the MMLU benchmark.The proposed RoLoRA is highly efficient with negligible fine-tuning overhead compared to LoRA in the same setting.RoLoRA can also improve the quantization robustness of Large Multimodal Models (LMMs) such as LLaVA (Liu et al., 2024a), and we observe the multimodal understanding is largely retained even after W4A4 quantization as shown in Table 1.
6In summary, our work contributes as follows:
7• We propose RoLoRA, the first method that explores the feasibility of integrating rotation in LoRA with quantization settings.
8• RoLoRA enables robust weight-activation quantization of fine-tuned LLMs, especially in low-bit settings such as W4A4 and W6A6.
9• We verify the effectiveness of RoLoRA on the LLaMA series (2-7B, 2-13B, 3-8B) across quantizers (RTN/GPTQ), bitwidth (W4A4/W6A6), and benchmarks (Zero-shot commonsense, MMLU).We also demonstrate that RoLoRA can be applied to LMMs.
Related Work
10Quantization Quantization methods are powerful tools for improving training and inference efficiency.The core insight is replacing full-precision weights and activations with lower-precision representation.Most existing LLM quantization techniques fall in the category of post-training quantization (PTQ) (Liu et al., 2023b;Frantar et al., 2023;Lin et al., 2024;Shang et al., 2024;Chee et al., 2024) that directly quantize the model with- The image features a pizza with a variety of toppings, including cheese, pepperonies, and chicken.There are three pizzas in total, with one of them being a pizza with chicken.The pizzas are placed in a cardboard box, which is open and ready for the pizzas.The pizzas are served in a box, making it a convenient and portable meal option.
11Table 1: LLaVA-1.5-7BW4A4 quantization evaluation on the example from LLaVA-Bench.out extensive training.Among these LLM PTQ methods, most of them apply weight-only quantization while few methods explore weight-activation quantization (Xiao et al., 2023;Shao et al., 2024;Zhao et al., 2024;Ashkboos et al., 2024).Compared to the weight-only quantization, quantizing both weights and activations enables low-precision multiply-accumulation (MAC) units.The core challenge is that outliers in activations cause high quantization errors.This work focuses on the weightactivation quantization in the LoRA pipeline.LoRA Considering that full parameter fine-tuning becomes computationally impractical as the scale of LLM continues to grow, Parameter-Efficient Fine-Tuning (PEFT) methods (Li and Liang, 2021;Hu et al., 2023;Zhang et al., 2023) are designed to reduce the cost by training a relatively small subset of parameters.Low-Rank Adaptation (LoRA) (Hu et al., 2021) is the most adopted PEFT method, considering its flexibility and efficiency.More recently, LoRA variants (Kopiczko et al., 2024;Liu et al., 2024b;Hayou et al., 2024) emerged to improve the effectiveness and efficiency of LoRA.Combining LoRA and quantization (Dettmers et al., 2024) has also been a promising direction as quantization can further save the GPU memory in LoRA finetuning.To further reduce the information distortion of lowbit finetuning, various improvements of QLoRA have been proposed (Xu et al., 2024;Li et al., 2024;Qin et al., 2024).However, these methods only apply quantization to the weight during fine-tuning to reduce memory consumption.This work is the first quantized LoRA scheme that considers the robustness to weight-activation quantization.
Preliminary and Motivation
123.1 Low-Rank Adaptation (LoRA) For a pre-trained weight matrix W 0 ∈ R d×k , LoRA models the weight update ∆W ∈ R d×k utilizing a low-rank decomposition, expressed as AB, where A ∈ R d×r and B ∈ R r×k represent two low-rank matrices, with r ≪ min(d, k).Consequently, the fine-tuned weight W ′ can be represented as:
13where W 0 remains static during the fine-tuning process, and the underlined parameters are being trained.Additionally, based on Eq. (1), we can merge the learned ∆W with the pre-trained weight W 0 and obtain W ′ in advance of deployment, and given that both W ′ and W 0 both fall within the dimensionality of R d×k , LoRA and its related variants do not introduce any extra latency during the inference compared to the original model.
Outlier in Transformer
14Starting from small-scale transformer models such as BERT and ViT, researchers have revealed that outliers exist within the weight and activation distribution (Huang et al., 2023;Wei et al., 2022).Their existence in LLMs is also observed in various studies.As shown in the left side of Figure .1, activation outliers are distributed per channel.While these outliers improve the representative capacity of the transformers (Sun et al., 2024), they bring non-trivial challenges for quantization (Xiao et al., 2023;Liu et al., 2023b).
15Most previous solutions to this outlier problem in quantization can be categorized into three types:
16(1) isolating these outlier values in a sub-group with higher precision, such as LLM.int8 (Dettmers et al., 2022), Atom (Zhao et al., 2024), QuiK (Ashkboos et al., 2023b), and AdaDim (Heo et al., 2024).However, there is non-trivial overhead for the grouping and mixed-precision.( 2) shifting the challenge of quantization from activations to weights, such as SmoothQuant (Xiao et al., 2023) and Omni-Quant (Shao et al., 2024).However, these methods negatively influence the weight quantization robustness and fail at W4A4 scenarios.(3) rotating activation or weight matrices to remove outliers, such as QuaRot (Ashkboos et al., 2024) and SpinQuant (Liu et al., 2024c).Among these methods, recent rotation-based solutions demonstrate superior effectiveness.However, previous rotationbased methods tackle the outlier challenge from a post-training perspective and have not been explored under PEFT settings.
17Thus, it leads to a question: Can we preserve the outlier-free characteristics of rotated LLMs and benefit from them during PEFT?We show in this work that we can achieve such a target and step further to investigate the most promising rotationbased fine-tuning solutions in this work.
Eliminating Outlier with Rotation
18A rotation matrix R is defined as an orthogonal matrix with |R| = 1, where R also follows the characteristics of the orthogonal matrix that RR ⊤ = I.If the entries of R are either +1 or -1, it becomes a Hadamard matrix H. Based on the definition, we can efficiently generate H with 2 k entries1 based on the Hadamard transform (also known as the Walsh-Hadamard transform (Ritter, 1996) as an ex-
19Feed-forward Network ample of a generalized class of Fourier transforms):
20(2) where ⊗ denotes the Kronecker product.The rotation is highly efficient as the matrix-vector product with a d × d Hadamard matrix H d X requires O(d log 2 (d)) operations.Previous research (Ashkboos et al., 2023a) has revealed that applying rotation on the weights of pre-norm transformers can retain its computational consistency and further lead to fewer outliers in the weight and activation distribution (Ashkboos et al., 2024;Liu et al., 2024c).Concretely, the multiplication of weight matrices with a rotation matrix statistically blends weights with large and small magnitudes together into a more Gaussian-like distribution, thus producing activations with fewer outliers and easier to quantize.The outlier elimination effect of rotation is also theoretically proved in Chee et al. (2024).
Method
21Motivated by existing challenges of activation outliers and the success of rotation-based solutions (Ashkboos et al., 2024;Liu et al., 2024c), we introduce Rotated outlier-free Low-Rank Adaptation (RoLoRA).RoLoRA initially apply inblock and between-block rotation to the pre-trained LLMs, and rotation-aware fine-tuning on the rotated LLMs will retain the optimal outlier-free characteristic, producing fine-tuned LLMs highly robust to weight-activation quantization.
Applying Rotation
22Before starting fine-tuning with rotation, we first modify the model to keep computational invariance before and after rotation.First, we need to ensure no scaling operation in the normalization module.For the LLaMA series, this can be implemented by absorbing the RMSNorm scale parameters α into the weight matrix right after the RMSNorm layer (Elhage et al., 2023).
23Then, we perform between-block rotation to make sure that the outliers in between-block activation are eliminated.As shown in Figure 2, we classify the weight matrices in LLMs into two groups: left-side weights, including W q , W k , W v in self-attention modules, and W up , W gate in feedforward network modules (which corresponds to the W u , W g in Figure 2).right-side weights, including W o in self-attention modules and W down in feed-forward network modules.For the weights of these two groups, we adopt different rotation strategies with
24where the rotation R is randomly generated Hadamard matrix.As we also rotated the input X before embedding layer with X ← XR −1 and output Y after lm_head with Y ← RY , the final output of the model will be identical to the original model.To avoid overflow issues in the rotation process, we converted the FP16 weights to FP64 and converted them back after the multiplication.The conversion of weight precision is only conducted once at the beginning of the rotation merging and the precision of the rotated weights will keep FP16 during the fine-tuning and inference.There will be no overhead for conversion in the actual inference because the precision during inference is always low-bit (W4A4/W6A6).These rotations are applied before any training and inference, which indicates that there will be no overhead after the merging to original weights.
25The rotation that directly applies to weights effectively reduces the outlier in between-block activation, and we refer to the operation as Between-Block Rotation (BBR).Figure . 1 demonstrates the effect of applying BBR as the activation distribution is smoother and de-centralized.However, another challenge remains that the activation in these modules still suffers from outliers, especially prevalent in FFN as discussed in previous research (Bondarenko et al., 2024).We cannot directly apply rotation similar to BBR because of the non-linear operations such as SwiGLU (Shazeer, 2020) in FFN.To solve this, we adopt the online rotation node before inputting the activation input to W down .This online rotation is implemented following the fast Hadamard kernel (Chee et al., 2024;Ashkboos et al., 2024), which can be seen as a layer dynamically rotating the activation.This online rotation operation is highly efficient as we use the fast Hadamard kernel on CUDA 2 , and the overhead is negligible during training and inference.It is referred to as In-Block Rotation (IBR).Note that IBR can also be applied to the self-attention module, but we observe in the experiments of Table 7 that there is no performance improvement with this rotation.
Rotation-aware Fine-tuning
26After performing both BBR and IBR, the betweenblock and in-block activation outliers are eliminated.This characteristic can lower the quantization error during QLoRA training, enabling a more accurate gradient estimation and smoother optimization for fine-tuning.However, existing research (Bondarenko et al., 2021;Kovaleva et al., 2021) revealed that outliers will change distribution or emerge during fine-tuning and pre-training.This poses a new challenge of dynamically integrating rotation into LoRA to effectively maintain outlier-free characteristics.To design the optimal rotation-aware fine-tuning scheme, we first analyze the approximation difficulty when rotation is applied.We assume that the optimal weight distribution for specific downstream tasks is W * , and we approximate it with the LoRA weights AB merged with pre-trained weights W 0 .The optimization of LoRA fine-tuning could be indicated as
27where the ∥ • ∥ F denotes the Frobenious norm.To insert the LoRA module in the rotated models, we propose two rotation-aware fine-tuning schemes, namely LoRA After Rotation (LAR) and LoRA Before Rotation (LBR), as shown in Figure 3.In LAR, we first merge the rotation matrix with pre-trained weights and then use R 1 W 0 + AB to approximate W * .For LBR, we first merge the LoRA weights and rotate them to be R 1 (W 0 +AB).We assume the optimal weights to be the full-finetuning results W F T , and the optimization for these two schemes becomes:
28the final optimization is very different.We apply SVD of the approximation target O LAR , O LBR ∈ R d×k by O = U SV T .The principal singular values and vectors in the first r dimensions are utilized to initialize the LoRA weights with rank r as A ∈ R m×r and B ∈ R r×n :
29We verify the approximation error of different rank choices r to simulate the LoRA on two rotation schemes.We use a pre-trained LLaMA2-7B as W 0 and a full-parameter fine-tuned model on the Alpaca dataset (Taori et al., 2023) as W F T for the experiments.which is shown in Figure .4. Based on the results, LAR outperforms LBR in low-rank settings with lower approximation error, suggesting LAR is the better design for rotation-aware finetuning.The better approximation indicates that after the two-stage merging with rotation matrices and LoRA weights, the final weights can still retain the outlier-free property, which is further validated by ablation experiments in Section 5.5.As a result of the optimal rotation-aware finetuning scheme under the LAR setting, we can effectively retain the outlier-free characteristic during LLM fine-tuning, as shown in Figure 5.
Settings
30Model, LoRA, Quantizer The models for our experiments include LLaMA2-7B/13B (Touvron et al., 2023) and LLaMA3-8B (AI@Meta, 2024).We follow the settings in LLaMA-Factory (Zheng et al., 2024) to implement the training pipeline.The dataset for fine-tuning is Alpaca (Taori et al., 2023) with 52K samples.The weight PTQ methods are the baseline Round-To-Nearest (RTN) and widely used GPTQ (Frantar et al., 2023), and the activation quantizer is RTN across all experiments.We use per-channel symmetric quantization for weights and per-tensor activation quantization.Tasks Our RoLoRA was verified on seven zero-shot commonsense reasoning tasks using EleutherAI evaluation harness (Gao et al., 2021).These tasks include BoolQ (Clark et al., 2019), PIQA (Bisk et al., 2020), HellaSwag (Zellers et al., 2019), WinoGrande (Sakaguchi et al., 2021), ARCeasy and ARC-challenge (Clark et al., 2018), and OBQA (Mihaylov et al., 2018).Additionally, we also report the accuracy of Massively Multitask Language Understanding (MMLU) benchmark (Hendrycks et al., 2020) for our evaluation.Baselines We consider two settings for experiments.The first is conducting FP16 fine-tuning with RoLoRA, where we compare the W4A4 and W6A6 quantization results with LoRA.The second is conducting RoLoRA fine-tuning with 4bit weight quantization, which we refer to as QRoLoRA, and comparing the W4A4 performance with other low-bit LoRA methods including QLoRA (Dettmers et al., 2024), LoftQ (Li et al., 2024), and IR-LoRA (Qin et al., 2024).
Main Results
31We first evaluate RoLoRA against LoRA in FP16 fine-tuning and then apply weight-activation PTQ to the fine-tuned LLMs.To ensure a fair comparison, both RoLoRA and LoRA use the same settings (rank, epoch, learning rate, etc.).As listed in Table 2, RoLoRA enhances the quantization robustness of the LLaMA series across various quan-tization settings on zero-shot commonsense reasoning and MMLU benchmarks.Specifically for the W4A4 low-bit setting, RoLoRA outperforms LoRA with an absolute up to 29.5% and 14.6% on ZCSR and MMLU, respectively.Although MMLU contains multiple-choice questions with four options.The relative accuracy below 25% is still meaningful because we observe that some low-bit quantized LLMs cannot even be instructed to give a choice from four options.Our method can better preserve the reasoning performance, thus ensuring most of the time LLaMA is still following the instructions to answer the question rather than generating meaningless tokens.Furthermore, RoLoRA makes it feasible for near-lossless W6A6 quantization of the LLaMa series across multiple tasks.
32We further evaluate RoLoRA against QLoRA (Dettmers et al., 2024) and serval baseline methods, including LoftQ (Li et al., 2024), IR-QLoRA (Qin et al., 2024), on 4-bit fine-tuning and then apply W4A4 PTQ to the low-bit fine-tuned LLaMA2-7B.The performance across seven commonsense reasoning tasks and four MMLU subtasks is detailed in Table 3.We can see that RoLoRA consistently improves the performance of the quantized model using the same quantizer.In particular, for W4A4 GPTQ, RoLoRA exceeds QLoRA by 20.5% on the average accuracy of commonsense reasoning tasks.Across the experiments on both FP16 and 4-bit fine-tuning, we observe that RoLoRA achieves higher performance improvement on the LLMs quantized by GPTQ (Frantar et al., 2023) in general.This observation supports our claim that RoLoRA retains the outlier-free activation in fine-tuning as GPTQ only helps lower the quantization error of weights but not for activation.
Visual Instruction Tuning
33We further verify the effectiveness of RoLoRA on visual instruction tuning tasks with LLaVA-1.5-7B(Liu et al., 2023a), which consists of a language model, Vicuna-7B (Chiang et al., 2023), and a vision encoder CLIP ViT-L-336px (Radford et al., 2021).We finetune the LLaVA-1.5-7B on LLaVA-Instruct-150K3 .We only perform quantization on the language model and evaluate the LLaVA with quantized Vicuna and full-precision vision encoder on LLaVA-bench (COCO) (Liu et al., 2024a) with GPT-4 (Achiam et al., 2023).The relative score across the conversation, detail description, and complex reasoning are reported in Table .4, where we can observe from the results that RoLoRA help improve the quantization robustness and keep the multi-modal ability during PTQ to the better extent with an increase up to 18.9 overall scores.We also provide an example of the detail description task on a given image shown in Table .1.While the W4A4 LoRA model only gives a rough superficial description of the images, our W4A4 RoLoRA model fully elaborates the details, such as the toppings and containers.
Compatibility with other LoRA variants
34We further verify our method on a representative LoRA variant, DoRA (Liu et al., 2024b).DoRA decomposes the pre-trained weight into magnitude and directional components and finetunes both.We also follow this scheme in our rotation-aware fine-tuning stage and refer to this scheme as RoDoRA.
35As shown in Table 5, RoDoRA achieves 18.3% and 26.7% higher accuracy on W4A4 LLaMA2-7B using RTN and GPTQ as quantizers.The results of RoDoRA also outperform RoLoRA, showing the compatibility of our methods with cutting-edge LoRA variants and potential to further enhance the performance of weight-activation quantization.are listed in Table 6.The results indicate that applying rotation before LoRA can consistently enhance the quantization robustness of the fine-tuned LLMs.Where to Apply Rotation?In Figure 2, we introduce two types of rotation in our pipeline, namely Between-Block Rotation applied on all weight matrices and In-Block Rotation applied on down_proj in FFN.As discussed in Section 4.1, we can also apply a similar head-wise IBR R 3 for self-attention.The R 3 rotates the W v and W o in Figure 2 by
36These choices for rotation targets are verified on LLaMA2-7B W4A4 PTQ shown in Table 7.The results suggest that applying and only applying both R 1 and R 2 is the best option to eliminate outliers.
Method
37Rotation ZCSR 7 Avg.
RoLoRA
38How to Apply LoRA?In Section 4.2, we propose two rotation-aware fine-tuning schemes LoRA After Rotation (LAR) and LoRA Before Rotation (LBR) shown in Figure 3.We prove that LAR is the better paradigm based on the approximation error analysis compared with full-finetuning.In Table 8, we quantitatively compare the W4A4 quantization performance of two schemes on the fine-tuning of the LLaMA2-7B.The LAR scheme demonstrates better effectiveness, which corresponds to the ap-proximation analysis shown in Figure 4.
39of the activation to measure the outlier presence, where µ and σ are respectively the empirical mean and standard deviation of activation distribution.Generally, a large kurtosis value indicates an activation distribution with heavy tails and a higher likelihood of outliers.We visualize the kurtosis dynamic during fine-tuning with LoRA and RoLoRA in Figure 5.In the early training epochs, the rotation effectively suppresses the activation outliers.The rotation-aware fine-tuning can retain this optimal property.After fine-tuning with RoLoRA, as shown in Figure 5, the kurtosis κ across all layers is significantly reduced, which further gives rise to the low quantization error compared to the LoRA baseline.We also compare the activation distribution of RoLoRA against LoRA across layers in Figure 7 in the Appendix.LoRA rank settings We explore the robustness of LoRA and RoLoRA towards various rank settings r ∈ {4, 8, 16, 32, 64} when fine-tuning LLaMA2-7B and evaluated on zero-shot commonsense reasoning tasks.The optimal rank setting for RoLoRA and LoRA are 16 and 32, respectively.The lower optimal rank indicates the potential of our RoLoRA to save trainable parameters.Overall, RoLoRA consistently outperforms LoRA regardless of the rank setting, demonstrating its robustness.Efficiency For the fine-tuning efficiency of 2) can be directly merged into the original weights.There is only one additional matrix multiplication, and the increased rotation parameter can theoretically be considered negligible.We reported the fine-tuning cost of RoLoRA compared to LoRA in the same settings (rank r = 16, batch size as 8, 3 total epochs) in Table 9, where RoLoRA significantly improve W4A4 quantized LLaMA2-7B performance with extremely low additional overhead.
Conclusion
40This paper presents RoLoRA, the first work to explore the feasibility of weight-activation quantization in LoRA.RoLoRA applies rotation for eliminating outliers in activation distribution and performs rotation-aware fine-tuning to preserve the outlier-free characteristics.We theoretically and empirically investigate how to integrate rotation into LoRA.RoLoRA improves the performance of W4A4 and W6A6 LLMs by a great margin across various tasks with the same training cost.Moreover, RoLoRA can also help visual instruction tuning.
Limitation
41In this work, we propose a rotation-based finetuning method that can effectively improve quantization robustness to low-bit weight-activation PTQ via retaining the outlier-free characteristics.The fine-tuning is conducted on NVIDIA H800 GPUs, while the recent NVIDIA Blackwell-architecture GPUs with 4-bit floating point support may further improve the efficiency.We will take the limitations into account and improve in future work., 6, 11, 16, 21, 26, 31.
Question:
42User: Explain the visual content of the image in great detail.(category: "detail") GPT-4 Response: The image displays three open pizza boxes with pizzas inside.The first pizza box, situated to the left, contains a smaller pizza.The second pizza box, positioned in the middle, features a larger pizza topped with tortilla chips.The third pizza box, located to the right, contains another smaller pizza.Beside the large pizza, there are two side orders of sauce in bowls, accompanying the delicious meal.The arrangement showcases a delicious spread of pizzas, inviting everyone to enjoy their different flavors and sizes.
Figure 1 :
43Figure 1: Activation distribution before and after rotation.The visualized input activations are selected from layers.1.self_attn.q_proj in LLaMA2-7B.
"Figure 2 :
44Figure 2: Overview of the proposed Rotated outlier-free LoRA (RoLoRA)
Figure 3 :Figure 4 :
45Figure 3: Two schemes for performing rotation-aware fine-tuning: (a) LAR and (b) LBR.
Figure 5 :
46Figure 5: Left: The training dynamics of the average Kurtosis of activations, Middle: The distribution of Kurtosis of activations across all layers in the final model after fine-tuning with LoRA and RoLoRA, Right: The accumulative quantization error of W4A4 GPTQ across all layers in the final model after fine-tuning with LoRA and RoLoRA.
Figure 6 :
47Figure 6: Average accuracy of W4A4 LLaMA2-7B finetuned with RoLoRA for varying ranks r.
Figure 7 :
48Figure 7: Final activation distribution of the fine-tuned model produced using RoLoRA and LoRA.We select the output activation of q_proj across layers with the index of 0, 1, 6, 11, 16, 21, 26, 31.
Table 2 :
49Comparison of the averaged accuracy on seven Zero-shot Common Sense Reasoning (ZCSR) tasks and MMLU benchmark across LLaMA series.The detailed accuracy for each tasks are listed in Table10 and Table 11.Avg.MMLU 4 Avg.ZCSR 7 Avg.MMLU 4 Avg.ZCSR 7 Avg.MMLU 4 Avg.
Table 3 :
50Comparison of the averaged accuracy of different Low-bit LoRA methods on Zero-shot Common Sense Reasoning tasks and MMLU benchmark on LLaMA2-7B.
Table 4 :
51Comparison of the W4A4 quantization performance on LLaVA-Bench of LLaVA-1.5-7B.
Table 5 :
52Compatibility of with DoRA on LLaMA2-7B.
Table 6 :
53Ablation on when to apply rotation.
Table 7 :
54Ablation on where to apply rotation.
Table 8 :
55Ablation on how to apply LoRA.#Bits-Quantizer Method ZCSR 7 Avg.MMLU 4 Avg.
Table 9 :
56The fine-tuning costs comparison on LLaMA2-7B with batch size as 8 on NVIDIA H800 80G GPUs.
Table 12 :
57Detailed hyper-parameters for fine-tuning different LLMs and LMMs.W q , W v W q , W v W q , W k , W v , W o , W u , W d , W g
58q , W v
참고문헌
참고문헌 정보가 없습니다.