Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【help】PEFT板块 LayerNorm Tuning原理讲解部分补齐 #18

Open
moyanxinxu opened this issue Jun 20, 2024 · 0 comments
Open

【help】PEFT板块 LayerNorm Tuning原理讲解部分补齐 #18

moyanxinxu opened this issue Jun 20, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@moyanxinxu
Copy link
Collaborator

LayerNorm Tuning (LN Tuning) is a PEFT method that only fine-tunes the parameters of the LayerNorm layers in a model. The paper has tested the performance of this method on large language models and has shown that it can achieve strong performance with a significant reduction in the number of trainable parameters and GPU memory usage. However, the method is not limited to language models and can be applied to any model that uses LayerNorm layers. In this implementation, the default is that all layernorm layers inside a model is finetuned, but it could be used to target other layer types such as MLP or Attention layers, this can be done by specifying the target_modules in the LNTuningConfig.

The abstract from the paper is:

This paper introduces an efficient strategy to transform Large Language Models (LLMs) into Multi-Modal Large Language Models (MLLMs). By conceptualizing this transformation as a domain adaptation process, i.e., transitioning from text understanding to embracing multiple modalities, we intriguingly note that, within each attention block, tuning LayerNorm suffices to yield strong performance. Moreover, when benchmarked against other tuning approaches like full parameter finetuning or LoRA, its benefits on efficiency are substantial. For example, when compared to LoRA on a 13B model scale, performance can be enhanced by an average of over 20% across five multi-modal tasks, and meanwhile, results in a significant reduction of trainable parameters by 41.9% and a decrease in GPU memory usage by 17.6%. On top of this LayerNorm strategy, we showcase that selectively tuning only with conversational data can improve efficiency further. Beyond these empirical outcomes, we provide a comprehensive analysis to explore the role of LayerNorm in adapting LLMs to the multi-modal domain and improving the expressive power of the model.

@moyanxinxu moyanxinxu added the help wanted Extra attention is needed label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant