Fine-tune massive language models by ignoring most of the weights
loralib lets you specialize billion-parameter PyTorch models by training tiny low-rank matrices instead of touching the frozen base weights.

What it does
loralib is Microsoft’s reference implementation of LoRA for PyTorch. It freezes a pretrained model’s original weights and learns small low-rank matrices that adapt the model to specific tasks. The result is a tiny checkpoint—often a few megabytes—that can specialize a multi-billion-parameter model without adding inference latency. The repo ships with examples for GPT-2, RoBERTa, and DeBERTa, along with downloadable LoRA checkpoints for GLUE and generation benchmarks.
The interesting bit
The cheeky part is that LoRA often outperforms full fine-tuning despite touching almost none of the base model. On GLUE, their DeBERTa XXL and RoBERTa adapters not only slashed trainable parameters from billions to single-digit millions, but occasionally edged out the fully fine-tuned baselines. For deployment, this means you can keep one frozen foundation model in memory and swap tiny LoRA checkpoints to switch tasks on the fly.
Key highlights
- Freezes original pretrained weights; only low-rank adaptation matrices are trained
- No added inference latency
- DeBERTa XXL drops from 1.5B trainable parameters to 4.7M while matching or beating full fine-tune scores on GLUE
- GPT-2 Medium and Large adapters weigh only 1.5 MB and 2.3 MB respectively
- Supports
nn.Linear,nn.Embedding,nn.Conv2d, and merged attention projections viaMergedLinear
Caveats
- PyTorch only; no TensorFlow or JAX support is mentioned
- You still need the original pretrained checkpoint from Hugging Face to use the LoRA checkpoints
- The authors note they did not thoroughly study the effect of training bias vectors alongside LoRA
Verdict
Worth a look if you’re fine-tuning large PyTorch Transformers and want to stop hoarding full model copies for every task. Those already using Hugging Face’s PEFT library, which added LoRA support in early 2023, may not need this standalone package.
Frequently asked
- What is microsoft/LoRA?
- loralib lets you specialize billion-parameter PyTorch models by training tiny low-rank matrices instead of touching the frozen base weights.
- Is LoRA open source?
- Yes — microsoft/LoRA is open source, released under the MIT license.
- What language is LoRA written in?
- microsoft/LoRA is primarily written in Python.
- How popular is LoRA?
- microsoft/LoRA has 13.7k stars on GitHub.
- Where can I find LoRA?
- microsoft/LoRA is on GitHub at https://github.com/microsoft/LoRA.