HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

The spelled-out intro to neural networks and backpropagation: building micrograd

Andrej Karpathy17 HN recommenders · recommended in 16 months, 2022-2025
YouTube
4.4M views · 4 years ago · lecture · evergreen

Andrej Karpathy's first Neural Networks: Zero to Hero lecture, which builds micrograd, a tiny autograd engine, from scratch in Python. It explains backpropagation and neural network training step by step, assuming only basic Python and some high-school calculus.

HN treats it as the best starting point for really understanding backprop and neural nets, because Karpathy explains the why with intuition and builds everything in code.

Machine learning & deep learningPython, Ruby & scripting languages#micrograd#autograd#backpropagation#neuralnetworks#python#andrejkarpathy

20 comments from Hacker News

@jwitthuhn2025 · in “The Illustrated Transformer”

If you have 20 hours to spare I highly recommend this youtube playlist from Andrej Karpathy ▶ this video It starts with the fundamentals of how backpropagation works then advances to building a few simple models and ends with building a GPT-2 clone. It won't taech you everything about AI models but it gives you a solid foundation for branching out.

Strongly recommendsView on HN
@omrishn2025 · in “Deep dive into the small details of micrograd”

This blog post analyzes the code with an emphasis on the small details and ideas explored in Andrej Karpathy's awesome micrograd lecture. Link to the original lecture: ▶ this video I'd love to hear any thougts/reviews about the blog post.

Strongly recommendsView on HN
@jackdoe2025 · in “The Illusion of Thinking: Strengths and limitations of reasoning models [pdf]”

For studying? Mainly watching and re-watching Karpathy's 'Zero To Hero'[1] and Stanford's 'Introduction to Convolutional Neural Networks for Visual Recognition'[2], also a lot of transformers from scratch videos like Umar Jamali's videos[3], and I also study backwards to McCulloch and Pitts. Reading the 30 papers link and so on. And of course Yannic Kilcher[4], and also listening in on the paper discussions they do on discord. Practicing a lot with just doing backpropagation by hand and making toy models by hand to get intuition for the signal flow, and building all kinds of smallish systems, e.g. how far can you push whisper, small qwen3, and kokoro to control your computer with voice? People think that deepseek/mistral/meta etc are democratizing AI, but its actually Karpathy who teaches us :) so we can understand them and make our own. [1] ▶ this video [2] link [3] link [4] link

Strongly recommendsView on HN
@throwaway77832025 · in “How linear regression works intuitively and how it leads to gradient descent”

In the same vein, Karpathy's video series "Neural Networks from zero to hero"[0] touches upon a lot of this and intuitions as well. One of the best introductory series (even if you ignore the neural net part of it) and brushes on gradients, differentiation and what it means intuitively. [0] ▶ this video

Strongly recommendsView on HN
@rottc0dd2025 · in “Understanding Machine Learning: From Theory to Algorithms”

From my other comment elsewhere. These resources helped me understand the topics better. If anyone wants to understand fundamentals of machine learning, one of the superb resources I have found is, Stanford's "Probability for computer scientists"[1]. It goes into theoretical underpinnings of probability theory and ML, IMO better than any other course I have seen. But, this is a primarily a probability course that discusses the fundamentals of machine learning. (Yeah, Andrew Ng is legendary, but his course demands some mathematical familiarity with linear algebra topics) There is a course reader for CS109 [2]. You can download pdf version of this. Caltech's learning from data was really good too, if someone is looking for theoretical understanding of ML topics [3]. There is also book for excellent caltech course[4]. Also, neural networks zero to hero is for understanding how neural networks are built from ground up [5]. [1] link [2] link [3] link [4] link [5] ▶ this video

RecommendsView on HN
@strangecasts2025 · in “Ray Tracing in One Weekend”

Andrej Karpathy's guide to Micrograd - ▶ this video - is probably the closest equivalent, in that it covers the basic ideas of backpropagation and autodiff frameworks like PyTorch, and ends with an implementation of a very basic framework ( link ) you can train small neural networks in

RecommendsView on HN
@sprobertson2024 · in “Ask HN: Calculus Refresher for AI/ML?”

imo linear algebra is the main thing to refresh yourself on, as most of NN is based on matrix multiplication. The calculus is mostly in the gradient descent which in practice is abstracted away, so having a few decades old understanding might be good enough. For practical implementation Andrej Karpathy has a good series of videos going over a lot of the concepts starting here ▶ this video

RecommendsView on HN
@karpathy2024 · in “Llm.c – LLM training in simple, pure C/CUDA”

I wrote this, which might be a bit helpful: link But if you don't have the background, I'd recommend my YouTube videos, see the Zero To Hero playlist: ▶ this video

RecommendsView on HN
@paulsmith2023 · in “Linear Algebra for Programmers”

Watch Karpathy's recent lectures. They're gold. Start here[1] with micrograd[2]. It doesn't use linear algebra/matrices to start, but the principles are the same. The matrix multiplication is how the weights of the connections between neurons and the input values are combined (to form an activation value that then may lead to that neuron "firing" or not, depending on whether it passes some threshold function). We use matrices to model the connections between neurons - each row is a connection, and each column is a weight corresponding to an input. [1] ▶ this video [2] link

Strongly recommendsView on HN
@auraham2023 · in “Show HN: An Interactive Guide to Teach Derivatives and Backpropagation”

I just skimmed through the article and immediately noticed that the code was taken from Andrej Karpathy's lectures [0][1]. This is not a bad thing since the author included the bibliography. BTW, the author should replace "Andrej Karaphy". [0] link [1] ▶ this video

CitesView on HN
@radq2023 · in “GPT4 is 8 x 220B params = 1.7T params”

Andrej Karpathy's "zero to hero" series [1] was how I learned the fundamentals of this stuff. It's especially useful because he explains the why and provides intuitive explanations instead of just talking about the what and how. Would recommend it if you haven't checked it out already. [1] ▶ this video

Strongly recommendsView on HN
@gavi2023 · in “Deep Learning as Computational Graphs (2018)”

I highly recommend the video from karpathy ▶ this video - This explains the same idea spelled out in code. It really helped me understand the mathematical expression graph of neural networks. He uses graphviz to show the expressions and initially calculate gradients manually and then implement back propagation.

Strongly recommendsView on HN
@tjvc2023 · in “Post-GPT Computing”

I think this is a good take. I hope to do the same. For the understanding part, Andrej Karpathy has a YouTube playlist that explains neural networks. I made a start on it today and found it quite accessible. ▶ this video

RecommendsView on HN
@base6982023 · in “ChatGPT Explained: A Normie's Guide to How It Works”

The ChatGPT video by Karpathy is the last in a 7 video series. The one that really hit it home for me was the first video on MicroGrad [1]. The second video builds on MicroGrad and is also great for understanding how a basic NN works. [1] ▶ this video

Strongly recommendsView on HN
@rck2023 · in “Autodidax: Jax Core from Scratch (In Python)”

I think the closest thing for pytorch is the Karpathy video: ▶ this video There's also an old book on the internals of numpy - not sure how out of date it is though.

CitesView on HN
@tysam_and2023 · in “GPT in 60 Lines of NumPy”

That concept is not the easiest to describe succinctly inside a file like this (or -- while we are completely at it, in a Hacker News post like this!), I think (especially as there are various levels of 'beginner' to take into account here). This is considered a very entry level concept (not as an insult -- simply from an information categorization/tagging perspective here :D :)), and I think there might be others who would consider it to be noise if logged in the code or described in the comments/blogpost. After all, there was a disclaimer that you might have missed up front in the blogpost! "This post assumes familiarity with Python, NumPy, and some basic experience training neural networks." So it is in there! But in all of the firehose of info we get maybe it is not that hard to miss. However, I'm here to help! Thankfully the concept is not too terribly difficult, I believe. Effectively, the loss function compresses the task we've described with our labels from our training dataset into our neural network. This includes (ideally, at least), 'all' the information the neural network needs to perform that task well, according to the data we have, at least. If you'd like to know more about the specifics of this, I'd refer you to the original Shannon-Weaver paper on information theory -- Weaver's introduction to the topic is in plain English and accessible to (I believe) nearly anyone off of the street with enough time and energy to think through and parse some of the concepts

CitesView on HN
@ian02023 · in “Andrej Karpathy Is Joining OpenAI Again”

For those who dont know, Andrej has a brilliant series of videos on youtube where he explores the basics of neural nets right up to transformer architecture through code. Starts here [0] and most recent is building GPT from scratch in code. ▶ this video

Strongly recommendsView on HN
@bialpio2023 · in “Let's build GPT: from scratch, in code, spelled out by Andrej Karpathy”

▶ this video The entire series is at link , first video is literally from scratch (i.e. just Python, the only external dependency is for plotting graphs if I recall correctly).

RecommendsView on HN
@Geee2022 · in “A step by step backpropagation example (2015)”

I recommend watching Andrej Karpathy's recent videos on backprop and neural nets. Makes it really simple and intuitive. The spelled-out intro to neural networks and backpropagation: ▶ this video Becoming a backprop ninja: link

Strongly recommendsView on HN
@derac2022 · in “MinGPT: Minimal PyTorch re-implementation of GPT”

I love your approach and philosophy around programming. If anyone is unaware, Karpathy has a relatively small youtube channel he started a few weeks ago. ▶ this video

RecommendsView on HN
Neural Networks Demystified [Part 1: Data and Architecture]3:07

Neural Networks Demystified [Part 1: Data and Architecture]

Welch Labs
838K views • 12 years ago
CS231n Winter 2016: Lecture1: Introduction and Historical Context1:19:08

CS231n Winter 2016: Lecture1: Introduction and Historical Context

Andrej Karpathy
462K views • 10 years ago
Building the Software 2 0 Stack (Andrej Karpathy)17:55

Building the Software 2 0 Stack (Andrej Karpathy)

Databricks
73K views • 8 years ago
Backpropagation, intuitively | Deep Learning Chapter 312:47

Backpropagation, intuitively | Deep Learning Chapter 3

3Blue1Brown
6.4M views • 9 years ago
Gradient descent, how neural networks learn | Deep Learning Chapter 220:33

Gradient descent, how neural networks learn | Deep Learning Chapter 2

3Blue1Brown
9.7M views • 9 years ago
Lecture 1 | Machine Learning (Stanford)1:08:40

Lecture 1 | Machine Learning (Stanford)

Stanford
2.7M views • 18 years ago
[1hr Talk] Intro to Large Language Models59:48

[1hr Talk] Intro to Large Language Models

Andrej Karpathy
4.3M views • 2 years ago
Lecture 01 - The Learning Problem1:21:28

Lecture 01 - The Learning Problem

caltech
1.5M views • 14 years ago
Let's build GPT: from scratch, in code, spelled out.1:56:20

Let's build GPT: from scratch, in code, spelled out.

Andrej Karpathy
8.2M views • 3 years ago
Lecture 1 | Introduction to Convolutional Neural Networks for Visual Recognition57:57

Lecture 1 | Introduction to Convolutional Neural Networks for Visual Recognition

Stanford University School of Engineering
2.9M views • 9 years ago
The spelled-out intro to language modeling: building makemore1:57:45

The spelled-out intro to language modeling: building makemore

Andrej Karpathy
1.3M views • 4 years ago
Backpropagation calculus | Deep Learning Chapter 410:18

Backpropagation calculus | Deep Learning Chapter 4

3Blue1Brown
4M views • 9 years ago
Deep Dive into LLMs like ChatGPT3:31:24

Deep Dive into LLMs like ChatGPT

Andrej Karpathy
10.2M views • 1 year ago
RL Course by David Silver - Lecture 1: Introduction to Reinforcement Learning1:28:13

RL Course by David Silver - Lecture 1: Introduction to Reinforcement Learning

Google DeepMind
1.9M views • 11 years ago
Tensorflow and deep learning - without a PhD by Martin Görner2:35:53

Tensorflow and deep learning - without a PhD by Martin Görner

Devoxx
610K views • 10 years ago
Practical Deep Learning for Coders: Lesson 11:22:56

Practical Deep Learning for Coders: Lesson 1

Jeremy Howard
610K views • 4 years ago
Hello World - Machine Learning Recipes #16:53

Hello World - Machine Learning Recipes #1

Google for Developers
2.7M views • 10 years ago
Lecture 1 | Natural Language Processing with Deep Learning1:11:41

Lecture 1 | Natural Language Processing with Deep Learning

Stanford University School of Engineering
820K views • 9 years ago
MarI/O - Machine Learning for Video Games5:58

MarI/O - Machine Learning for Video Games

SethBling
11.5M views • 11 years ago
But what is a neural network? | Deep learning chapter 118:40

But what is a neural network? | Deep learning chapter 1

3Blue1Brown
25.1M views • 9 years ago