A 501(c)(3) non-profit organization info@cheairesearch.com
Applied AI research for public benefit

People use the words “AI,” “machine learning,” and “deep learning” as if they mean the same thing. They do not.

Each term names a smaller group inside a bigger group. AI is the biggest group. Machine learning sits inside it. Deep learning sits inside machine learning. Generative AI sits inside deep learning. Large language models sit inside generative AI.

Artificial intelligence is any system that copies a task the human mind can do. Machine learning is AI that learns the task from data instead of following fixed rules.

This lesson gives you the correct map, the exact mathematical line that separates each layer from the next, and the three moments in history when the field changed direction, with the numbers behind each change.

Section 01Five terms, one nested structure

Use this order. Each term is a strict subset of the one before it.

TermWhat it meansExample
Artificial Intelligence (AI)Any computer system that performs a task normally linked to human thoughtA chess program, a spam filter, a chatbot
Machine Learning (ML)AI that sets its own rules by studying data, instead of a human writing the rulesA spam filter trained on past emails
Deep Learning (DL)ML that uses many stacked layers of simple math functions to find patterns on its ownA system that learns to spot cats in photos without a human describing what a cat looks like
Generative AI (GenAI)Deep learning that creates new content instead of just labeling or sorting contentA system that writes a new paragraph or draws a new image
Large Language Model (LLM)Generative AI built to predict and produce text, one word-piece at a timeThe system behind a chat assistant

Each row sits inside the row above it. Every LLM is generative AI. Every piece of generative AI is deep learning. But not every AI system is machine learning, and not every machine learning system is deep learning.

Nested rectangles showing AI containing machine learning, containing deep learning, containing generative AI, containing large language models
Every LLM is generative AI. Every generative AI is deep learning. The reverse is never true.

Section 02Machine learning, defined precisely

Computer scientist Tom Mitchell gave the field its standard definition in 1997: a program learns from experience E with respect to a task T and a performance measure P, if its performance at T, measured by P, improves with E.

Turn that into a concrete recipe. You have a set of input-output example pairs, drawn from the real world: an email and whether it was spam, a photo and whether it contains a cat, a sentence and its correct translation. Machine learning fits a function that maps inputs to outputs by searching for the setting of that function's internal numbers, called parameters, that makes the fewest mistakes across your examples.

Written as a general goal: pick the parameters that make the total error, summed across every example, as small as possible. Every example contributes a penalty (called a loss) based on how wrong the model's guess was. Training is the search for the parameter setting with the smallest total penalty. A second term is often added to that goal, penalizing parameter settings that are needlessly large or complicated, which helps stop the model from simply memorizing the training examples instead of learning a pattern that generalizes.

Example. A hardcoded spam filter has a human-written list: block any email containing “free money.” A machine learning spam filter studies 100,000 past emails, each marked spam or not spam, and searches for the parameter setting that best separates the two groups. That setting can capture warning signs no human would think to write down by hand, such as subtle combinations of word frequency and sentence length.

Section 03Shallow machine learning vs. deep learning: where the features come from

This is the exact line that separates “machine learning” from “deep learning,” and it is worth being precise about it, because the distinction is not about how many layers sound impressive. It is about who builds the features.

Shallow machine learning (support vector machines, logistic regression, decision trees) needs a human to build a feature map first. Before any learning starts, an engineer decides: for this email, count how many times “free” appears, measure the length of the subject line, check whether the sender's domain is known. That hand-built feature map turns raw input into a fixed set of numbers. The learning algorithm only ever sees those numbers. It never touches the raw email text directly.

Deep learning removes that human step. Instead of one fixed, hand-built feature map, it stacks many small, trainable processing layers, one after another. Each layer takes the output of the layer before it, applies a simple transformation, and passes the result forward. Every one of those transformations is itself learned from data, not designed by a person. The number of these stacked layers is called the depth of the network. This lets a deep network build its own hierarchy of features directly from raw pixels, raw audio samples, or raw text, discovering which patterns matter without a human specifying them in advance.

This is why deep learning is often called “representation learning”: the network learns its own representation of the input, instead of being handed one.

Section 04Discriminative vs. generative models

Machine learning models split into two families, based on what they actually calculate.

A discriminative model estimates the probability of a label, given an input. It answers a direct question: “Given this email, how likely is it to be spam?” It draws a boundary between categories and never tries to understand how the data itself came to exist. Its training goal is to make the correct label as likely as possible, given each input.

