

TODAY'S ISSUE
TODAY’S DAILY DOSE OF DATA SCIENCE
Fine-tuning LLMs​
Traditional fine-tuning (depicted below) is infeasible with LLMs because these models have billions of parameters and are hundreds of GBs in size, and not everyone has access to such computing infrastructure.

Thankfully, today, we have many optimal ways to fine-tune LLMs, and five such popular techniques are depicted below:

We covered them in detail here:
- ​Understanding LoRA-derived Techniques for Optimal LLM Fine-tuning​.
- ​Implementing LoRA From Scratch for Fine-tuning LLMs​.
- ​Implementing DoRA (an Improved LoRA) from Scratch​.
Here’s a brief explanation:
- LoRA: Add two low-rank matrices
A
andB
alongside weight matrices, which contain the trainable parameters. Instead of fine-tuningW
, adjust the updates in these low-rank matrices.

- LoRA-FA: While LoRA considerably decreases the total trainable parameters, it still requires substantial activation memory to update the low-rank weights. LoRA-FA (FA stands for Frozen-A) freezes the matrix
A
and only updates matrixB
.

- VeRA: In LoRA, every layer has a different pair of low-rank matrices
A
andB
, and both matrices are trained. In VeRA, however, matricesA
andB
are frozen, random, and shared across all model layers. VeRA focuses on learning small, layer-specific scaling vectors, denoted asb
andd
, which are the only trainable parameters in this setup.

- Delta-LoRA: Here, in addition to training low-rank matrices, the matrix
W
is also adjusted but not in the traditional way. Instead, the difference (or delta) between the product of the low-rank matricesA
andB
in two consecutive training steps is added toW
:

- LoRA+: In LoRA, both matrices
A
andB
are updated with the same learning rate. Authors found that setting a higher learning rate for matrixB
results in more optimal convergence.

To get into more detail about the precise steps, intuition, and results, read these articles:
- ​Understanding LoRA-derived Techniques for Optimal LLM Fine-tuning​.
- ​Implementing LoRA From Scratch for Fine-tuning LLMs​.
- ​Implementing DoRA (an Improved LoRA) from Scratch​.
That said, these are not the only LLM fine-tuning techniques. The following visual depicts a timeline of popular approaches:

👉 Over to you: What are some ways to reduce the computational complexity of fine-tuning LLMs?
Talking about efficient training...
MODEL TRAINING OPTIMIZATION
​Multi-GPU training (A Practical Guide)​​
If you look at job descriptions for Applied ML or ML engineer roles on LinkedIn, most of them demand skills like the ability to train models on large datasets:
Of course, this is not something new or emerging.
But the reason they explicitly mention “large datasets” is quite simple to understand.
Businesses have more data than ever before.
Traditional single-node model training just doesn’t work because one cannot wait months to train a model.
​​Distributed (or multi-GPU)​ training is one of the most essential ways to address this.
​​Here​, we covered the core technicalities behind multi-GPU training, how it works under the hood, and implementation details.
We also look at the key considerations for multi-GPU (or distributed) training, which, if not addressed appropriately, may lead to suboptimal performance or slow training.
THAT'S A WRAP
No-Fluff Industry ML resources to
Succeed in DS/ML roles

At the end of the day, all businesses care about impact. That’s it!
- Can you reduce costs?
- Drive revenue?
- Can you scale ML models?
- Predict trends before they happen?
We have discussed several other topics (with implementations) in the past that align with such topics.
Here are some of them:
- Learn sophisticated graph architectures and how to train them on graph data in this crash course.
- So many real-world NLP systems rely on pairwise context scoring. Learn scalable approaches here.
- Run large models on small devices using Quantization techniques.
- Learn how to generate prediction intervals or sets with strong statistical guarantees for increasing trust using Conformal Predictions.
- Learn how to identify causal relationships and answer business questions using causal inference in this crash course.
- Learn how to scale and implement ML model training in this practical guide.
- Learn 5 techniques with implementation to reliably test ML models in production.
- Learn how to build and implement privacy-first ML systems using Federated Learning.
- Learn 6 techniques with implementation to compress ML models.
All these resources will help you cultivate key skills that businesses and companies care about the most.
SPONSOR US
Advertise to 600k+ data professionals
Our newsletter puts your products and services directly in front of an audience that matters — thousands of leaders, senior data scientists, machine learning engineers, data analysts, etc., around the world.