Coding a ChatGPT Like Transformer From Scratch in PyTorch
15,954
Published 2024-06-30
NOTE: This StatQuest assumes that you are already familiar with the concepts behind...
Decoder-Only Transformers: • Decoder-Only Transformers, ChatGPTs s...
The Essential Matrix Algebra for Neural Networks: • Essential Matrix Algebra for Neural N...
The Matrix Math Behind Transformers: • The matrix math behind transformer ne...
You can get the code here: github.com/StatQuest/decoder_transformer_from_scra…
The full Neural Networks playlist, from the basics to AI, is here: • The Essential Main Ideas of Neural Ne...
Learn more about GiveInternet.org: giveinternet.org/StatQuest NOTE: Donations up to $30 will be matched by an Angel Investor - so a $30 donation would give $60 to the organization. DOUBLE BAM!!!
If you'd like to support StatQuest, please consider...
Patreon: www.patreon.com/statquest
...or...
YouTube Membership: youtube.com/channel/UCtYLUTtgS3k1Fg4y5tAhLbw/join
...buying my book, a study guide, a t-shirt or hoodie, or a song from the StatQuest store...
statquest.org/statquest-store/
...or just donating to StatQuest!
paypal: www.paypal.me/statquest
venmo: @JoshStarmer
Lastly, if you want to keep up with me as I research and create new StatQuests, follow me on twitter:
twitter.com/joshuastarmer
0:00 Awesome song and introduction
1:12 Loading the modules
2:04 Creating the training dataset
6:17 Coding Position Encoding
14:09 Coding Attention
21:04 Coding a Decoder-Only Transformer
26:39 Running the model (untrained)
29:18 Training and using the model
#StatQuest #PyTorch #chatgpt
All Comments (21)
-
- You can get the code here: github.com/StatQuest/decoder_transformer_from_scra… - Learn more about giveinternet.org/: giveinternet.org/StatQuest NOTE: Donations up to $30 will be matched by an Angel Investor - so a $30 donation would give $60 to the organization. DOUBLE BAM!!! - The full Neural Networks playlist, from the basics to AI, is here: https://www.youtube.com/watch?v=CqOfi41LfDw&list=PLblh5JKOoLUIxGDQs4LFFD--41Vzf-ME1 - Support StatQuest by buying my book The StatQuest Illustrated Guide to Machine Learning or a Study Guide or Merch!!! statquest.org/statquest-store/
-
Can't imagine the work that goes into this, writing the code, making diagrams, recording, editing and voice over, you're the goat big J.
-
You said this was going to come out at the end of May. And I’ve been waiting for this for 2 months. Finally, it’s out 😂
-
HUGE RESPECT for all the work you put into your videos
-
It is party time! Thanks for uploading!
-
Cool, learn a lot from all of your videos Josh! 🤯
-
Incredible video, Josh! Love your content. Can you please make a video on diffusion models?
-
Today we learned that statquest is awesome. triple BAM!
-
sir you deserved millions of views on your YouTube ❤❤🎉
-
as always, wonderful content. Thanks :)
-
Finally greatly watied video arrived. Thank you.
-
Thank you I was in need of this 😊
-
You will be rememberd for next 1000 years in the history of Statistics and Data Science , You should be named as "Father of Applied Statics & Machine Learning " , Pls thumbs up if you are with me
-
Great and very didactic as usual, Josh!! Definitely going to wrap my head around this for a while and try a few tweaks! Do you plan on eventually also discussing other non-NLP topics like GANs and Diffusion Models?
-
This will be awesome. I am trying to learn the math behind transformers and PyTorch so hopefully this helps give me some intuition
-
Thanks a lot for for this free wonderful content. ❤😊
-
I'm gonna enjoy this one!
-
Thank you! You're the best!!!
-
🎉🎉🎉thank you😊
-
thank you sm fr bro