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



