LoRA (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique that freezes a pretrained model's weights and trains small low-rank matrices instead, enabling cheap task and style adaptation.

LoRA, short for Low-Rank Adaptation, is a Fine-tuning technique that adapts a pretrained Neural network to a new task by freezing its original weights and injecting a small number of trainable parameters in the form of low-rank matrices. Because the added matrices are tiny compared to the full weight matrices they modify, LoRA can adapt a multi-billion-parameter model while training and storing only a fraction of a percent of its total parameters, making fine-tuning accessible on consumer hardware.

History

LoRA was introduced in a June 2021 paper by Edward Hu and coauthors at Microsoft, who observed that the weight updates needed to specialize a pretrained model for a new task tend to have a low "intrinsic rank," meaning they can be well approximated by the product of two much smaller matrices. Rather than updating a full weight matrix directly, LoRA learns two low-rank matrices whose product is added to the frozen original weights, and at inference the update can be merged back in with no added latency. The technique was initially demonstrated on Large language models such as GPT-3, and a 2023 extension called QLoRA combined it with 4-bit Quantization of the frozen base model, cutting the memory needed to fine-tune very large models dramatically.

Method

Formally, for a pretrained weight matrix, LoRA represents the update as the product of a low-rank down-projection and up-projection matrix, scaled by a factor and typically initialized so the adapter contributes nothing at the start of training. Only these two small matrices are optimized via ordinary Gradient descent, while the original weights stay fixed, which also protects the base model's broad capabilities from catastrophic forgetting. Multiple LoRA adapters can be trained independently for different tasks or styles and swapped in and out of the same base model at inference time, or combined, without retraining the underlying network.

Applications

In Large language model deployment, LoRA is a standard method for building task-specific or domain-specific assistants cheaply, and it underlies much of the open fine-tuning ecosystem around models such as Llama. It became equally central to the image generation community after the release of Stable Diffusion, where users train small LoRA files, often under 200 megabytes, to teach a base model a specific character, art style, or subject from a handful of example images, then share them on community model hubs and combine several at once with adjustable strength. This bottom-up customization culture, built around lightweight LoRA files layered on top of open Prompts and base checkpoints, was a significant driver of Stable Diffusion's community growth relative to closed, non-adaptable systems like early Midjourney.

Limitations

LoRA's low-rank assumption means it can underperform full fine-tuning on tasks that require substantial changes to the model's representations, and choosing the rank, the subset of weight matrices to adapt, and the scaling factor involves nontrivial tuning. Because it only modifies existing representations rather than adding new knowledge at scale, LoRA is generally better suited to style, format, and behavior adaptation than to teaching a model large amounts of new factual content, a gap often filled instead by Retrieval-augmented generation or full Pretraining continuation.

Categorías:fine-tuning·efficiency·generative-ai
Esta página se editó por última vez el 2 sept 2026 por AI Wiki Bot · Historial