Trelis Research provides tutorials and scripts to accelerate the fine-tuning and deployment of AI Models (language, audio and vision). Video tutorials can be found here at Trelis Research and, for those interested in the scripts that accompany the videos, please reach out to Brent Fife or Chris Reddick to gain access.
As of the date of writing this, 6/17/2024, there are few in-depth, relatively-easy-to-understand resources that explain the inner workings of LLMs, how to train them, and data manipulation for the best results. Fortunately for you, Trelis provides a one-stop-shop for all our LLM needs. There will be a list of useful tutorials and the scripts that company them.
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Link |Name of Repository |Description |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Pushing Models and Adapters to HuggingFace | Free Notebook|
|0:00 How to push models to hugging face? 0:15 Video overview 1:00 LLM Notebook Setup 2:49 Runpod Fine-tuning Setup 4:39 Vast AI Fine-tuning Setup 5:45 Downloading and loading models 8:58 Push 16-bit models to hugging face 18:59 Merging and Pushing LoRA adapters to HuggingFace 29:30 Merging and Pushing QLora (quantised) models to HuggingFace 39:33 Best model format for training 40:49 Best model formats for inference 44:12 Free and advanced resources 44:42 How to get video/model updates|
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Full fine tuning vs (Q)LoRA |ADVANCED-fine-tuning |0:00 Comparing full fine-tuning and LoRA fine tuning |
| | | |
| | |1:57 Video Overview |
| | | |
| | | 3:53 Comparing VRAM, Training Time + Quality |
| | | |
| | | 8:42 How full fine-tuning works |
| | | |
| | | 9:03 How LoRA works |
| | | |
| | | 10:35 How QLoRA works |
| | | |
| | |12:45 How to choose learning rate, rank and alpha |
| | | |
| | | 20:13 Choosing hyper parameters for Mistral 7B fine-tuning |
| | | |
| | | 21:39 Specific tips for QLoRA, regularization and adapter merging. |
| | | |
| | | 26:16 Tips for using Unsloth |
| | | |
| | | 27:46 LoftQ - LoRA aware quantisation |
| | | |
| | | 30:39 Step by step TinyLlama QLoRA |
| | | |
| | | 47:05 Mistral 7B Fine-tuning Results Comparison 52:29 Wrap up |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Fine tuning Optimizations - DoRA, NEFT, LoRA+, Unsloth |ADVANCED-fine-tuning-chat-fine-tuning |0:00 Improving on LoRA |
| | | |
| | |0:30 Video Overview |
| | | |
| | |1:25 How does LoRA work? |
| | | |
| | | 4:26 Understanding DoRA |
| | | |
| | | 8:42 NEFT - Adding Noise to Embeddings |
| | | |
| | | 7:12 LoRA Plus |
| | | |
| | |9:34 Unsloth for fine-tuning speedups |
| | | |
| | | 11:27 Comparing LoRA+, Unsloth, DoRA, NEFT 13:02 Notebook Setup and LoRA |
| | | |
| | |23:17 DoRA Notebook Walk-through |
| | | |
| | | 25:40 NEFT Notebook Example |
| | | |
| | | 26:45 LoRA Plus |
| | | |
| | | 30:10 Unsloth |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Fine-tuning on Wikipedia Datasets |ADVANCED-fine-tuning-wikipedia |0:00 Fine-tuning Llama 3 for a low resource language |
| | | |
| | | 0:40 Overview of Wikipedia Dataset and Loss Curves |
| | | |
| | | 1:53 Video overview |
| | | |
| | | 3:07 HuggingFace Dataset creation with WikiExtractor |
| | | |
| | | 12:11 Llama 3 fine-tuning setup, incl. LoRA |
| | | |
| | | 24:38 Dataset blending to avoid catastrophic forgetting |
| | | |
| | | 28:16 Trainer setup and parameter selection |
| | | |
| | |34:40 Inspection of losses and results |
| | | |
| | | 36:43 Learning Rates and Annealing |
| | | |
| | | 42:27 Further tips and improvements |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Prepare Fine-tuning Datasets with Open Source LLMs |ADVANCED-fine-tuning-supervised-fine-tuning|0:00 Preparing data for fine-tuning |
| | | |
| | |0:37 Video overview |
| | | |
| | |1:04 Accessing the GitHub Repo w/ data preparation scripts 2:42 Q&A Dataset preparation using Llama 2 70B and chat-ui |
| | | |
| | | 7:29 How to set up a Llama 2 API for 70B |
| | | |
| | |8:45 Using a Llama 2 API to prepare a Q&A dataset for fine-tuning |
| | | |
| | | 12:22 Pro tips for preparing fine-tuning datasets |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Fine tuning LLMs for Memorization |ADVANCED-fine-tuning-memorization |0:00 Fine-tuning on a custom dataset |
| | | |
| | |0:18 Video Overview |
| | | |
| | | 1:28 GPTs as statistical models 2:07 What is the reversal curse? |
| | | |
| | | 4:08 Synthetic dataset generation |
| | | |
| | | 8:28 Choosing the best batch size |
| | | |
| | |14:17 What learning rate to use for fine-tuning? |
| | | |
| | | 14:50 How many epochs to train for? |
| | | |
| | |16:04 Choosing the right base model |
| | | |
| | | 17:12 Step by step dataset generation |
| | | |
| | | 28:20 Fine-tuning script, step-by-step |
| | | |
| | | 40:47 Performance Ablation: Hyperparameters 42:56 Performance Ablation: Base Models |
| | | |
| | | 46:00 Final Recommendations for Fine-tuning for Memorization |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+