Simple Algorithm
Artificial Intelligence · Input Layer · 16 min

What Is Artificial Intelligence?

Definitions, history and the idea of a rational agent.

A thermostat, a chess engine and a chatbot all turn what they sense into what they do. Which of them is intelligent? AI's working answer is refreshingly practical: build agents that act well, then measure how well they act.

What you’ll learn

  • Compare the four classic definitions of AI and explain why the field settled on rational agents.
  • Describe any AI system as an agent, with its performance measure, environment, actuators and sensors (PEAS).
  • Explain why "rational" means maximizing expected performance, not being right every time.
  • Sketch AI's history, from the Dartmouth workshop through two winters to the deep learning era.
  • Name the core math of AI and carry out one step of gradient descent by hand.

Four answers to one question

What would convince you that a machine is intelligent? Researchers have given four kinds of answer. They differ on two questions: do we care about how a system thinks or how it acts, and is the yardstick a human or an ideal of rationality?

FocusMeasured against humansMeasured against an ideal
ThinkingCognitive modeling: does it reason the way people do?Laws of thought: does it reason by correct logic?
ActingThe Turing test: can it pass for a person in conversation?Rational agents: does it act to achieve the best expected outcome?
The four approaches, in Russell and Norvig's framing. This course, like most of modern AI, works in the bottom-right cell.

The bottom-right cell won out because it is both general and measurable: you can score behavior without first settling what thinking is. In this course, artificial intelligence means building rational agents: systems that act to achieve the best expected outcome.

Most systems you will meet are narrow AI: a chess engine is superhuman at chess and useless at everything else. Whether today's general-purpose language models are steps toward artificial general intelligence is hotly debated, and there is no agreed definition or test for it.

Check your understanding

A company judges its delivery-routing AI only by fuel saved and parcels delivered on time. It does not care how the system reaches its decisions. Which approach to AI is that?

  1. Thinking humanly
  2. Thinking rationally
  3. Acting humanly
  4. Acting rationally
Show the answer

D. Acting rationally

The company scores behavior against an ideal (the best achievable fuel use and punctuality), not against how a person would drive or reason. That is the rational-agent view.

Agents: percepts in, actions out

An agent is anything that perceives its environment through sensors and acts on it through actuators. At each moment it receives a percept, and its behavior is a rule that maps everything it has perceived so far to an action. A robot vacuum is an agent. So are a spam filter and a trading bot.

Before designing one, you pin down its task with PEAS: the Performance measure, the Environment, the Actuators and the Sensors.

AgentPerformance measureEnvironmentActuatorsSensors
Robot vacuumFloor cleaned, battery usedRooms, furniture, dirt, petsWheels, brushes, suctionBump and dirt sensors, camera
Self-driving taxiSafe, legal, fast, comfortable tripsRoads, traffic, pedestrians, weatherSteering, throttle, brakes, signalsCameras, lidar, radar, GPS
Two agents described with PEAS. The performance measure comes first because it defines what "doing well" means.
Think first Is a thermostat an agent?

Yes, a very simple one. Its percept is the temperature, its action is heater on or off, and its rule is one comparison with the set point. Being an agent says nothing about being smart. How intelligent an agent is shows up in how well it scores on its performance measure.

Rational is not the same as perfect

A rational agent picks the action that maximizes the expected value of its performance measure, given what it has perceived and what it knows. "Expected" is the key word. The world can surprise it, so a rational agent can lose, and a foolish one can get lucky.

Below is a tiny world. One exit pays +1 and the other −1, but the floor is slippery: 20% of the time a move goes sideways. Once the values settle, each arrow is the best action in its cell, and each number is the reward the agent can expect to collect from there.

Check your understanding

An agent takes a move with a 90% chance of success, the best option it had, and the move fails. What follows?

  1. It acted irrationally: a rational agent would have known the move would fail
  2. It may still have acted rationally: it chose the best action given what it knew
  3. Its performance measure must be wrong
  4. Rational agents never take risks, so it was not rational
Show the answer

B. It may still have acted rationally: it chose the best action given what it knew

Rationality is judged by the decision, not the outcome. Picking the best bet available is rational even when the 10% case happens. Demanding a correct guess every time would require omniscience.

Symbols, rules and two winters

In the summer of 1956 a workshop at Dartmouth College gave the field its name. The proposal by John McCarthy, Marvin Minsky, Nathaniel Rochester and Claude Shannon rested on a bold conjecture: that "every aspect of learning or any other feature of intelligence can in principle be so precisely described that a machine can be made to simulate it."

For three decades the leading approach was symbolic AI: write knowledge down as symbols and rules, then reason with search and logic. It produced theorem provers, game players and, in the 1980s, commercial expert systems that captured specialists' know-how in thousands of if–then rules.

WhenMilestone
1950Turing proposes the imitation game
1956The Dartmouth workshop names the field
1958Rosenblatt's perceptron learns from examples
1969Minsky and Papert's Perceptrons proves what single-layer networks cannot compute
mid-1970sFirst AI winter: results fall short of promises, and funding is cut
1980sExpert-system boom; backpropagation is popularized (1986)
late 1980s–early 1990sSecond winter: expert systems prove brittle and costly to maintain
1997IBM's Deep Blue defeats world chess champion Garry Kasparov
2012AlexNet wins the ImageNet challenge: about 15% top-5 error vs 26% for the runner-up
2016AlphaGo defeats Go champion Lee Sedol 4–1
2017–2022The transformer (2017), GPT-3 (2020), ChatGPT (2022)

