
How to finetune LLMs on custom data domains (CPT tutorial with Unsloth)
Keywords
Summary
160 words
Critical Evaluation
Value of the Information & Strength of the Argument
The video provides valuable practical insights into fine-tuning LLMs, emphasizing experimental methodology over mere code. The author clearly explains the reasoning behind each decision, such as choosing LoRA over full fine-tuning due to cost and stability, and using RS-LoRA to overcome scaling limitations. The argumentation is solid, grounded in hands-on experiments and standard ML principles (e.g., overfitting/underfitting). The author also highlights the importance of dataset quality and size, which is often overlooked. The tutorial is well-structured, with clear explanations of hyperparameters and evaluation metrics. However, some claims, like the superiority of RS-LoRA, are presented without deep theoretical backing, but the practical results support them. Overall, the value is high for practitioners seeking to apply CPT.
Scientific Rigor, Source Quality, Title Accuracy
The video demonstrates scientific rigor by following a systematic experimental approach: setting up an evaluation harness, using validation sets, early stopping, and comparing multiple configurations. The author cites relevant resources, including the Unsloth documentation, the SmolLM model on Hugging Face, and the project’s GitHub repository. The title accurately reflects the content, and the video stays on topic. The author also mentions Andrej Karpathy’s approach to auto research, which adds credibility. The sources are appropriate and directly related to the tutorial. No comments were provided for analysis.
216 words
Title / Content Match
The title accurately reflects the content: a tutorial on fine-tuning LLMs on custom data domains using CPT with Unsloth.
Quality & Reliability
8/10
The video provides a clear, practical tutorial on continued pre-training (CPT) with a focus on experimental methodology. The author demonstrates hands-on experience, explains key concepts (LoRA, RS-LoRA, packing/truncating, evaluation metrics) and shares reproducible code. The approach is transparent about limitations and trade-offs, and the claims are supported by practical results. However, the video is a tutorial rather than a peer-reviewed study, and some claims (e.g., about RS-LoRA) are presented without deep theoretical justification.
Key Moments
Markers derived by PSI from the transcript: the creator did not define chapters.
- Introduction to the series and goals of fine-tuning small models.
- Explanation of continued pre-training (CPT) and choice of SmolLM-135M.
- Dataset preparation: downloading arXiv papers and cleaning text.
- Discussion of hyperparameters: max length, batch size, learning rate, gradient accumulation.
- Packing vs. truncating sequences for training.
- Comparison of full fine-tuning vs. LoRA, and introduction of evaluation metrics.
- Experimental results: overfitting with small datasets, increasing dataset size, and cleaning data.
- Introduction of RS-LoRA and its benefits for scaling rank.
- Final experiments and conclusion, with references to resources.
Cited Sources
- GitHub repository for finetuning recipes — The author's repository containing code and resources for the tutorial.
- SmolLM-135M on Hugging Face — The base model used for CPT experiments.
- Unsloth datasets guide — Documentation on dataset formats supported by Unsloth.
- Unsloth notebooks — Notebooks for fine-tuning with Unsloth.
- Course Video 1 (this video) — The current video on CPT.
- Low-level 'from scratch' Finetuning tutorial — A related tutorial on low-level fine-tuning.
- Course Video 2 (SFT) — Upcoming video on supervised fine-tuning.
- Course Video 3 (DPO) — Upcoming video on direct preference optimization.
Concurring Sources
- LoRA: Low-Rank Adaptation of Large Language Models — The original LoRA paper, which supports the author's use of LoRA for parameter-efficient fine-tuning.
- RS-LoRA: Rank-Stabilized LoRA — The paper introducing RS-LoRA, which the author uses to improve scaling.
Contribution & Novelties
The video offers a practical, hands-on guide to continued pre-training (CPT) for domain adaptation, emphasizing experimental methodology and dataset preparation. It provides a clear comparison between full fine-tuning and LoRA, and introduces RS-LoRA as a technique to improve scaling. The author shares his iterative process, including common pitfalls like overfitting and the importance of data cleaning. This is valuable for practitioners looking to fine-tune small models on custom data.
Pour aller plus loin :
- LoRA: Low-Rank Adaptation of Large Language Models — The original LoRA paper, foundational for understanding the technique.
- RS-LoRA: Rank-Stabilized LoRA — The paper introducing RS-LoRA, explaining the scaling issue and solution.
- Hugging Face documentation on fine-tuning — Official documentation on fine-tuning with Transformers.
- Unsloth documentation — Official Unsloth documentation for efficient fine-tuning.
- Andrej Karpathy’s tweet on auto research — The tweet referenced in the video about using coding agents for research.
145 words
Radar Profile
The radar profile shows high scores in information quantity, quality, and reliability, with a slightly lower technical level. This indicates a well-balanced tutorial that is both informative and trustworthy, though it may require some prior knowledge to fully grasp the technical details.