# LoRA

EN: **Low-rank adaptation** · id `lora`

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Trenowanie i dostrajanie](https://aiatlasgraph.com/t/training.md) › [Efektywne dostrajanie](https://aiatlasgraph.com/t/peft.md) › LoRA

## Description

- PL: Dostrajanie z użyciem adapterów o niskim rzędzie. Technika stosowana m.in. do modeli języka i obrazu.
- EN: Fine-tuning with low-rank adapters. Used for language and image models alike.

## In one sentence

- PL: To dostrajanie modelu przez mały zestaw zmian dodawanych do jego dużych tabel ustawień.
- EN: This adapts a model using small updates added to its large parameter matrices.

## Problem it solves

- PL: Pełne dostrajanie dużych tabel modelu zużywa zbyt dużo pamięci i wymaga przechowywania dużych zmian.
- EN: Adapting full parameter matrices uses too much memory and requires storing large updates.

## What it does

- PL: Zmianę dużej tabeli opisuje iloczyn mniejszych tabel, a trening uczy tylko ten zwarty zapis zamiast wszystkich oryginalnych ustawień.
- EN: The update to a large matrix is represented by smaller matrices, and training learns this compact update rather than all original parameters.

## Everyday example

- PL: Uczysz model pisać krótkie opisy sklepu i zapisujesz mały adapter, który można dołączyć do wspólnej wersji bazowej.
- EN: You teach a model to write brief shop descriptions and save a small adapter that attaches to the shared base version.

## This concerns you if you…

- PL: chcesz dostrajać model przy mniejszej pamięci
- PL: potrzebujesz małego pliku zmian dla zadania
- EN: want model adaptation with less memory
- EN: need a small task-specific update file

## Keywords

PEFT library · rank r · lora_alpha · target modules · merge adapter weights · low-rank decomposition

## How it works

- PL: Do zamrożonej macierzy wag dodaje się skalowany iloczyn dwóch mniejszych macierzy. Trening aktualizuje wyłącznie te czynniki, a ich iloczyn można później scalić z wagą bazową lub stosować jako osobną poprawkę.
- EN: A scaled product of two smaller matrices is added to a frozen weight matrix. Training updates only these factors, whose product can later merge into base weights or remain a separate adjustment.

## Limits

- PL: Niski rząd ogranicza klasę dostępnych aktualizacji, a wybór warstw wpływa na jakość. Nadal potrzebna jest pamięć aktywacji; adapter musi pasować do użytej bazy i jej przekształceń.
- EN: Low rank restricts available updates, while layer selection affects quality. Activation memory is still needed; adapters must match the base and its transformations.

## Key terms

- PL: **rząd aktualizacji**: Liczba niezależnych kierunków reprezentowanych przez macierz zmiany wag.
- PL: **czynniki macierzowe**: Mniejsze macierze, których iloczyn tworzy aktualizację wagi.
- EN: **update rank**: The number of independent directions represented by a weight-change matrix.
- EN: **matrix factors**: Smaller matrices whose product forms a weight update.

## Know first

- [Algebra liniowa: wektory i macierze (Linear algebra: vectors and matrices)](https://aiatlasgraph.com/t/linearalgebra.md)
- [Propagacja wsteczna (backpropagation) (Backpropagation)](https://aiatlasgraph.com/t/backprop.md)

## Examples

- PL: Nie jest synonimem całego fine-tuningu. W sesji użytkownik opisał wcześniejszą praktykę przy obrazie.
- EN: Not a synonym for fine-tuning as a whole. In this session the user described earlier practice on images.

## Subtopics (2 direct, 2 in total)

- [QLoRA (Quantized low-rank adaptation (QLoRA))](https://aiatlasgraph.com/t/qlora.md): LoRA on top of a base model stored in 4 bits. Cuts the GPU memory needed for fine-tuning.
- [Warianty LoRA (DoRA, LoRA+, AdaLoRA) (LoRA variants)](https://aiatlasgraph.com/t/loravariants.md): Refinements of basic LoRA: separating weight magnitude and direction, different learning rates for the two adapter matrices, adaptive rank allocation. They aim to close the gap to full fine-tuning.

## Related topics

Untyped, symmetric "see also" links.

- [Dostrajanie przez interwencje w reprezentacje (Fine-tuning through representation interventions)](https://aiatlasgraph.com/t/reft.md)
- [Generowanie obrazu i wideo (Image and video generation)](https://aiatlasgraph.com/t/imagegen.md)
- [Katastrofalne zapominanie i jego ograniczanie (Catastrophic forgetting and its mitigation)](https://aiatlasgraph.com/t/forgetting.md)
- [Personalizacja: nauczenie modelu konkretnej osoby, rzeczy lub stylu (Personalisation: teaching a model a specific subject or style)](https://aiatlasgraph.com/t/subjectpersonalization.md)
- [Serwowanie wielu adapterów LoRA na jednym modelu (Multi-LoRA serving)](https://aiatlasgraph.com/t/multilora.md)

## Sources

- [Hugging Face · LoRA (PEFT)](<https://huggingface.co/docs/peft/main/en/conceptual_guides/lora>) `peft` · reference: Adaptery LoRA, także zastosowania do modeli obrazu.

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/lora · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
