Fine-tune a large language model on your own dataset using a fraction of the compute that full retraining would require.
Train separate LoRA adapters for multiple tasks and swap them onto the same base model at inference time with no speed penalty.
Integrate LoRA layers into an existing PyTorch model to add parameter-efficient fine-tuning capability.
Requires PyTorch and transformer model familiarity, most practitioners now use the Hugging Face PEFT library instead of this original research repo.
LoRA (Low-Rank Adaptation) is a technique for adapting large pre-trained AI language models to specific tasks without retraining the entire model. Training a large language model from scratch or fully retraining it for a new task requires enormous computing resources and produces a large set of updated weights that must be stored separately for each task. LoRA solves this by freezing the original model weights and inserting small trainable components that learn the task-specific adjustments. These added components are much smaller than the original model, so they are faster to train and cheaper to store. The practical benefit is that you can adapt the same base model to many different tasks by training and keeping only a small set of LoRA weights for each task, then swapping them in at inference time. This does not slow down the model when it is running (no inference latency is added), which is an advantage over some other adaptation approaches. The repository contains a Python package called loralib that implements the LoRA layers, along with examples showing how to integrate it into existing models built with PyTorch, including popular models available through Hugging Face. The paper accompanying this code showed results matching or exceeding full fine-tuning on standard language benchmarks while training fewer than one percent of the parameters that full fine-tuning would require. Note that this is the original research repository from Microsoft. The technique has since been incorporated into the Hugging Face PEFT (Parameter-Efficient Fine-Tuning) library, which is where most practitioners now access it. Only PyTorch is supported in this repository.
← microsoft on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.