arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.12832cs.CLcs.AIcs.LG
收藏

LaMDA:基于谱分解低维适配的大模型微调

LaMDA: Large Model Fine-Tuning via Spectrally Decomposed Low-Dimensional Adaptation

University of Southern California(南加州大学);Intel Labs(英特尔实验室)

Seyedarmin Azizi, Souvik Kundu, Massoud Pedram

AI总结:

针对大语言模型微调中LoRA参数多、显存占用高的问题,提出基于谱分解的低维适配方法LaMDA及增强版LaMDA++,在性能持平或更优的前提下大幅降低参数更新量与GPU峰值内存。

摘要:

低秩适配(LoRA)因能大幅减少可训练参数,已成为大语言模型(LLM)微调的主流方法。但LoRA的可训练参数量随模型嵌入维度增大而增加,导致计算成本高昂;此外,其反向更新需要存储高维中间激活值与优化器状态,对GPU峰值内存要求很高。\n本文提出基于谱分解低维适配的大模型微调方法LaMDA,这是一种全新的大语言模型微调方案,借助低维适配实现可训练参数与GPU峰值内存占用的大幅降低。LaMDA冻结适配路径中的第一投影矩阵(PMA),同时引入一个低维可训练方阵,显著减少了可训练参数量与GPU峰值内存使用;在微调早期阶段逐步冻结第二投影矩阵(PMB),降低权重更新相关的计算成本,进一步提升参数效率。本文还提出增强版LaMDA++,通过对预训练模型权重进行归一化谱分析,为LoRA路径加入“轻量”自适应秩分配机制。\n研究在多种任务上评估了LaMDA与LaMDA++,涵盖基于GLUE基准的自然语言理解、文本摘要、自然语言生成,以及不同大语言模型上的复杂推理任务。结果表明,LaMDA的性能与现有替代方法相当或更优,同时微调期间的参数更新量最多减少17.7倍,GPU峰值内存占用最多降低1.32倍。代码将公开发布。

英文摘要:

Low-rank adaptation (LoRA) has become the default approach to fine-tune large language models (LLMs) due to its significant reduction in trainable parameters. However, trainable parameter demand for LoRA increases with increasing model embedding dimensions, leading to high compute costs. Additionally, its backward updates require storing high-dimensional intermediate activations and optimizer states, demanding high peak GPU memory. In this paper, we introduce large model fine-tuning via spectrally decomposed low-dimensional adaptation (LaMDA), a novel approach to fine-tuning large language models, which leverages low-dimensional adaptation to achieve significant reductions in trainable parameters and peak GPU memory footprint. LaMDA freezes a first projection matrix (PMA) in the adaptation path while introducing a low-dimensional trainable square matrix, resulting in substantial reductions in trainable parameters and peak GPU memory usage. LaMDA gradually freezes a second projection matrix (PMB) during the early fine-tuning stages, reducing the compute cost associated with weight updates to enhance parameter efficiency further. We also present an enhancement, LaMDA++, incorporating a ``lite-weight" adaptive rank allocation for the LoRA path via normalized spectrum analysis of pre-trained model weights. We evaluate LaMDA/LaMDA++ across various tasks, including natural language understanding with the GLUE benchmark, text summarization, natural language generation, and complex reasoning on different LLMs. Results show that LaMDA matches or surpasses the performance of existing alternatives while requiring up to 17.7x fewer parameter updates and up to 1.32x lower peak GPU memory usage during fine-tuning. Code will be publicly available.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