A generative model goes further. It estimates the full pattern of how the data is put together, well enough that it can sample brand-new examples that fit that pattern. It does not just judge existing data. It can produce new data that looks like it belongs to the same set.

Modern large language models are generative, and they use a specific trick to make generating a full sentence tractable: they break the problem down one word-piece at a time. The probability of an entire passage is calculated as the probability of the first piece, times the probability of the second piece given the first, times the probability of the third piece given the first two, and so on. This is called an autoregressive factorization, and it is the mathematical core of every modern LLM.

A worked comparison: classifying vs. generating

Take a two-word input, such as “great service.” A discriminative classifier turns this into a fixed input vector, multiplies it by a learned weight matrix, adds a bias term, and passes the result through a squashing function (commonly the sigmoid function) that forces the output into a single number between 0 and 1. That number is read directly as a probability: “89% likely to be a positive review.” One number, one boundary, one decision.

A generative language model does something structurally different. Given the context so far, it projects that context into a score (called a logit) for every single word-piece in its entire vocabulary, which can be tens of thousands of entries. It then applies a function called softmax, which turns that whole list of raw scores into a valid probability distribution: every score becomes a probability between 0 and 1, and the full set of probabilities across the vocabulary adds up to exactly 1. The model then samples one word-piece from that distribution, appends it to the context, and repeats the entire calculation for the next word-piece. A classifier produces one number. A generative language model repeats a full probability calculation, over its entire vocabulary, once for every single word-piece it produces.

Section 05Where these terms get misused

Marketing language blurs this map. Watch for these mix-ups.

MisuseWhy it is wrong
Calling any modern software “AI”Erases decades of non-learning AI methods, such as rule-based chess engines and search algorithms
Using “machine learning” and “deep learning” as the same wordHides simpler methods, like linear regression, that are still machine learning but not deep learning
Calling a spam filter or search ranking tool “generative AI”These tools estimate a probability about existing content. They do not model the full data pattern well enough to generate new content
Calling a small, rule-based chatbot an “LLM”An LLM specifically means a large, trained, autoregressive next-word-prediction system, not a scripted chat tree

Section 06Shift one: rules to statistics (1950s to 1990s)

AI began as a formal field of study in 1956, at a workshop at Dartmouth College. The organizers, including John McCarthy and Marvin Minsky, believed that every part of intelligence could eventually be described precisely enough for a machine to simulate it. Their proposal stated the idea directly: every aspect of learning, or any other feature of intelligence, could in principle be described so precisely that a machine could be made to simulate it.

This approach, known as symbolic AI or “Good Old-Fashioned AI,” built systems entirely out of hand-written logic: formal rules, production systems, and search through a tree of possible states. Expert systems such as MYCIN and DENDRAL encoded specialist knowledge as manually written condition-action rules, then used an inference engine to search through those rules.

This approach ran into four hard walls:

  1. Explosion of possibilities. In a search over possible states, the number of states to check grows exponentially with how deep the search goes, and how many branches exist at each step. Even a moderately complex task could overwhelm the memory of any real computer.
  2. No tolerance for messy input. These systems required deterministic, complete rules. One missing or ambiguous premise could stop execution entirely, since the system had no statistical fallback.
  3. The endless list problem, known as the frame problem. Formal logic required a human to explicitly state every fact that stayed unchanged after each action was taken. In any real environment, that list is enormous, and writing it by hand does not scale.
  4. Raw data was unusable. High-dimensional, unstructured input, such as a camera image or an audio waveform, cannot be fed directly into a system built from symbolic logic. Someone first has to translate the raw signal into discrete symbols, and that translation step turned out to be its own unsolved problem.

By the mid-1990s, researchers shifted from hand-written rules toward statistical machine learning. Instead of a person writing down the answer, engineers built parameterized algorithms that found probabilistic patterns directly in structured data.

The support vector machine and the kernel trick

The clearest mathematical marker of this shift is the support vector machine, introduced by Corinna Cortes and Vladimir Vapnik in 1995. A support vector machine finds the boundary that separates two classes of data with the largest possible margin between them, which makes the boundary more robust to new, unseen data than a boundary that just barely separates the training examples.

