[Enterprise SLM from Scratch] Foundations thumbnail

[Enterprise SLM from Scratch] Foundations

SSreedath Panat
101 lessons42 topics41h 24mlive

About this course

An eight-session, hands-on engineering bootcamp that takes you from raw data to a deployed small language model. You build the whole pipeline yourself: data curation and tokenization, a transformer trained from scratch, fine-tuning with LoRA and QLoRA, preference tuning and guardrails, evaluation and retrieval, inference optimization, and on-prem deployment. Concept-first teaching with live builds, runnable notebooks, and a model you can actually ship.

Course curriculum

42 topics • 101 lessons

41h 24m
PLEASE NOTE: Course start date change [Starting July 2nd]2 items
  1. Date and timings
  2. A note from the instructor
Discord invite link for course members [NEW LINK]1 items
  1. New Invite link
Zoom link1 items
  1. Zoom link
Course introduction by Dr. Sreedath Panat2 items
  1. Introduction to SLM engineering bootcamp
  2. Some useful links
Setting up a good workflow using coding agents2 items
  1. This video was recorded separately to talk about using coding agents in research. However, I also strongly think the same workflow can be set up for pretty much anything.
  2. The second half of this document explains how my workflow looks with coding agents.
Can a 100M Parameter SLM Store 10GB of Knowledge? Intuition about tokens, storage & cost2 items
  1. Can a 100M Parameter SLM Store 10GB of Knowledge?
  2. Miro notes
Session 1- Introduction to SLM engineering and transformer basics3 items
  1. Session 1 lecture video
  2. Session 1 lecture slides
  3. Transformer visualizer
All about the transformer architecture [a very useful set of lectures]7 items
  1. The journey of a single token
  2. From RNNs to transformers
  3. Introduction to self attention
  4. Q, K, V intuition
  5. Understanding causal or masked attention
  6. Introduction to multi-head attention
  7. Implementing multi-head attention with tensors
All about the transformer architecture [miro notes]7 items
  1. Journey of a token
  2. From RNNs to transformers
  3. Simplified self attention
  4. Self attention with trainable weights
  5. Masked self attention
  6. Multi-head attention Part 1
  7. Multi-head attention Part 2
Assignment: Hand-calculate the number of parameters in GPT-32 items
  1. Watch this video first
  2. Submit your hand-calculation of GPT-3 trainable parametersassignment
Rotary position embedding (RoPE) in detail2 items
  1. RoPE - visual, geometric and mathematical intuition
  2. RoPE interactive website
An interactive platform to check if your GPU/device will be enough for this bootcamp1 items
  1. Interactive platform to check compute requirements
Session 2 - Data curation and tokenization5 items
  1. Session 2 lecture video
  2. Session 2 slides
  3. Cleaning a dataset corpus - interactive visualizer
  4. Visualizing tokenizer in detail
  5. Dataset links from HuggingFace
What does raw data look like? - a separate lecture video2 items
  1. Raw data - lecture video
  2. Raw data - slides
Data cleanup before training the SLM - a separate lecture video2 items
  1. Data cleaning
  2. Data cleaning - slide
Byte pair encoding in full detail - a separate lecture video2 items
  1. Lecture video
  2. Lecture slides - BPE in full detail
How exactly is BPE tokenizer trained? - a separate lecture video2 items
  1. Lecture video - BPE traning
  2. BPE training slides
How do we convert token IDs to vectors? - a separate lecture video2 items
  1. Lecture video - tokenizer to vectors
  2. Tokenizer to vectors - slides
How do you define "usable knowledge" in an LLM or SLM?1 items
  1. Usable knowledge
Prepare your pretraining data with tokenization2 items
  1. Directly copy paste this into an md file and share that with your coding agent
  2. A glimpse of what we do from raw data till tokenization
Sreedath's initial version of 125M parameter SLM1 items
  1. Deployed model, HF link and GitHub repo
Session 3 - Pretraining 125M parameter SLM from scratch2 items
  1. Session 3 lecture video
  2. LIVE trained SLM links
Session 4 - Fine tuning the SLM13 items
  1. Session 4 lecture video
  2. GitHub repo for model fine-tuning
  3. Sreedath's fine-tuned SLMs
  4. Types of fine-tuning
  5. How to build the fine-tuning dataset
  6. Quantization in detail
  7. Fine-tuning cost calculation
  8. Fine-tuning Gemma
  9. What is LoRA
  10. What is QLoRA?
  11. Finetuned and pretrained models - Huggingface deployment
  12. Instructions for fine-tuning used in the lecture
  13. Instructions for further training the SLM beyond your initial epochs
What is perplexity score? - a separate lecture video2 items
  1. Lecture video - perplexity score explained intuitively
  2. Interactive web app - perplexity score
Sampling techniques: How SLM picks the next token - a separate lecture video2 items
  1. SLM sampling - lecture video
  2. Interactive web app
Models trained and deployed by Sreedath: 125M, 518M and 2B2 items
  1. Please note: Use HF link instead of Modal link to access the model
  2. SLM comparison arena
LoRA for fine tuning in details1 items
  1. Lecture video
Session 5 - RLHF, RLAIF and DPO fine-tuning on SLM6 items
  1. Session 5 lecture video
  2. RLHF visually explained - interactive
  3. DPO interactive explainer
  4. Data curation for RLHF
  5. Data curation for DPO
  6. RLAIF training instructions.txt
Assignment 1 and 22 items
  1. Assignment 1: Pretraining + QA and RAFTassignment
  2. Assignment 2: RLAIF and DPOassignment
Intro to RLHF - separate lecture video1 items
  1. Intro to RLHF and RLAIF
Data preparation for RLHF and RLAIF - separate lecture video1 items
  1. Data preparation
Session 6 - RAG, RAFT and evals4 items
  1. Session 6 lecture video
  2. SLM arena with 21 models
  3. SLM evals
  4. SLM RAG
Session 7 - inference engineering5 items
  1. Session 7 lecture video
  2. KV cache interactive website
  3. Batching and paged attention interactive website
  4. Speculative decoding interactive website
  5. Sreedath's implementation of KV cache and speculative decoding comparison
Assignment 3 and 42 items
  1. Assignment 3: Fine-tune Gemma 2 2B, put a retriever behind it, and ship itassignment
  2. Assignment 4: Build the inference pipeline and measure what each trick is worthassignment
Prompt prefill and parallel decoding - A separate lecture video1 items
  1. Lecture video
KV cache and Grouped Query Attention (GQA) - A separate lecture video1 items
  1. Lecture video
Speculative decoding explained - A separate lecture video1 items
  1. Lecture video
Continuous batching and paged attention - a separate lecture video1 items
  1. Lecture video
Session 8 - Cloud and edge deployment2 items
  1. Lecture video
  2. Miro notes
All session transcripts and chats1 items
  1. All session transcripts and chats
LIVE coding an 12.3M parameter SLM from scratch - highly recommended lecture3 items
  1. Lecture video
  2. Colab notebook
  3. Miro notes
SLM engineering final capstone project2 items
  1. Take a look at this video first
  2. Here is the website link for you to submit your work