Flat-LoRA: Low-Rank Adaptation over a Flat Loss Landscape

Tao Li, Zhengbao He, Yujun Li, Yasheng Wang, Lifeng Shang +1 more
9/22/2024
cs.LG

Official code: nblt/Flat-LoRA (18 stars, last commit 2025-05-18).

Abstract

Fine-tuning large-scale pre-trained models is prohibitively expensive in terms of computation and memory costs. Low-Rank Adaptation (LoRA), a popular Parameter-Efficient Fine-Tuning (PEFT) method, offers an efficient solution by optimizing only low-rank matrices. Despite recent progress in improving LoRA's performance, the relationship between the LoRA optimization space and the full parameter space is often overlooked. A solution that appears flat in the loss landscape of the LoRA space may still exhibit sharp directions in the full parameter space, potentially compromising generalization. We introduce Flat-LoRA, which aims to identify a low-rank adaptation situated in a flat region of the full parameter space. Instead of adopting the well-established sharpness-aware minimization approach, which incurs significant computation and memory overheads, we employ a Bayesian expectation loss objective to preserve training efficiency. Further, we design a refined random perturbation generation strategy for improved performance and carefully manage memory overhead using random seeds. Experiments across diverse tasks-including mathematical reasoning, coding abilities, dialogue generation, instruction following, and text-to-image generation-demonstrate that Flat-LoRA improves both in-domain and out-of-domain generalization. Code is available at https://github.com/nblt/Flat-LoRA.

View on arXivView PDF

Code Implementations(1)

nblt/Flat-LoRAOfficial100%

[ICML 2025] Flat-LoRA: Low-Rank Adaptation over a Flat Loss Landscape

180PythonDec 4, 20241 years ago

Similar Papers

Cite this paper

@article{li2024flatlora,
  title  = {Flat-LoRA: Low-Rank Adaptation over a Flat Loss Landscape},
  author = {Tao Li and Zhengbao He and Yujun Li and Yasheng Wang and Lifeng Shang and Xiaolin Huang},
  year   = {2024},
  eprint = {2409.14396},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.14396v2},
  journal = {ICML 2024 2024}
}

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/2409.14396.svg)](https://codeofpaper.com/paper/2409.14396)

Discussion