Instructions to use 1112lee/kaggle with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 1112lee/kaggle with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2-medium") model = PeftModel.from_pretrained(base_model, "1112lee/kaggle") - Notebooks
- Google Colab
- Kaggle
Download working/peft/docs/source/package_reference/adalora.md from 1112lee/kaggle: direct link, hf CLI and curl.
- Browser
- Download file 2.77 kB
-
https://huggingface.co/1112lee/kaggle/resolve/main/working/peft/docs/source/package_reference/adalora.md
- Command line
-
hf download hf://1112lee/kaggle/working/peft/docs/source/package_reference/adalora.md
-
curl -L -o adalora.md https://huggingface.co/1112lee/kaggle/resolve/main/working/peft/docs/source/package_reference/adalora.md
AdaLoRA
AdaLoRA is a method for optimizing the number of trainable parameters to assign to weight matrices and layers, unlike LoRA, which distributes parameters evenly across all modules. More parameters are budgeted for important weight matrices and layers while less important ones receive fewer parameters.
The abstract from the paper is:
Fine-tuning large pre-trained language models on downstream tasks has become an important paradigm in NLP. However, common practice fine-tunes all of the parameters in a pre-trained model, which becomes prohibitive when a large number of downstream tasks are present. Therefore, many fine-tuning methods are proposed to learn incremental updates of pre-trained weights in a parameter efficient way, e.g., low-rank increments. These methods often evenly distribute the budget of incremental updates across all pre-trained weight matrices, and overlook the varying importance of different weight parameters. As a consequence, the fine-tuning performance is suboptimal. To bridge this gap, we propose AdaLoRA, which adaptively allocates the parameter budget among weight matrices according to their importance score. In particular, AdaLoRA parameterizes the incremental updates in the form of singular value decomposition. Such a novel approach allows us to effectively prune the singular values of unimportant updates, which is essentially to reduce their parameter budget but circumvent intensive exact SVD computations. We conduct extensive experiments with several pre-trained models on natural language processing, question answering, and natural language generation to validate the effectiveness of AdaLoRA. Results demonstrate that AdaLoRA manifests notable improvement over baselines, especially in the low budget settings. Our code is publicly available at https://github.com/QingruZhang/AdaLoRA.
AdaLoraConfig
[[autodoc]] tuners.adalora.config.AdaLoraConfig
AdaLoraModel
[[autodoc]] tuners.adalora.model.AdaLoraModel