Learning wins, eventually

A rival tradition, connectionism, held that intelligence should be learned by networks of simple units. Frank Rosenblatt's perceptron learned to classify inputs by nudging its weights after every mistake. But a single perceptron can only draw one straight line through its inputs. Try it on two logic gates.

Networks with a hidden layer can compute XOR, and backpropagation, popularized in 1986, showed how to train them. Making them work on real problems also took large datasets and fast hardware such as GPUs. When all three came together in the early 2010s, deep learning swept speech and image recognition, and later language.

The math toolkit

Four kinds of math run through this whole course:

  • Vectors: data as lists of numbers. A 28×28 grayscale image is a vector of 784 pixel values.
  • Probability: probability measures uncertainty, and Bayes' rule updates it when evidence arrives.
  • Derivatives: a derivative says how fast an output changes when you nudge an input. The gradient does this for many inputs at once.
  • Optimization: learning means adjusting parameters to shrink a loss that scores the model's mistakes.

Combine the last two and you get gradient descent, the engine of modern machine learning. Measure the slope of the loss, then take a step downhill:

wnew=w−η dLdww_{\text{new}} = w - \eta \, \frac{dL}{dw}
The step size η\eta is the learning rate.
Predict before you look

Take the loss L(w)=w2L(w) = w^2, whose slope is 2w2w. Start at w=3w = 3 with learning rate η=0.1\eta = 0.1. Where is ww after one step?

Show the answer

2.4

The slope at w=3w = 3 is 2⋅3=62 \cdot 3 = 6, so wnew=3−0.1⋅6=2.4w_{\text{new}} = 3 - 0.1 \cdot 6 = 2.4. Each step shrinks ww by 20%, gliding toward the minimum at 00. With η=1.1\eta = 1.1 the step would land at 3−6.6=−3.63 - 6.6 = -3.6, farther from the minimum than where it started. Repeat that and you diverge.

Hidden Layer lessonWhat you will do there
Intelligent Agents & EnvironmentsClassify environments, build reflex, model-based, goal-based and utility-based agents, and make "rational" precise with expected utility.
A Short History of AIFollow the field from Dartmouth through the expert-system boom and two winters to deep learning, and ask why some ideas scaled.
The Math Toolkit of AIWork with vectors, probability, gradients and optimization, and meet entropy and cross-entropy, the language of learning.
In the Hidden Layer, each idea from this lesson gets its full machinery.

Key takeaways

  • AI can be defined by thinking or acting, measured against humans or against an ideal. Most of the field builds rational agents that act to maximize expected performance.
  • Any AI system can be framed as an agent mapping percepts to actions; PEAS (performance, environment, actuators, sensors) pins down its task.
  • Rational is not omniscient: a good decision can turn out badly, and changing the performance measure changes what is rational.
  • AI has swung between hand-built knowledge (symbolic AI, expert systems) and learning from data (connectionism), with two winters along the way. Since about 2012, deep learning has dominated.
  • The core math is vectors, probability, derivatives and optimization. Gradient descent combines the last two: step downhill on the loss.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

For an email spam filter, which of these is the performance measure?

  1. The text and headers of each incoming message
  2. Moving each message to the inbox or the spam folder
  3. The fraction of mail sorted correctly, with lost real mail counted as the worst error
  4. The stream of email arriving at the server
Show the answer

C. The fraction of mail sorted correctly, with lost real mail counted as the worst error

The performance measure is the designer's score for the agent's behavior. Here it is sorting accuracy, weighted by how costly each kind of mistake is.

Question 2

What does the Turing test actually check?

  1. Whether a machine's text conversation can pass for a person's
  2. Whether a machine understands what it says
  3. Whether a machine reasons by correct logic
  4. Whether a machine maximizes its expected performance
Show the answer

A. Whether a machine's text conversation can pass for a person's

The test is purely behavioral and uses a human as the yardstick: "acting humanly". It says nothing direct about inner understanding or logical correctness.

Question 3

Why could Rosenblatt's single-layer perceptron never learn XOR?

  1. It needed more training epochs
  2. Its learning rate was too large
  3. XOR has too many input combinations
  4. No single straight line separates XOR's 1s from its 0s
Show the answer

D. No single straight line separates XOR's 1s from its 0s

A single perceptron outputs 1 on one side of a line and 0 on the other. XOR's two 1s, (0, 1) and (1, 0), sit on opposite corners, so no line separates them from the 0s. A hidden layer fixes this.

Question 4

While training a model, the loss jumps around and gets larger with every step. What is the most likely culprit?

  1. The learning rate is too small
  2. The learning rate is too large
  3. The loss has no minimum
  4. Gradient descent only works on straight-line models
Show the answer

B. The learning rate is too large

Each step overshoots the valley and lands higher up the other side, so the error grows. Lowering the learning rate usually cures it.

Question 5

In the slippery grid world you change only the reward per step, and the agent's arrows change. Why?

  1. The world's physics changed
  2. The agent discovered new walls
  3. What counts as a good outcome changed, so the best actions changed
  4. Rational agents act randomly when rewards change
Show the answer

C. What counts as a good outcome changed, so the best actions changed

Walls, exits and the slip probability stayed the same. Changing the reward per step changes the performance measure, and a rational agent's best action depends on it.

Go deeper

Further reading

  • S. Russell & P. Norvig, Artificial Intelligence: A Modern Approach, 4th ed. (Pearson, 2020), chapters 1–2.
  • A. M. Turing, "Computing Machinery and Intelligence," Mind 59 (1950), 433–460.