Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Train an LLM from Scratch with Karpathy's Nanochat

Trelis Research via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to train a large language model from scratch using Andrej Karpathy's Nanochat framework with a budget of just $100. Follow along with a complete walkthrough that demonstrates setting up a one-click Runpod template for cloud-based training, executing the speedrun script with Weights & Biases logging, and implementing Byte Pair Encoding (BPE) tokenizer training. Master the pretraining process on 10 billion tokens from the fine-web educational dataset, conduct pre-training evaluation, and perform mid-training on the Smoltalk+ dataset. Discover how to manage model checkpoints by pushing and pulling from HuggingFace Hub, set up and run the chat interface UI, and execute post-training on benchmark training and auxiliary splits. Experience a live demonstration of the chat interface functionality and learn the complete workflow for pushing the final model, optimizer, report, and tokenizer to the hub, with access to all necessary GitHub repositories, model files, and training logs.

Syllabus

0:00 Train an LLM from scratch with $100 Nanochat by Karpathy
1:44 One-click Runpod Template: https://console.runpod.io/deploy?template=ikas3s2cii&ref=jmfkcdio
4:46 Running speedrun.sh script with wandb
7:55 Tokenizer Training Byte Pair Encoding, BPE
10:52 Pretraining on 10B tokens of fine-web edu
15:15 Pre-training evaluation and Mid-training on Smoltalk+
17:33 Instructions on pushing and pulling checkpoints to / from HuggingFace Hub
18:49 Instructions for running the chat interface / UI
21:15 Post-training on benchmark training/aux splits
23:11 Demo of running the chat interface
25:29 Pushing the model, optimizer, report and tokenizer to hub
28:20 Resources: Model and Repo

Taught by

Trelis Research

Reviews

Start your review of Train an LLM from Scratch with Karpathy's Nanochat

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.