Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Outlier-weighed Layerwise Sampling for LLM Fine-tuning

About

The rapid advancements in Large Language Models (LLMs) have revolutionized various natural language processing tasks. However, the substantial size of LLMs presents significant challenges in training or fine-tuning. While parameter-efficient approaches such as low-rank adaptation (LoRA) have gained popularity, they often compromise performance compared to full-rank fine-tuning. In this paper, we propose Outlier-weighed Layerwise Sampling (OWS), a new memory-efficient fine-tuning approach, inspired by the layerwise outlier distribution of LLMs. Unlike LoRA, which adds extra adapters to all layers, OWS strategically assigns higher sampling probabilities to layers with more outliers, selectively sampling only a few layers and fine-tuning their pre-trained weights. To further increase the number of fine-tuned layers without a proportional rise in memory costs, we incorporate gradient low-rank projection, further boosting the approach's performance. Our extensive experiments across various architectures, including LLaMa2 and Mistral, demonstrate that OWS consistently outperforms baseline approaches, including full fine-tuning. Specifically, it achieves up to a 1.1% average accuracy gain on the Commonsense Reasoning benchmark, a 3.0% improvement on MMLU, and a notable 10% boost on MT-Bench, while being more memory efficient. OWS allows us to fine-tune 7B LLMs with only 21GB of memory. Our code is available at https://github.com/pixeli99/OWS.

Pengxiang Li, Lu Yin, Xiaowei Gao, Shiwei Liu• 2024

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K (test)
Accuracy83.7
797
Multi-turn Dialogue EvaluationMT-Bench
Overall Score6.52
331
Commonsense ReasoningCommon Sense Reasoning Tasks
Avg Score67.5
241
Language UnderstandingMMLU
Humanities Avg49.8
33
Instruction FollowingMT-Bench (test)
Overall Score6.52
27
Showing 5 of 5 rows

Other info

Code

Follow for update