# Deep Learning by Prediction: Intro | Stanford CS312 Lecture 1 with Tatsunori Hashimoto & Suhas Kotha

## Executive summary

This lecture introduces a pedagogical approach to deep learning, termed 'Alchemy,' which prioritizes empirical prediction and experimentation over classical theoretical models (like the bias-variance tradeoff). The course focuses on the pre-training phase, utilizing a small-scale d8 model organism (a 30M-parameter, 8-layer transformer) to explore phenomena like residual connection stability and hyperparameter sensitivity. Assessments are based on prediction quizzes, requiring students to build an 'internal world model' of deep learning behavior.

## Key takeaways

- The Failure of Classical Intuition: The traditional bias-variance tradeoff and convex optimization models are argued to be misleading for deep learning, as phenomena are often brittle and contingent on specific settings [00:03:10].
- Prediction as Understanding: The core teaching method involves prediction quizzes, where students must predict the outcome of a held-out experiment (e.g., loss curves) to build a 'world model' of deep learning [00:14:50].
- Focus on Pre-training: The class focuses almost exclusively on pre-training, which aims to imitate a raw data distribution using a low-noise metric: validation loss [00:23:30].
- Small-Scale Model Organism: Experiments are conducted using a small testbed: the d8 model, which has 30 million parameters and trains in approximately 10 minutes on one GPU [00:26:50].

## Technical details

- Model Architecture: The default architecture is based on Llama (Meta-trained) and consists of 8 layers, utilizing attention, MLPs, residual connections, and normalization for stable training [00:34:00].
- Training Process: Pre-training uses cross-entropy loss, which measures the negative log likelihood of the data as graded by the model. The objective is to minimize this loss [00:36:30].
- Experimental Design: Experiments involve systematic probing of components (e.g., removing MLPs, attention, or residual connections) and sweeping hyperparameters (e.g., learning rate $\alpha$) to observe changes in loss [00:44:30].
- Metrics and Benchmarks: A key finding demonstrated in the setting is that the optimal learning rate is close to $3 \times 10^{-3}$ and the resulting loss is around 2.93 [00:47:30].

## Practical implications

- The methodology emphasizes systematic hyperparameter search and component ablation (e.g., removing residual connections) as a core skill for ML engineers.
- The focus on validation loss provides a clean, predictive metric for assessing model quality, even in small-scale settings.
- The course promotes the development of 'mental models' and heuristics, enabling generalization from small, controlled experiments to larger systems.

## Topics

Deep Learning, Transformers, Optimization, Hyperparameter Tuning, AI, Machine Learning, Stanford CS312: Deep Learning Alchemy, d8 model organism, Ali Rahimi's paper (Random Kitchen Sinks)

Source: https://www.youtube.com/watch?v=JLcCYvUawsM
