KD-LoRA: A Hybrid Approach to Efficient Fine-Tuning with LoRA and Knowledge Distillation

Rambod Azimi, Rishav Rishav, Marek Teichmann, Samira Ebrahimi Kahou
10/28/2024
cs.CLcs.AIcs.LG

Official code: rambodazimi/KD-LoRA (24 stars, MIT, last commit 2024-11-03).

Abstract

Large language models (LLMs) have demonstrated remarkable performance across various downstream tasks. However, the high computational and memory requirements of LLMs are a major bottleneck. To address this, parameter-efficient fine-tuning (PEFT) methods such as low-rank adaptation (LoRA) have been proposed to reduce computational costs while ensuring minimal loss in performance. Additionally, knowledge distillation (KD) has been a popular choice for obtaining compact student models from teacher models. In this work, we present KD-LoRA, a novel fine-tuning method that combines LoRA with KD. Our results demonstrate that KD-LoRA achieves performance comparable to full fine-tuning (FFT) and LoRA while significantly reducing resource requirements. Specifically, KD-LoRA retains 98% of LoRA's performance on the GLUE benchmark, while being 40% more compact. Additionally, KD-LoRA reduces GPU memory usage by 30% compared to LoRA, while decreasing inference time by 30% compared to both FFT and LoRA. We evaluate KD-LoRA across three encoder-only models: BERT, RoBERTa, and DeBERTaV3. Code is available at https://github.com/rambodazimi/KD-LoRA.

View on arXivView PDF

Code Implementations(1)

MIT

KD-LoRA: A Hybrid Approach to Efficient Fine-Tuning with LoRA and Knowledge Distillation

241PythonOct 28, 20241 years agoMIT
deep-learningenlsplarge-language-modelsllmml+3 more

Similar Papers

Cite this paper

@article{azimi2024kdlora,
  title  = {KD-LoRA: A Hybrid Approach to Efficient Fine-Tuning with LoRA and Knowledge Distillation},
  author = {Rambod Azimi and Rishav Rishav and Marek Teichmann and Samira Ebrahimi Kahou},
  year   = {2024},
  eprint = {2410.20777},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.20777v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.20777.svg)](https://codeofpaper.com/paper/2410.20777)

Discussion