Parameter-Efficient Fine-Tuning of BERT: A Study of Fixed-Rank and Layer-Wise LoRA on SST-2
Abstract
Parameter-efficient fine-tuning (PEFT) has emerged as a crucial method for adapting pretrained Transformer models to downstream tasks without the need to fine-tune the full set of model parameters. Low-Rank Adaptation (LoRA) is a technique that reduces the number of trainable parameters by representing weight updates with low-rank matrices. This paper explores the impact of LoRA rank selection and layer-wise rank allocation on the trade-off between classification accuracy and the number of parameters to be fine-tuned through fine-tuning BERT-base-uncased on the sentiment classification task, SST-2. The three fixed-rank LoRA settings with ranks of 4, 8, and 16 are first investigated, as well as a manually-designed layer-wise LoRA setting that assigns different ranks to different subsets of BERT layers. In the fixed-rank experiments, increasing the rank is beneficial to the validation accuracy, but the magnitude of the improvement seems to diminish with the number of trainable parameters. The layer-wise setup is able to attain 92.20% validation accuracy with 345,602 trainable parameters. It decreases the number of trainable parameters by approximately 41.6% and improves the validation accuracy by 0.57 percentage point, compared with LoRA at r = 16. It also can achieves performance close to full fine-tuning with 109,483,778 trainable parameters and 92.32% accuracy. The results indicate that with a non-uniform rank allocation it is possible to achieve an effective compromise between the efficiency of the parameters and the goodness of the downstream classification.
References
- Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., & Polosukhin, I. (2017). Attention is all you need.Advances in Neural Information Processing Systems, 30, 5998–6008.
- Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of deep bidirectional Transformers for language understanding.Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 1, 4171–4186.
- Houlsby, N., Giurgiu, A., Jastrzebski, S., Morrone, B., De Laroussilhe, Q., Gesmundo, A., Attariyan, M., & Gelly, S. (2019). Parameter-efficient transfer learning for NLP.Proceedings of the 36th International Conference on Machine Learning, 97, 2790–2799.
- Li, X. L., & Liang, P. (2021). Prefix-tuning: Optimizing continuous prompts for generation.Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, 1, 4582–4597.
- Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2022). LoRA: Low-rank adaptation of large language models.International Conference on Learning Representations.
- Valipour, M., Rezagholizadeh, M., Kobyzev, I., & Ghodsi, A. (2023). DyLoRA: Parameter-efficient tuning of pre-trained models using dynamic search-free low-rank adaptation.Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics, 3274–3287.
- Zhang, Q., Chen, M., Bukharin, A., He, P., Cheng, Y., Chen, W., & Zhao, T. (2023). Adaptive budget allocation for parameter-efficient fine-tuning.International Conference on Learning Representations.
- Dettmers, T., Pagnoni, A., Holtzman, A., & Zettlemoyer, L. (2023). QLoRA: Efficient finetuning of quantized LLMs.Advances in Neural Information Processing Systems, 36, 10088–10115.
- Liu, S. Y., Wang, C. Y., Yin, H., Molchanov, P., Wang, Y. C. F., Cheng, K. T., & Chen, M. H. (2024). DoRA: Weight-decomposed low-rank adaptation.Proceedings of the 41st International Conference on Machine Learning, 235, 32100–32121.
- Xu, Y., Xie, L., Gu, X., Chen, X., Chang, H., Zhang, H., Chen, Z., Zhang, X., & Tian, Q. (2024). QA-LoRA: Quantization-aware low-rank adaptation of large language models.International Conference on Learning Representations.
- Kopiczko, D. J., Blankevoort, T., & Asano, Y. M. (2024). VeRA: Vector-based random matrix adaptation.International Conference on Learning Representations.
- Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., & Bowman, S. R. (2018). GLUE: A multi-task benchmark and analysis platform for natural language understanding.Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 353-355.
- Socher, R., Perelygin, A., Wu, J., Chuang, J., Manning, C. D., Ng, A., & Potts, C. (2013). Recursive deep models for semantic compositionality over a sentiment treebank.Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, 1631-1642.