Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
YouTube Security VideosAndroid Police: Samsung is smashing records! #shorts #tech #phones(21.09.2026 um 13:55 Uhr)
YouTube Security Videosheise & c't: Bundesnetzagentur wollte diesen Futterautomaten verbieten(21.09.2026 um 13:53 Uhr)
YouTube Security VideosNeil Patel: Your Google Traffic Isn't An Asset It's A Loan #shorts(21.09.2026 um 14:05 Uhr)
Windows Tipps & SecurityF-14 A Tomcat Top Gun endlich als Revell Klemmbausteinmodell erhältlich(21.09.2026 um 14:27 Uhr)
Sichere ProgrammierungShow the Hand-Back Sample Before Approving an Agent Score(21.09.2026 um 14:15 Uhr)
Sichere ProgrammierungHybrid retrieval in one Postgres query: RRF over tsvector + pgvector(21.09.2026 um 14:15 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Why LoRA? Understanding the representative PEFT

Why LoRA? Low-Rank Adaptation (LoRA) has revolutionized the way we approach Large Language Models (LLMs). As the most prominent Parameter-Efficient Fine-Tuning (PEFT) method, LoRA allows developers to adapt massive models like Llama 3 or…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Why LoRA?



Low-Rank Adaptation (LoRA) has revolutionized the way we approach Large Language Models (LLMs). As the most prominent Parameter-Efficient Fine-Tuning (PEFT) method, LoRA allows developers to adapt massive models like Llama 3 or GPT-4 to specific tasks without needing a cluster of H100 GPUs.



But how exactly does it work, and why is it so effective? In this post, we’ll dive into the mathematical intuition behind LoRA, the concept of "intrinsic dimension," and why this method is a game-changer for AI engineers.









The Problem: The Cost of Scale



When it comes to traditional statistical models—like simple or generalized linear models, Tree model series (Random Forest, Light GBM, etc)—, we can train our mod



els from scratch using only their blueprints and architectures. Historically, this was the standard approach and was not particularly difficult or cumbersome.



However, the Deep Learning revolution changed the landscape. As model sizes ballooned from millions to billions of parameters, retraining or even fine-tuning a model became logistically impossible for most individuals and even many companies.



Growth of Model Parameter






The Hypothesis of Intrinsic Dimension



Here is the crucial insight: We don't need to train all the parameters.



Research suggests that over-parameterized models reside on a low intrinsic dimension. Simply put, while a model might have billions of parameters, the "knowledge" required to solve a specific new task can be represented by a much smaller subset of variables.



This premise was validated before LoRA's invention by researchers like Li et al. (2018) and Aghajanyan et al. (2020), who showed that learning happens in a lower-dimensional subspace. LoRA operationalizes this theory.









What is LoRA? The Mechanics



So what exactly is LoRA?



The concept is remarkably straightforward. As mentioned, LoRA is a fine-tuning method that trains the model using only a fraction of the total parameters.



Concept of LoRA






The Mathematical Formulation



Let’s look at the linear algebra. Suppose we have a pre-trained weight matrix


W0∈Rd×k\mathbf{W}_0 \in \mathbb{R}^{d \times k} W0Rd×k

.



In full fine-tuning, we update the weights by learning a cumulative gradient update

ΔW\Delta \mathbf{W}ΔW

:

h=(W0+ΔW)x\mathit{h} = (\mathbf{W}_0 + \Delta \mathbf{W})\mathit{x}h=(W0+ΔW)x



LoRA constrains this update

ΔW\Delta \mathbf{W}ΔW

by representing it as the product of two smaller matrices,

B\mathbf{B}B

and

A\mathbf{A}A

, with a low rank

rrr

:



Where:






  • B∈Rd×r\mathbf{B} \in \mathbb{R}^{d \times r}BRd×r




  • A∈Rr×k\mathbf{A} \in \mathbb{R}^{r \times k}ARr×k




  • r≪min⁡(d,k)r \ll \min(d, k)rmin(d,k)

    (The rank, usually set between 8 and 64)




All you need to do is to train A and B matrices. Then what are the A and B matrices?







Initialization Strategy



To ensure the training starts exactly where the pre-trained model left off (i.e.,

ΔW\Delta \mathbf{W}ΔW

is zero at the beginning), we initialize:




  • Matrix A: Random Gaussian distribution

    N(0,σ2)\mathcal{N}(0, \sigma^2)N(0,σ2)


  • Matrix B: Zeros




Therefore,

BA=0\mathbf{B}\mathbf{A} = 0BA=0

initially, ensuring no destabilizing noise is added to the model at step zero.





The Scaling Factor

α\alphaα




One detail often missed is the scaling factor

α\alphaα

. The update is actually scaled as:





ΔW=αr(BA)
\Delta \mathbf{W} = \frac{\alpha}{r} (\mathbf{B}\mathbf{A})
ΔW=rα(BA)




This allows us to tune the learning rate effectively regardless of the rank

rrr

we choose.



Then, the problem is.. is it accurate enough?



The answer is ‘yes’. And even more accurate.









Why is LoRA Effective?



Let’s talk numbers. Assume

d=10,000d=10,000d=10,000

and

k=10,000k=10,000k=10,000

with a rank

r=16r=16r=16

.




  • Full Fine-Tuning:

    10,000×10,000=100,000,00010,000 \times 10,000 = 100,000,00010,000×10,000=100,000,000

    parameters.


  • LoRA:

    (10,000×16)+(16×10,000)=320,000(10,000 \times 16) + (16 \times 10,000) = 320,000(10,000×16)+(16×10,000)=320,000

    parameters.




That is a 99.68% reduction in trainable parameters. But is it accurate?






Performance vs. Efficiency



Yes, it is surprisingly accurate.





As shown in the original LoRA paper, on benchmarks like WikiSQL, LoRA performs neck-and-neck with full fine-tuning. In some cases, it even outperforms the baseline because it acts as a form of regularization, preventing the model from overfitting to the small training set.



Then why? It might seem counterintuitive that tuning less than 0.01% of the parameters is sufficient. In reality, it is.



For those with a background in statistics, they can feel a bit familiar with this concept. There is a very famous and conventional method of decreasing dimension: PCA (Principal Component Analysis).






The Intuition: PCA Analogy





Imagine a dataset containing "Biological Species" and "Number of Legs." These two features are highly correlated; knowing the species often tells you the leg count. You don't need two independent dimensions to represent this variance.



There are a few more dimensionality reduction methods like clustering.





Anyway, the important thing is that the concept—reducing the dimension can improve not only training efficiency but performance— is valid.



Similarly, in deep neural networks, weight updates often occur in a subspace with high correlations. We can project these high-dimensional updates into a lower-rank space without losing significant information.



And LoRA takes advantage of this concept and it maximizes this effect. It doesn’t have any specific mathematic formula like PCA. It just creates random subspace matrices and trains them.





According to the authors, the subspaces of LLM parameters are more similar than previously thought. As you see in the image, the first dimension shares very similar subspaces with all of other dimensions. Therefore, they said only one rank worked quite well for fine-tuning GPT-3 model.






Mitigating Catastrophic Forgetting



A unique advantage of LoRA is that it freezes the original weights (

W0\mathbf{W}_0W0

).




  • Full Fine-Tuning: Overwrites

    W0\mathbf{W}_0W0

    . If you train heavily on coding tasks, the model might "forget" how to write poetry (Catastrophic Forgetting).


  • LoRA: Keeps

    W0\mathbf{W}_0W0

    intact. You can train one adapter for Coding and another for Poetry. You can simply swap the adapters at runtime without reloading the base model.










Conclusion



LoRA has become an indispensable tool in the AI toolkit. Today, most individuals—and even many companies—lack the resources to perform full fine-tuning on models with billions of parameters. Even with access to H100 or A100 GPUs, full fine-tuning is often prohibitively slow and, as demonstrated, rarely provides a better return on investment.



Furthermore, in generic models, an individual query effectively activates only a small portion of the parameters. This is a concept that has been further expanded upon in another famous method, Mixture of Experts (MoE), which I will cover in a future post.



You can leverage LoRA very easily because the libraries these days are so convenient such as peft or trl. Just try it. Then you will see that fine-tuning about 10 billions models takes about 3-6 hours with one H100. And the output files are only hundreds Megabytes. (Of course, you have to merge them with original model when you serve it.)









Reference



Chunyuan Li, Heerad Farkhoor, Rosanne Liu, and Jason Yosinski. Measuring the Intrinsic Di mension of Objective Landscapes. arXiv:1804.08838 [cs, stat], April 2018a. URL http: //arxiv.org/abs/1804.08838. arXiv: 1804.08838.



Armen Aghajanyan, Luke Zettlemoyer, and Sonal Gupta. Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning. arXiv:2012.13255 [cs], December 2020. URL http://arxiv.org/abs/2012.13255.



Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., & Chen, W. (2021, June 17). LORA: Low-Rank adaptation of Large Language Models. arXiv.org. https://arxiv.org/abs/2106.09685

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Why LoRA? Understanding the representative PEFT

Thematisch verwandte Begriffe: LoRA, Understanding, representative, PEFT · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94097 | A vulnerability was determined in Netcore NBR200V2 1.3.241127.071246. Th…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick