Source

Deep Neural Nets: 33 years ago and 33 years from now

Open the source

Karpathy reproduces LeCun et al.'s 1989 zip code recognition paper in PyTorch and uses it as a case study on progress in deep learning. He shows that modern techniques (cross entropy, AdamW, data augmentation, dropout, ReLU) cut the error by about 60%, and that scaling data helps further. He then extrapolates these lessons to predict how 2055 will view 2022 deep learning, arguing that training from scratch is giving way to finetuning and prompting foundation models.

- The 1989 paper reads remarkably modern: dataset, architecture, loss, optimization, and train/test error are all laid out as in a modern paper. - Exact reproduction was impossible because the dataset was lost and the paper underspecified details such as initialization and connectivity, so he made sensible guesses. - Swapping MSE for cross entropy, SGD for AdamW, and adding augmentation and dropout cut test errors from about 80 to about 30 without changing the dataset or inference latency. - Scaling the dataset alone gave modest gains, and combining it with the modern techniques gave the best result. - Further gains are bounded by compute: they would need bigger models and R&D to stabilize training at scale. - He predicts that training networks from scratch will become outdated in favor of finetuning, prompting, and distilling foundation models.

Based on Andrej Karpathy's public content. Not affiliated with or endorsed by Andrej Karpathy.

Supports these rules

Quotes from this video

“the modern Adam optimizer (learning rate of 3e-4, of course is almost always a strong baseline and needs little to no tuning.”

“to no tuning. So to improve my confidence that optimization was not holding back performance, I switched to AdamW”

“Data augmentation is a fairly simple and very standard concept used to fight overfitting,”

“Since we are still overfitting a bit, I reached for another modern tool in the toolbox, Dropout”

“because this simulates an increase in the size of the dataset, I also had to increase the number of passes from 23 to 60”

“Because dropout introduces even more noise during training, we also have to train longer,”

“I verified that just swapping tanh relu in the original network did not give substantial gains, so most of the improvement here is coming from the addition of dropout.”

“So I deleted the tanh on output layers to get class logits and swapped in the standard (multiclass) cross entropy loss function.”

“simply scaling up the dataset in 1989 would have been an effective way to drive up the performance of the system, at no cost to inference latency.”

Topics