Many real problems are not separable by a straight line in their original, low-dimensional form. The support vector machine handles this by mapping the input into a much higher-dimensional space, where a straight-line separation becomes possible. Directly computing that high-dimensional mapping for every data point would be far too expensive. The kernel trick solves this: instead of computing the high-dimensional mapping explicitly, a kernel function calculates the equivalent result directly in the original, low-dimensional space, without ever constructing the expensive high-dimensional vectors.

Worked example: the Gaussian kernel

A common kernel is the Gaussian Radial Basis Function. Take two two-dimensional points, point A at (1, 2) and point B at (3, 1), and a kernel parameter gamma set to 0.5.

First, find the squared distance between the two points:

(1 − 3)² + (2 − 1)² = 4 + 1 = 5

Then apply the Gaussian kernel formula: multiply the squared distance by negative gamma, then raise the mathematical constant e to that power.

e^(−0.5 × 5) = e−2.5 ≈ 0.082

That single number, 0.082, is the result of an inner product between point A and point B, as if they had both been mapped into an infinite-dimensional space, calculated entirely using their original two-dimensional coordinates.

This is what let statistical machine learning fit complex, curved decision boundaries while keeping the underlying optimization problem convex, meaning it has one clear best answer instead of many false, misleading ones.

Section 07Shift two: statistics to deep learning (2012)

Statistical methods like the support vector machine still depended on a human to prepare the input, using hand-designed feature extractors such as SIFT (Scale-Invariant Feature Transform) or HOG (Histograms of Oriented Gradients) for images. Because that feature extraction step was fixed and separate from the learning algorithm's error signal, the system could never improve its own feature extraction based on what it got wrong.

That changed in 2012, at the ImageNet Large Scale Visual Recognition Challenge. A team including Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton entered a deep convolutional neural network called AlexNet.

AlexNet's actual architecture

  • Training data: 1.2 million labeled images across 1,000 object categories, resized to 224 by 224 pixels.
  • Size: 60 million trainable parameters, 650,000 neurons total.
  • Structure: 8 learned layers, 5 convolutional layers, some followed by overlapping pooling operations, and 3 fully connected layers ending in a 1,000-way output.
  • Activation function: AlexNet replaced the older, saturating activation functions (such as the sigmoid or hyperbolic tangent function) with the Rectified Linear Unit, or ReLU. ReLU is close to the simplest function you could design: if the input is positive, pass it through unchanged; if it is zero or negative, output zero. That simplicity avoided a specific failure mode of the older functions, called vanishing gradients, where the error signal used to update the network shrinks to almost nothing as it passes backward through many layers. With ReLU, a 4-layer network reached a fixed training error rate roughly 6 times faster than an equivalent network using the older saturating functions.
  • Hardware: The 60 million parameters were split across two NVIDIA GTX 580 GPUs, each with only 3 gigabytes of memory, using custom-written parallel code, since no off-the-shelf software handled this at the time.
  • Overfitting control: AlexNet used a technique called dropout, randomly disabling roughly half of the neurons in its two largest fully connected layers during each training step. This forces the network to learn patterns that do not depend on any single neuron being present, which makes the learned patterns more robust.

The result that redirected the field

AlexNet won the 2012 competition with a top-5 error rate of 15.3%, meaning the correct label appeared in the model's top five guesses 84.7% of the time. The second-place entry, built the traditional way with hand-designed SIFT and HOG features feeding a statistical classifier, scored a 26.2% error rate. An 11-point gap, in one contest, was enough evidence to redirect the field of computer vision, and soon after, most of deep learning, away from hand-engineered features and toward end-to-end learned representations.

Section 08Shift three: deep learning to the transformer and the modern LLM (2017 to today)

Before 2017, systems built to process language and other sequences, such as recurrent neural networks (RNNs) and their more capable variant, LSTMs, worked by keeping an internal state that updated one step at a time, in strict order. Step two could not begin until step one finished. This created two compounding problems: training could not be parallelized across the length of a sequence, which made it slow on the large text datasets the field wanted to use, and the error signal used for learning tended to shrink or explode as it was pushed backward across many sequential steps, which made it hard for these networks to hold onto information from early in a long passage.

The attention mechanism, precisely

In 2017, a team at Google Brain and Google Research published “Attention Is All You Need,” introducing the transformer. It removed the sequential bottleneck entirely by replacing recurrence with a mechanism called self-attention, which processes an entire sequence at once.

