Lecture Notes from Lecture 2
Introduction to Deep Learning and Generative Models
Brief History of Machine Learning
Machine Learning is the process of creating programs that improve their performance on a task through experience. Here is the current timeline of machine learning and neural networks:
- 1950s: Perceptrons
- 1960s: K-nearest neigbors (KNN)
- 1970s-1980s: Decision trees
- 1980s-1990s: Neural networks and Bayesian networks
- 1990s: Support vector machines (SVM)
- 2000s: Boosted trees and random forests
- 2010s: Deep neural networks (DNNs)
- 2020s: Large language models (LLMs) The history of neural networks can be thought of as several different periods of increased interest, followed by periods where other machine learning methods became more popular. —
Artificial Neurons
McCulloch & Pitts Neuron
In 1943, Warren McCulloch and Walter Pitts introduced a mathematical model of a neuron. The model used inputs, weights, and a threshold to determine whether the neuron should activate. The weights were limited to $+1$ and $-1$.
These neurons could represent simple logical operations such as:
- AND
- OR
- NOT
However, a single McCulloch & Pitts neuron could not represent XOR.

Figure 1: McCulloch & Pitts neuron model.
The Perceptron
The perceptron, developed by Frank Rosenblatt in 1957, generalized the earlier artificial neuron.
Unlike the McCulloch & Pitts neuron, a perceptron uses continuous weights and an activation function.
For a binary classification problem, the perceptron attempts to find a decision boundary that separates the two classes.
If the classes are linearly separable, the perceptron can find a boundary that correctly separates them.
The perceptron learning algorithm updates its weights based on whether the predicted value agrees with the actual value.
Figure 2: Perceptron architecture
The XOR Problem
A major limitation of a single perceptron is that it cannot represent the XOR logical operation.
For XOR:
- $0,0 \rightarrow 0$
- $0,1 \rightarrow 1$
- $1,0 \rightarrow 1$
- $1,1 \rightarrow 0$
The problem is that there is no single linear decision boundary that separates these two classes.
Therefore, a single perceptron cannot solve XOR.
This limitation helped motivate the development of multilayer neural networks, which can represent more complicated relationships.
Multi-layer Neural Networks
A multilayer perceptron (MLP), also called a multilayer neural network, combines multiple neurons into multiple layers.
The idea is to stack neuron models on top of each other so that the network can learn more complicated representations of the input. A single perceptron can only find a linear decision boundary, so it cannot solve problems such as XOR. However, multiple perceptrons can be combined to create the multiple decision boundaries needed for XOR.
The layers between the input and output are called hidden layers because their values are not directly observed in the training data.

Figure 3: Example of a multilayer neural network.
Backpropagation
A challenge with multilayer networks is that there are no direct target values for the hidden nodes. The network therefore needs a way to determine how much each parameter contributed to the final error.
Backpropagation provides this method. Neural networks can be represented as computation graphs, and the chain rule can be used to work backward through the graph and calculate gradients for the different parameters.
These gradients are then used to update the network’s parameters during training, allowing the network to learn the appropriate weights needed to represent more complicated functions such as XOR.
Deep Learning
Deep learning refers to using neural networks with multiple layers to learn increasingly complex representations of data.
The main idea is that different layers can learn different levels of representation. Earlier layers can learn simpler patterns, while later layers can combine those patterns into more complex features.
The term “deep” refers to the number of layers in the neural network. Adding more layers allows the model to learn a hierarchy of representations.
Building Blocks of Deep Learning
Deep learning models are built by combining several important components:
- Neurons: Perform computations using inputs, weights, and an activation function.
- Layers: Groups of neurons that process information at different stages of the network.
- Activation functions: Introduce nonlinearity, allowing neural networks to learn relationships that cannot be represented by a simple linear model.
- Loss functions: Measure how far the model’s predictions are from the desired output.
- Backpropagation: Calculates gradients of the loss with respect to the model’s parameters.
- Optimization: Uses these gradients to update the parameters and improve the model.
Together, these components allow a neural network to learn useful representations from data rather than requiring a person to manually specify all of the features.
Hierarchical Representations
One important idea in deep learning is that neural networks can learn hierarchical representations.
For example, when working with an image, earlier layers might learn simple patterns such as edges. Later layers can combine these patterns to recognize shapes, and even later layers can combine those shapes into more complex objects.
This allows the network to learn useful features automatically from the data.
The Rise of Deep Learning
Although neural networks had existed for decades, deep learning became much more successful when larger datasets, better algorithms, and more powerful hardware became available.
Benchmark datasets played an important role in measuring progress in machine learning.
Some important datasets include:
- MNIST: A dataset of handwritten digits.
- CIFAR: Image datasets commonly used for image classification.
- ImageNet: A much larger image dataset that became an important benchmark for computer vision.
These datasets made it possible to compare different machine learning approaches and measure improvements in performance.
AlexNet
A major breakthrough came with AlexNet, which achieved a large improvement on the ImageNet image-classification benchmark.
AlexNet demonstrated that deep neural networks could perform extremely well when combined with large datasets and powerful hardware.
This helped lead to the rapid growth of modern deep learning during the 2010s.
The DL Hardware & Software Landscape
Hardware
CPU
- Centralized control
- Local cache memory
- General-purpose computing
GPU
- Optimized for matrix multiplication
- Many compute cores
- Shared control and cache across cores
- Highly parallel
Memory and Infrastructure Bottlenecks
- Data movement can be slower than computation
- Memory needs to be close to compute
- Advanced packaging and high-performance memory are increasingly important
AI compute demand now affects:
- GPU chips
- Packaging + memory
- EUV lithography
- Capital
- Electricity
- Gas turbines and turbine manufacturing
Current Research Trends
Self-Supervised Learning
- Learn from data without manually provided labels
- Use pretext tasks to learn useful representations
- Contrastive learning
Structured Data
Deep learning can also be applied to structured data such as graphs.
- Aggregate information from neighboring nodes
- Apply a neural network
Massive Unsupervised Learning
From GPT-1 (2018) to GPT-4:
- Parameters: 1.5B → >1T
- Context length: 512 → 128k
- Layers: 12 → >96
- Attention heads: 12 → >96
- Embedding dimension: 768 → >12,288
- Vocabulary: 40k → >50k tokens
- Multimodal tokenization
- Mixture-of-Experts
- Training data: ~5GB → ~50TB
- Reinforcement learning for alignment
Compute-Optimal Scaling
- Compute-optimal training balances model parameters and training tokens
- Most pre-2022 LLMs were undertrained relative to their parameter count
- Growing focus on data quality, curation, and synthetic data
Takeaway: “Bigger” alone is no longer the story. What and how much data matters as much as model size.
Open Directions
- Verifiable rewards
- Vision-language and multimodal models
- Large-scale reinforcement learning
- Model uncertainty and hallucinations
- Model editing and interpretability
- Agentic systems / tool use
- Compute-optimal scaling
- Efficient inference
- Mechanistic interpretability
- World models