yonzon Hacker News • Recommends
On “The Transformer Family”
1.7M subscribers • 6 videos on Hallway
Intermediate. Assumes working knowledge.
8.1M views3 years ago14 recommendations
AI and machine learningProgramming languagesTransformers and LLMsNeural networks and deep learningPython
Andrej Karpathy builds a Generative Pretrained Transformer from scratch using PyTorch, explaining the mechanics of attention and language models.
We build a Generatively Pretrained Transformer (GPT), following the paper "Attention is All You Need" and OpenAI's GPT-2 / GPT-3. We talk about connections to ChatGPT, which has taken the world by storm. We watch GitHub Copilot, itself a GPT, help us write a GPT (meta :D!) . I recommend people watch the earlier makemore videos to get comfortable with the autoregressive language modeling framework and basics of tensors and PyTorch nn, which we take for granted in this video. Links: - Google colab for the video: colab.research.google.com/drive/1JMLa53HDuA-i7ZBmqV7ZnA3c_fv… - GitHub repo for the video: github.com/karpathy/ng-video-lecture - Playlist of the whole Zero to Hero series so far: youtube.com/watch?v=VMj-3S1tku0&list=PLAqhIrjkxbuWI23v9cThsA… - nanoGPT repo: github.com/karpathy/nanoGPT - my website: karpathy.ai - my twitter: twitter.com/karpathy - our Discord channel: discord.gg/3zy8kqD9Cp Supplementary links: - Attention is All You Need paper: arxiv.org/abs/1706.03762 - OpenAI GPT-3 paper: arxiv.org/abs/2005.14165 - OpenAI ChatGPT blog post: openai.com/blog/chatgpt/ - The GPU I'm training the model on is from Lambda GPU Cloud, I think the best and easiest way to spin up an on-demand GPU instance in the cloud that you can ssh to: lambdalabs.com . If you prefer to work in notebooks, I think the easiest path today is Google Colab. Suggested exercises: - EX1: The n-dimensional tensor mastery challenge: Combine the `Head` and `MultiHeadAttention` into one class that processes all the heads in parallel, treating the heads as another batch dimension (answer is in nanoGPT). - EX2: Train the GPT on your own dataset of choice! What other data could be fun to blabber on about? (A fun advanced suggestion if you like: train a GPT to do addition of two numbers, i.e. a+b=c. You may find it helpful to predict the digits of c in reverse order, as the typical addition algorithm (that you're hoping it learns) would proceed right to left too. You may want to modify the data loader to simply serve random problems and skip the generation of train.bin, val.bin. You may want to mask out the loss at the input positions of a+b that just specify the problem using y=-1 in the targets (see CrossEntropyLoss ignore_index). Does your Transformer learn to add? Once you have this, swole doge project: build a calculator clone in GPT, for all of +-*/. Not an easy problem. You may need Chain of Thought traces.) - EX3: Find a dataset that is very large, so large that you can't see a gap between train and val loss. Pretrain the transformer on this data, then initialize with that model and finetune it on tiny shakespeare with a smaller number of steps and lower learning rate. Can you obtain a lower validation loss by the use of pretraining? - EX4: Read some transformer papers and implement one additional feature or change that people seem to use. Does it improWhat people say. Widely recommended as the single best, most intuitive video for understanding how transformers and LLMs work under the hood.
yonzon Hacker News • Recommends
On “The Transformer Family”
durdnon Hacker News • Recommends
On “GPT in 60 Lines of NumPy”
wesammikhailon Hacker News • Recommends
On “Google DeepMind CEO Says Some Form of AGI Possible in a Few Years”
villedespommeson Hacker News • Recommends
On “Implementing a ChatGPT-like LLM from scratch, step by step”
amrbon Hacker News • Recommends
On “Deep Learning Tuning Playbook”
qazpoton Hacker News • Recommends
On “Flow-Based Programming, a way for AI and humans to develop together”
bfg_damienon Hacker News • Recommends
On “Ask HN: How to Learn LLM Fundamentals”
pankajdohareyon Hacker News • Recommends
On “What Are Transformer Models and How Do They Work?”
erwincoumanson Hacker News • Recommends
On “Transformers from Scratch”
Alpion Hacker News • Recommends
On “Introducing "Implement DNS in a Weekend"”
FranklinMailloton Hacker News • Recommends
On “Ask HN: Can someone ELI5 Transformers and the “Attention is all we need” paper”
samspencon Hacker News • Recommends
On “Andrej Karpathy: Intro to Large Language Models [Video]”
solomatovon Hacker News • Recommends
On “Ask HN: Is it feasible to train my own LLM?”
yregon Hacker News • Recommends
On “A ChatGPT clone, in 3000 bytes of C, backed by GPT-2 (2023)”
u/Suspicious_Role5912in r/dotnet • Mentions
psycho brmon Data Science Stack Exchange • Mentions
On “ChatGPT's Architecture - Decoder Only? Or Encoder-Decoder?”