Here is the calculation, in plain terms. For every token in the input, the model produces three separate vectors, using three separate learned transformations: a Query vector, a Key vector, and a Value vector. Think of the Query as “what this token is looking for,” the Key as “what this token has to offer,” and the Value as “the actual content this token contributes if selected.”

To calculate attention, the model takes the dot product of every token's Query vector against every other token's Key vector. This produces a raw compatibility score between every pair of tokens in the sequence. Those raw scores are divided by the square root of the Key vector's dimension, a scaling step that keeps the numbers in a range where the next step behaves well. The scaled scores are then passed through the softmax function, row by row, converting each token's set of raw scores into a clean probability distribution over every token in the sequence: how much attention this token should pay to every other token, all values between 0 and 1, all summing to 1 for each row. Finally, each token's output is calculated as a weighted sum of every token's Value vector, weighted exactly by those attention probabilities.

Worked example: self-attention over two tokens

Take a 2-token sequence. Suppose the scaled compatibility scores for token 1, looking at both tokens, come out to 2.0 and 1.0. To convert these into probabilities, raise e to the power of each score:

e2.0 ≈ 7.39    e1.0 ≈ 2.72

Add them together: 7.39 + 2.72 = 10.11. Divide each by that sum:

7.39 / 10.11 ≈ 0.73    2.72 / 10.11 ≈ 0.27

Token 1's output becomes 73% the Value vector of token 1, plus 27% the Value vector of token 2. That is the entire mechanism, repeated for every token, against every other token, all at once.

Because this whole calculation is just matrix multiplication, it runs in parallel across a GPU instead of one step at a time. The transformer also runs several of these attention calculations side by side, called multi-head attention, so the model can track several different kinds of relationships between tokens simultaneously, not just one.

Scaling the transformer: GPT-3 (2020)

Once the sequential bottleneck was gone, researchers could scale transformers to sizes that were previously impossible to train. OpenAI's 2020 paper “Language Models are Few-Shot Learners” introduced GPT-3 and showed what happened when they did.

GPT-3's specifications: 175 billion parameters, across 96 transformer layers, each with 96 attention heads. A context window of 2,048 tokens. It trained on roughly 300 billion tokens, drawn from a filtered slice of Common Crawl web data, curated web text, two book collections, and Wikipedia. Its training objective was exactly the autoregressive next-token prediction described earlier in this lesson, nothing more exotic.

The finding that mattered most: at this scale, GPT-3 could perform brand-new tasks, described purely in the prompt, using zero, one, or a handful of examples, without any of its internal parameters being updated. This capability, called in-context learning, was not explicitly designed into the system. It emerged as a side effect of scaling the same simple training objective to a very large size.

Making it follow instructions: InstructGPT and RLHF (2022)

A model trained purely to predict the statistics of internet text is not the same as a model that reliably follows instructions or tells the truth. Raw pretrained models frequently produced confident, false statements, or simply continued a prompt in an unhelpful direction rather than answering it.

OpenAI's 2022 paper “Training language models to follow instructions with human feedback” introduced InstructGPT, using a three-stage process called Reinforcement Learning from Human Feedback, or RLHF.

  1. Supervised fine-tuning. The pretrained base model is further trained on a curated set of instructions paired with human-written example answers, teaching it the basic shape of a helpful response.
  2. Reward model training. For a given prompt, the fine-tuned model generates several candidate answers. Human reviewers rank those answers from best to worst. A separate model, called a reward model, is trained to predict a single score for any answer, such that it agrees with the human rankings: a higher score for answers people preferred.
  3. Reinforcement learning with a penalty for drifting too far. The fine-tuned model is now treated as a policy that gets updated to produce answers the reward model scores highly. But if left unconstrained, this process can push the model toward answers that fool the reward model without actually being better, a failure called reward hacking. To prevent that, a penalty term is added to the training objective, measuring how far the current policy's output distribution has drifted from the original, supervised fine-tuned model. The further it drifts, the larger the penalty.

A worked intuition for the drift penalty. Suppose the original fine-tuned model would have answered with a fairly balanced distribution across a few reasonable phrasings. If, during reinforcement learning, the policy shifts to become extremely confident in only one narrow phrasing, the measured difference between the new distribution and the original one grows, and the penalty term grows with it. This holds the policy back from collapsing onto a single, possibly reward-hacking output, and keeps it anchored near the range of behavior it learned during supervised fine-tuning.

