Acknowledgments
Preface
Chapter 1: And Away We Go: An AI Overview
Chapter 2: Why Now? A History of AI
Chapter 3: Classical Models: Old-School Machine Learning
Chapter 4: Neural Networks: Brain-Like AI
Chapter 5: Convolutional Neural Networks: AI Learns to See
Chapter 6: Generative AI: AI Gets Creative
Chapter 7: Large Language Models: True AI at Last?
Chapter 8: Musings: The Implications of AI
1
AND AWAY WE GO: AN AI OVERVIEW
Artificial intelligence attempts to coax a machine, typically a computer, to behave in ways humans
judge to be intelligent. The phrase was coined in the 1950s by prominent computer scientist John
McCarthy (1927–2011).
This chapter aims to clarify what AI is and its relationship to machine learning and deep learning,
two terms you may have heard in recent years. We’ll dive in with an example of machine learning
,in action. Think of this chapter as an overview of AI as a whole. Later chapters will build on and
review the concepts introduced here.
****
Computers are programmed to carry out a particular task by giving them a sequence of instructions,
a program, which embodies an algorithm, or the recipe that the program causes the computer to
execute.
The word algorithm is cast about often these days, though it isn’t new; it’s a corruption of Al-
Khwarizmi, referring to ninth-century Persian mathematician Muhammad ibn Musa al-Khwarizmi,
whose primary gift to the world was the mathematics we call algebra.
****
Let’s begin with a story.
Tonya owns a successful hot sauce factory. The hot sauce recipe is Tonya’s own, and she guards
it carefully. It’s literally her secret sauce, and only she understands the process of making it.
Tonya employs one worker for each step of the hot sauce–making process. These are human
workers, but Tonya treats them as if they were machines because she’s worried they’ll steal her
hot sauce recipe—and because Tonya is a bit of a monster. In truth, the workers don’t mind much
because she pays them well, and they laugh at her behind her back.
Tonya’s recipe is an algorithm; it’s the set of steps that must be followed to create the hot sauce.
The collection of instructions Tonya uses to tell her workers how to make the hot sauce is a
program. The program embodies the algorithm in a way that the workers (the machine) can follow
step by step. Tonya has programmed her workers to implement her algorithm to create hot sauce.
The sequence looks something like this:
There are a few things to note about this scenario. First, Tonya is definitely a monster for treating
human beings as machines. Second, at no point in the process of making hot sauce does any worker
need to understand why they do what they do. Third, the programmer (Tonya) knows why the
machine (the workers) does what it does, even if the machine doesn’t.
****
What I’ve just described is how we’ve controlled virtually all computers, going back to the first
conceptual machines envisioned by Alan Turing in the 1930s and even earlier to the 19th-century
Analytical Engine of Charles Babbage. A human conceives an algorithm, then translates that
algorithm into a sequence of steps (a program). The machine executes the program, thereby
, implementing the algorithm. The machine doesn’t understand what it’s doing; it’s simply
performing a series of primitive instructions.
The genius of Babbage and Turing lay in the realization that there could be a general-purpose
machine capable of executing arbitrary algorithms via programs. However, I would argue that it
was Ada Lovelace, a friend of Babbage’s often regarded as the world’s first programmer, who
initially understood the far-reaching possibilities of what we now call a computer. We’ll talk more
about Turing, Babbage, and Lovelace in Chapter 2.
NOTE
In Lovelace’s day, a “computer” was not a machine but a human being who calculated by hand.
Hence, Babbage’s Engine was a mechanical computer.
Let’s take a moment to explore the relationship between the terms AI, machine learning, and deep
learning. On the one hand, all three have become synonymous as referring to modern AI. This is
wrong, but convenient. Figure 1-1 shows the proper relationship between the terms.
Figure 1-1: The relationship between artificial intelligence, machine learning, and deep learning
Deep learning is a subfield of machine learning, which is a subfield of artificial intelligence. This
relationship implies that AI involves concepts that are neither machine learning nor deep learning.
We’ll call those concepts old-school AI, which includes the algorithms and approaches developed
from the 1950s onward. Old-school AI is not what people currently mean when discussing AI.
Going forward, we’ll entirely (and unfairly) ignore this portion of the AI universe.
Machine learning builds models from data. For us, a model is an abstract notion of something that
accepts inputs and generates outputs, where the inputs and outputs are related in some meaningful
way. The primary goal of machine learning is to condition a model using known data so that the
model produces meaningful output when given unknown data. That’s about as clear as muddy
water, but bear with me; the mud will settle in time.