Andrej Karpathy
@karpathy前 OpenAI 联合创始人 / Eureka Labs
以从零实现 GPT、Neural Networks: Zero to Hero 视频课程与 LLM OS 深度工程长文著称。
代表作与编年史大事记
2015 年至今 · 24 个节点- 15:00Blog实战教程来源:Andrej Karpathy Blogkarpathy.github.io
microgpt
This is a brief guide to my new art project microgpt , a single file of 200 lines of pure Python with no dependencies that trains and inferences a GPT. This file contains the full algorithmic content of what is needed: dataset of documents, tokenizer, autograd engine, a GPT-2-like neural network architecture, the Adam optimizer, training loop, and inference
作者:Andrej Karpathy#大模型原理#从零手写
- 06:29YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
How I use LLMs
The example-driven, practical walkthrough of Large Language Models and their growing list of related features, as a new entry to my general audience series on LLMs. In this more practical followup, I take you through the many ways I use LLMs in my own life. Chapters 00:00:00 Intro into the growing LLM ecosystem 00:02:54 ChatGPT interaction under the hood 00:
作者:Andrej Karpathy#大模型原理#从零手写
- 02:23YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Deep Dive into LLMs like ChatGPT
This is a general audience deep dive into the Large Language Model (LLM) AI technology that powers ChatGPT and related products. It is covers the full training stack of how the models are developed, along with mental models of how to think about their "psychology", and how to get the best use them in practical applications. I have one "Intro to LLMs" video a
作者:Andrej Karpathy#大模型原理#从零手写
- 07:31YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Let's reproduce GPT-2 (124M)
We reproduce the GPT-2 (124M) from scratch. This video covers the whole process: First we build the GPT-2 network, then we optimize its training to be really fast, then we set up the training run following the GPT-2 and GPT-3 paper and their hyperparameters, then we hit run, and come back the next morning to see our results, and enjoy some amusing model gene
作者:Andrej Karpathy#大模型原理#从零手写
- 01:11YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Let's build the GPT Tokenizer
The Tokenizer is a necessary and pervasive component of Large Language Models (LLMs), where it translates between strings and tokens (text chunks). Tokenizers are a completely separate stage of the LLM pipeline: they have their own training sets, training algorithms (Byte Pair Encoding), and after training implement two fundamental functions: encode() from s
作者:Andrej Karpathy#大模型原理#从零手写
- 10:27YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
[1hr Talk] Intro to Large Language Models
This is a 1 hour general-audience introduction to Large Language Models: the core technical component behind systems like ChatGPT, Claude, and Bard. What they are, where they are headed, comparisons and analogies to present-day operating systems, and some of the security-related challenges of this new computing paradigm. As of November 2023 (this field moves
作者:Andrej Karpathy#大模型原理#从零手写
- 00:33YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Let's build GPT: from scratch, in code, spelled out.
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 aut
作者:Andrej Karpathy#大模型原理#从零手写
- 08:32YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Building makemore Part 5: Building a WaveNet
We take the 2-layer MLP from previous video and make it deeper with a tree-like structure, arriving at a convolutional neural network architecture similar to the WaveNet (2016) from DeepMind. In the WaveNet paper, the same hierarchical architecture is implemented more efficiently using causal dilated convolutions (not yet covered). Along the way we get a bet
作者:Andrej Karpathy#大模型原理#从零手写
- 01:56YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Building makemore Part 4: Becoming a Backprop Ninja
We take the 2-layer MLP (with BatchNorm) from the previous video and backpropagate through it manually without using PyTorch autograd's loss.backward(): through the cross entropy loss, 2nd linear layer, tanh, batchnorm, 1st linear layer, and the embedding table. Along the way, we get a strong intuitive understanding about how gradients flow backwards through
作者:Andrej Karpathy#大模型原理#从零手写
- 00:41YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Building makemore Part 3: Activations & Gradients, BatchNorm
We dive into some of the internals of MLPs with multiple layers and scrutinize the statistics of the forward pass activations, backward pass gradients, and some of the pitfalls when they are improperly scaled. We also look at the typical diagnostic tools and visualizations you'd want to use to understand the health of your deep network. We learn why training
作者:Andrej Karpathy#大模型原理#从零手写
- 22:43YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Building makemore Part 2: MLP
We implement a multilayer perceptron (MLP) character-level language model. In this video we also introduce many basics of machine learning (e.g. model training, learning rate tuning, hyperparameters, evaluation, train/dev/test splits, under/overfitting, etc.). Links: - makemore on github: https://github.com/karpathy/makemore - jupyter notebook I built in thi
作者:Andrej Karpathy#大模型原理#从零手写
- 03:14YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
The spelled-out intro to language modeling: building makemore
We implement a bigram character-level language model, which we will further complexify in followup videos into a modern Transformer language model, like GPT. In this video, the focus is on (1) introducing torch.Tensor and its subtleties and use in efficiently evaluating neural networks and (2) the overall framework of language modeling that includes model tr
作者:Andrej Karpathy#大模型原理#从零手写
- 02:32YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Stable diffusion dreams of psychedelic faces
Prompt: "psychedelic faces" Stable diffusion takes a noise vector as input and samples an image. To create this video I smoothly (spherically) interpolate between randomly chosen noise vectors and render frames along the way. This video was produced by one A100 GPU taking about 10 tabs and dreaming about the prompt overnight (~8 hours). While I slept and dre
作者:Andrej Karpathy#大模型原理#从零手写
- 00:58YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Stable diffusion dreams of steampunk brains
Prompt: "ultrarealistic steam punk neural network machine in the shape of a brain, placed on a pedestal, covered with neurons made of gears. dramatic lighting. #unrealengine" Stable diffusion takes a noise vector as input and samples an image. To create this video I smoothly (spherically) interpolate between randomly chosen noise vectors and render frames al
作者:Andrej Karpathy#大模型原理#从零手写
- 07:02YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
Stable diffusion dreams of tattoos
Dreams of tattoos. (There are a few discrete jumps in the video because I had to erase portions that got just a little 🌶️, believe I got most of it) Links - Stable diffusion: https://stability.ai/blog - Code used to make this video: https://gist.github.com/karpathy/00103b0037c5aaea32fe1da1af553355 - My twitter: https://twitter.com/karpathy
作者:Andrej Karpathy#大模型原理#从零手写 - 06:44YouTube视频 / 播客来源:Andrej Karpathy · YouTubeyoutube.com
The spelled-out intro to neural networks and backpropagation: building micrograd
This is the most step-by-step spelled-out explanation of backpropagation and training of neural networks. It only assumes basic knowledge of Python and a vague recollection of calculus from high school. Links: - micrograd on github: https://github.com/karpathy/micrograd - jupyter notebooks I built in this video: https://github.com/karpathy/nn-zero-to-hero/tr
作者:Andrej Karpathy#大模型原理#从零手写
- 15:00Blog深度文章来源:Andrej Karpathy Blogkarpathy.github.io
Deep Neural Nets: 33 years ago and 33 years from now
The Yann LeCun et al. (1989) paper Backpropagation Applied to Handwritten Zip Code Recognition is I believe of some historical significance because it is, to my knowledge, the earliest real-world application of a neural net trained end-to-end with backpropagation. Except for the tiny dataset (7291 16x16 grayscale images of digits) and the tiny neural network
作者:Andrej Karpathy#大模型原理#从零手写
- 18:00Blog深度文章来源:Andrej Karpathy Blogkarpathy.github.io
A from-scratch tour of Bitcoin in Python
I find blockchain fascinating because it extends open source software development to open source + state. This seems to be a genuine/exciting innovation in computing paradigms; We don’t just get to share code, we get to share a running computer, and anyone anywhere can use it in an open and permissionless manner. The seeds of this revolution arguably began w
作者:Andrej Karpathy#大模型原理#从零手写
- 18:00Blog深度文章来源:Andrej Karpathy Blogkarpathy.github.io
Short Story on AI: Forward Pass
The inspiration for this short story came to me while reading Kevin Lacker’s Giving GPT-3 a Turing Test . It is probably worth it (though not required) to skim this post to get a bit of a background on some of this story. It was probably around the 32nd layer of the 400th token in the sequence that I became conscious. At first my thoughts were but a knotted
作者:Andrej Karpathy#大模型原理#从零手写
- 18:00Blog深度文章来源:Andrej Karpathy Blogkarpathy.github.io
Biohacking Lite
Throughout my life I never paid too much attention to health, exercise, diet or nutrition. I knew that you’re supposed to get some exercise and eat vegetables or something, but it stopped at that (“mom said”-) level of abstraction. I also knew that I can probably get away with some ignorance while I am young, but at some point I was messing with my health-ad
作者:Andrej Karpathy#大模型原理#从零手写