Machine learning and the deep learning turn
Between 1986 and 2016, three ingredients came together: a way to train deep networks, large datasets and GPUs. Then the results arrived all at once.
Words on this page (12)
- GPU
- : Graphics processing unit. A chip with thousands of cores, ideal for the matrix math in AI.
- backpropagation
- : The method that computes the gradient for every parameter by applying the chain rule backward through the network.
- vector
- : An ordered list of numbers. Embeddings and model activations are vectors.
- attention
- : The mechanism that lets each token weigh all earlier tokens by relevance when computing its next representation.
- neural network
- : A function built from layers of simple units (neurons) whose weights are learned from data.
- training
- : Adjusting a model's parameters on data so its predictions improve.
- weights
- : The learned numbers that define a trained model. A model whose weights are published is called open-weight.
- activation function
- : A simple curve such as ReLU applied after a neuron's sum. It lets stacked layers represent complex functions.
- learning rate
- : How big each gradient descent step is.
- loss
- : A number measuring how wrong the model's output is. Training tries to reduce it.
- parameter
- : One learned number inside a model. Modern models have billions of them. Training adjusts them.
- baseline
- : A simple method, such as "same as last week", that any model must beat to be worth its cost.
Learn instead of program
Machine learning flips programming. Instead of writing rules, you provide examples of inputs and desired outputs, and an algorithm adjusts a model until it fits. In 1986 Rumelhart, Hinton and Williams popularized , the method that trains networks with many layers. In the 1990s Yann LeCun's convolutional networks read handwritten digits on bank checks.
The 2012 moment
ImageNet was a dataset of over a million labeled images, started by Fei-Fei Li in 2009. In 2012 a convolutional network called AlexNet, trained on two gaming , cut the top-5 error of the annual ImageNet contest from about 26 percent to about 15 percent. The runner-up methods were hand-engineered feature pipelines. After that, nearly every field moved to deep learning.
What came after
Word2vec in 2013 showed that words could be turned into where directions carry meaning. Sequence-to-sequence networks with improved translation in 2014 and 2015. ResNets made networks hundreds of layers deep trainable in 2015. In 2016 DeepMind's AlphaGo beat Lee Sedol at Go, a game thought to be a decade away. Each success used the same recipe: a flexible model, lots of data, lots of compute.
What "deep" means
A is layers of simple units. "Deep" just means many layers. In an image model, the first layer learns to spot tiny edges, the next combines edges into corners and curves, the next combines those into eyes and wheels, and the last layer says "cat". Nobody programs those steps. The layers fit themselves to the data by .
A worked example: why GPUs mattered
A network's main job is multiplying big grids of numbers. A normal processor does a few calculations at a time. A graphics card (GPU) was built to color millions of pixels at once, so it can do thousands of multiplications in parallel. Training that took months on a regular chip could take days. The idea of deep networks was old. GPUs plus the ImageNet dataset made it practical.
How a network learns its layers
Backpropagation answers one question for every : if I nudge this weight up a little, how much does the output change? Take a toy chain, ignoring functions to keep it simple. Input x = 1 goes through weight w1 = 2 and then weight w2 = 3, so the output is 1 × 2 × 3 = 6. The target is 8.
Raise w2 by 0.1 and the output becomes 2 × 3.1 = 6.2, a change of 0.2. Raise w1 by 0.1 and the output becomes 2.1 × 3 = 6.3, a change of 0.3. So w1 deserves the bigger nudge here. Backpropagation computes these sensitivities for every weight in one backward pass, starting from the output error. Then each weight moves a small step, set by the , toward lower error.
What goes wrong in training
Symptoms show up in the , the number that measures error.
- Loss stays flat. The learning rate may be too small, or there is a bug such as labels not matching inputs.
- Loss jumps up or becomes NaN (a broken "not a number" value). The learning rate is usually too large, so steps overshoot.
- Training loss falls but validation loss rises. The network is memorizing.
A useful check is to train on just 10 examples. A healthy setup should push the loss close to zero, because memorizing 10 items is easy. If it cannot, suspect a bug before blaming the data.
A second example: when deep learning is the wrong choice
Say you have 2,000 rows describing customers, and you want to predict who cancels. A network with millions of has far more freedom than the data can justify, so it overfits. A gradient-boosted tree or a simple linear model is cheaper to train, faster to check and easier to explain to the person who must act on its output.
Deep learning pays off when the input is raw and messy, such as pixels or audio, and there is a lot of data. For small tables, start with the simple model and use it as the any network must beat.
Common mistake
Thinking deep learning replaced everything. It dominates images, speech and language, while simpler methods still win on many tables of business data.
Before 2012, to teach a computer to recognise cats you had to describe cats: pointy ears, whiskers, certain edges. Teams of researchers spent years inventing such descriptions. Then a network trained on a million labelled photos found its own description, better than theirs, in about a week on two gaming graphics cards. Almost every lab changed direction that year.
Check yourself
What changed the field in 2012?
Not quite. AlexNet showed that features learned at scale beat hand-designed ones, and the field followed.
What does machine learning replace in a program?
Not quite. You supply examples and a training algorithm finds the rules.
Why did graphics cards matter so much for deep learning?
Not quite. A network is mostly matrix multiplication, and GPUs were built to do many of those at once.
You got 0 of 3 right.
Go deeper
- Video
3Blue1Brown · The best visual introduction to what networks compute.
- Article
Krizhevsky, Sutskever, Hinton · The AlexNet paper.
- Article
Andrej Karpathy · A readable look at language models just before transformers.
- Paper
Bahdanau, Cho, Bengio · Where the attention mechanism first appeared.
Spotted a mistake or something unclear? Report it on GitHub.