arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.05223cs.LGcs.AI
收藏

CorDA:面向上下文的大语言模型分解适配方法,用于任务感知的参数高效微调

CorDA: Context-Oriented Decomposition Adaptation of Large Language Models for Task-Aware Parameter-Efficient Fine-tuning

King Abdullah University of Science and Technology (KAUST)(阿卜杜拉国王科技大学);Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳));University of Sydney(悉尼大学)

Yibo Yang, Xiaojie Li, Zhongzhu Zhou, Shuaiwen Leon Song, Jianlong Wu, Liqiang Nie, Bernard Ghanem

AI总结:

本文提出CorDA方法,通过以下游任务或世界知识上下文为导向的权重分解构建任务感知适配器,在参数高效微调中缓解性能差距与灾难性遗忘,并在数学、代码和指令遵循任务上验证有效性。

摘要:

当前的参数高效微调(PEFT)方法所构建的适配器通常与下游任务要学习的上下文或需要维护的重要知识上下文无关。因此,与全参数微调相比,这些方法往往存在性能差距,同时微调后的模型还会遭受预训练世界知识的灾难性遗忘。在本文中,我们提出了 CorDA,一种面向上下文的分解适配方法,它通过以下游任务或需要维护的世界知识上下文为导向进行权重分解,从而构建可学习的任务感知适配器。具体而言,我们收集少量数据样本,并利用这些样本对预训练大语言模型(LLM)的每个线性层乘以其输入激活的协方差矩阵,然后进行奇异值分解。将协方差矩阵的逆与分解后的分量相乘,以重建原始权重。通过这种方式,代表性样本的上下文通过决定分解方向而被捕获。我们的方法支持两种选择:知识保留适配和指令预览适配。对于前者,我们使用问答样本获得协方差矩阵,并使用具有最小 $r$ 个奇异值的分解分量来初始化可学习适配器,其余分量保持冻结,从而更好地保留世界知识。对于后者,我们使用微调任务中的指令数据(例如数学或编程)来定向分解,并训练与任务最相关的最大 $r$ 个分量以进行学习。我们在数学、代码和指令遵循任务上进行了大量实验。

英文摘要:

Current parameter-efficient fine-tuning (PEFT) methods build adapters widely agnostic of the context of downstream task to learn, or the context of important knowledge to maintain. As a result, there is often a performance gap compared to full-parameter fine-tuning, and meanwhile the fine-tuned model suffers from catastrophic forgetting of the pre-trained world knowledge. In this paper, we propose CorDA, a Context-oriented Decomposition Adaptation method that builds learnable task-aware adapters from weight decomposition oriented by the context of downstream task or the world knowledge to maintain. Concretely, we collect a few data samples, and perform singular value decomposition for each linear layer of a pre-trained LLM multiplied by the covariance matrix of the input activation using these samples. The inverse of the covariance matrix is multiplied with the decomposed components to reconstruct the original weights. By doing so, the context of the representative samples is captured through deciding the factorizing orientation. Our method enables two options, the knowledge-preserved adaptation and the instruction-previewed adaptation. For the former, we use question-answering samples to obtain the covariance matrices, and use the decomposed components with the smallest $r$ singular values to initialize a learnable adapter, with the others frozen such that the world knowledge is better preserved. For the latter, we use the instruction data from the fine-tuning task, such as math or coding, to orientate the decomposition and train the largest $r$ components that most correspond to the task to learn. We conduct extensive experiments on Math, Code, and Instruction Following tasks.

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

↑