Summary
Full Transcript
In this lecture, we code the final building block of the GPT architecture: Generating text from output tokens. We learn how to convert the output logits tensor into a set of probabilities to predict the next token. We also learn about the role of the softmax function in the next token prediction task. At the end of this lecture, we take a simple input text and generate next tokens using the GPT-2 model architecture. We understand the theory, mathematical intuition and also do the coding for the entire implementation. The key reference book which this video series very closely follows is Build a Large Language Model from Scratch by Manning Publications. All schematics and their descriptions are borrowed from this incredible book! This book serves as a comprehensive guide to understanding and building large language models, covering key concepts, techniques, and implementations. Affiliate links for purchasing the book will be added soon. Stay tuned for updates! 0:00 How LLM generates text? 3:11 GPT Model recap 5:12 GPT Model visual flow 8:01 Converting output logins into next word prediction 14:20 Next word prediction visualised 19:50 Coding the next token generator function 29:48 Role of softmax in next token prediction 32:17 Testing the next token generator function 35:28 Analysing the next token predictions 37:23 Recap and summary Link to code file: https://drive.google.com/file/d/1k4TwMW6HHDiS1tcbGO5ip3zD3BonwSa0/view?usp=sharing ================================================= ✉️ Join our FREE Newsletter: https://vizuara.ai/our-newsletter/ ================================================= Vizuara philosophy: As we learn AI/ML/DL the material, we will share thoughts on what is actually useful in industry and what has become irrelevant. We will also share a lot of information on which subject contains open areas of research. Interested students can also start their research journey there. Students who are confused or stuck in their ML journey, maybe courses and offline videos are not inspiring enough. What might inspire you is if you see someone else learning and implementing machine learning from scratch. No cost. No hidden charges. Pure old school teaching and learning. ================================================= 🌟 Meet Our Team: 🌟 🎓 Dr. Raj Dandekar (MIT PhD, IIT Madras department topper) 🔗 LinkedIn: https://www.linkedin.com/in/raj-abhijit-dandekar-67a33118a/ 🎓 Dr. Rajat Dandekar (Purdue PhD, IIT Madras department gold medalist) 🔗 LinkedIn: https://www.linkedin.com/in/rajat-dandekar-901324b1/ 🎓 Dr. Sreedath Panat (MIT PhD, IIT Madras department gold medalist) 🔗 LinkedIn: https://www.linkedin.com/in/sreedath-panat-8a03b69a/ 🎓 Sahil Pocker (Machine Learning Engineer at Vizuara) 🔗 LinkedIn: https://www.linkedin.com/in/sahil-p-a7a30a8b/ 🎓 Abhijeet Singh (Software Developer at Vizuara, GSOC 24, SOB 23) 🔗 LinkedIn: https://www.linkedin.com/in/abhijeet-singh-9a1881192/ 🎓 Sourav Jana (Software Developer at Vizuara) 🔗 LinkedIn: https://www.linkedin.com/in/souravjana131/