The measured result was striking: outputs from a 1.3-billion-parameter InstructGPT model, aligned this way, were preferred by human reviewers over outputs from the base 175-billion-parameter GPT-3 model, a model over 100 times larger. Alignment, not raw scale, closed that gap. This exact technique became the direct foundation for ChatGPT, launched in November 2022.

A working note setting out the attention mechanism as four steps, the two-token worked example from raw scores to a 73 and 27 percent blend, and a table of four eras with one landmark each
Self-attention is arithmetic, not metaphor. The worked strip carries this lesson's own numbers, and each of the four eras is pinned to the paper that marked it.

Section 09Four eras, side by side

EraLandmark workCore mechanismWhat builds the featuresMain hardware limit
Symbolic AI
1950s to 1980s
Dartmouth proposal (1955)Hand-written logic and searchA human, entirelySingle-CPU memory; exponential search blowup
Statistical ML
1990s to 2000s
Support vector networks (1995)Convex optimization over kernel-mapped featuresA human designs the features; the algorithm finds the boundaryCPU compute; kernel matrix memory grows with the square of the dataset size
Deep Learning
2012 to 2016
AlexNet (2012)Backpropagation through stacked convolutional layersThe network learns its own featuresGPU memory (AlexNet ran on two 3GB GPUs)
Transformer / LLM era
2017 to present
Attention Is All You Need (2017), GPT-3 (2020), InstructGPT (2022)Self-attention plus preference alignmentThe network learns its own features, at a far larger scale, then gets aligned to human preferenceMulti-GPU cluster memory and interconnect bandwidth; attention cost grows with the square of the sequence length

Section 10The bottlenecks that remain today

Even the current transformer architecture has real, unresolved mathematical limits, worth knowing before the rest of this course builds on top of it.

  • Attention cost grows with the square of the input length. Doubling how much text a model reads at once roughly quadruples the compute and memory the attention calculation needs. This is why extremely long contexts are expensive, and why alternative designs (sparse attention, linear attention, state-space models) are an active area of work.
  • Generating text one piece at a time is limited by memory speed, not raw computing power. Every new word-piece requires pulling the stored Key and Value vectors for every earlier token back out of memory. As context grows, this memory traffic, not the GPU's raw arithmetic speed, becomes the bottleneck.
  • The training goal is statistical prediction, not truth. A model trained to minimize next-token prediction error is being trained to match the statistics of its training text, not to verify facts. When it operates outside the range of situations it was trained on, it can produce fluent, confident, wrong answers. This single point explains a great deal of what later lessons in this course cover as hallucination.

Conclusion

The five terms in this lesson nest inside each other in a fixed order, and the boundary between each layer is a specific, checkable mathematical distinction: who builds the features, whether the model estimates a label or a full data pattern, and what the training objective actually optimizes. The three historical shifts covered here, each with a clear landmark paper and a clear before-and-after number, are not just history. Each shift removed one specific bottleneck, and each remaining bottleneck today points directly at what the next shift will likely need to solve.

The next lesson builds on this one. It looks inside the training process itself: how a system searches for its parameters, one step at a time, using a fully worked numeric example.

Glossary

Artificial Intelligence (AI). Any computer system built to perform a task normally linked to human thought.
Machine Learning (ML). AI that sets its own rules by searching for parameters that minimize error on example data, instead of following rules a person wrote.
Deep Learning (DL). ML built from many stacked, trainable layers that learn their own features directly from raw data, instead of relying on a human-built feature map.
Generative AI (GenAI). Deep learning built to model the full pattern of a dataset well enough to generate new content that fits it.
Large Language Model (LLM). Generative AI built to predict text one word-piece at a time, using an autoregressive, self-attention-based architecture.
Kernel trick. A method that calculates the result of comparing two points in a high-dimensional space, using only their original, low-dimensional coordinates.
Self-attention. The transformer's core mechanism, where every token calculates how much to weigh every other token's contribution, using Query, Key, and Value vectors.
In-context learning. The ability of a large enough language model to perform a new task from examples given directly in the prompt, without updating any of its internal parameters.
RLHF (Reinforcement Learning from Human Feedback). A three-stage process (supervised fine-tuning, reward model training, and reinforcement learning with a drift penalty) used to align a model's behavior with human preference.

Further reading