Module · What it is
Defining AI — what are we actually talking about?
Lesson 5 of 12 · 10 min
A computer that plays chess was artificial intelligence. Then one beat the world champion, and it became just search. Reading handwriting was AI until your bank started doing it to cheques.
Route planning, spam filtering, face unlock, the thing that sorts your email. Every one of them was AI right up to the moment it started working properly. Then it quietly became software.
This pattern has a name. It is called the AI effect, and it leaves a problem to solve before anything can be taught.
A field cannot be defined by the things it has not done yet
The line usually attached to this comes from the computer scientist Larry Tesler, and it is usually misquoted. What he wrote was sharper than the version people repeat.
“Intelligence is whatever machines haven’t done yet.” — Larry Tesler, correcting the version everyone repeats
The popular version is a joke about a research field. Tesler's version is a claim about us. We are the ones moving the line, and we move it every time a machine crosses it.
Nothing about the chess program changed on the day it won. What changed is what we were willing to call it.
So a definition that empties itself every time the field advances is no use for a course. Something else is needed.
Four definitions, and only one of them can be scored
People have tried to pin it down properly. The attempts fall into four groups, split on two questions. Is this about a machine that thinks, or one that acts? And should it do that like a human, or do it well?
| Like a human | Rationally — i.e. well | |
|---|---|---|
| Thinking | Does it reason the way our minds do? Studied by modelling human cognition and checking the machine matches. | Does it follow valid logic? If the premises are true and the rules are sound, the conclusion follows. |
| Acting | Could it pass for a person? This is the Turing test’s question, and it is about being convincing. | Does it do the right thing to get the result it is after? No claim about what happens inside. |
Thinking
- Like a human
- Does it reason the way our minds do? Studied by modelling human cognition and checking the machine matches.
- Rationally — i.e. well
- Does it follow valid logic? If the premises are true and the rules are sound, the conclusion follows.
Acting
- Like a human
- Could it pass for a person? This is the Turing test’s question, and it is about being convincing.
- Rationally — i.e. well
- Does it do the right thing to get the result it is after? No claim about what happens inside.
The bottom-right cell won. Nobody proved the other three wrong. It won for a practical reason.
It is the only one you can score. You can check whether a system achieved the result it aimed at. You cannot check whether it understood anything.
Of the four cells above, exactly 1 of 4 produces a number.
Every accuracy figure in this Academy exists because the field settled on a definition that can be measured. Had AI been defined as thinking like us, there would be nothing to put in the report.
An agent perceives its environment and acts to maximise a performance measure
That is the definition this course uses.
- Agent. Something that acts on its own. A spreadsheet is not an agent. A system that watches your inbox and files things is.
- Perceives. It has some view of the world. Rows in a database, an email, a camera. It can only be intelligent about what it can see.
- Acts. It changes the world, or changes what somebody else does. A prediction nobody reads is not an action.
- A performance measure. Somebody decided what good means and wrote it down. This is the word everybody skips.
A system with no scorecard is not intelligent. It is busy. The first useful question about any AI system is never what model is it? It is what is it scored on, and who chose that?
One room, four agents, and one line of code between the first two
Here is the definition with its sleeves rolled up. A five-by-five room with dirt in about 9.5 squares. A machine gets 60 steps. Each step it sees one thing — where am I, and is this square dirty — and does one thing.
- Random. Ignores what it sees. It acts, so it is an agent, but it perceives nothing.
- Reflex. One if. It looks at the square it is standing on. No memory.
- Remembers. Keeps track of where it has been and sweeps the room in rows.
- Human-like. Doubles back to check its own work, and now and then pauses.
They differ by about three lines of code each. None of them is an algorithm in any grand sense.
Random cleans 2.4 squares. Reflex cleans 6.1. The only difference between them is that Reflex looks at the square it is standing on. That is one line of code.
Perceiving and acting are the two things being paid for in that definition. Here you can see the price of each. One percept is worth 6.1 minus 2.4 squares. Remembering is worth the rest.
Change the scorecard and a different agent wins
Remembers wins, and the ranking looks like a fact about the machines. It is a fact about the scorecard.
Somebody chose squares cleaned. Somebody in the same building could say that driving a motor across a room costs electricity, and ask for cleaning minus what it cost.
Under the second scorecard the winner is Human-like, the one that dawdles. It moved 41.2 times where Remembers moved 50.5. And every bar is below zero.
This scorecard pays a machine to stay in its corner
Nobody set out to write that, and that is the danger. Somebody priced electricity at 0.6 and the measure quietly started paying a machine for not working. It would keep paying, in production, for as long as nobody looked.
The scorecard is not part of the machine. It is a choice made about the machine, usually by a person who will never look at it again.
Machine learning is one way of building AI, not a synonym for it
Two things in that picture are worth saying out loud, because the usual version gets both wrong.
- There is AI that does no learning at all. Rule-based systems and search sit inside the outer ring and outside the middle one. Your maps app is search.
- Statistics is not an inner ring. It is an older, separate discipline that machine learning borrowed most of its machinery from.
It is currently the dominant way of building AI, which is why the words get used interchangeably. They are not the same word.
Every working AI system today is built for one job
Everything above is sometimes called narrow AI: a system built for one job and scored on one measure. That includes the ones that feel like they are not.
Artificial general intelligence names something else. A system that could take on an unfamiliar problem the way a person can, without being rebuilt for it.
You will hear the term constantly, so it is worth knowing what it is. It is a claim about the future, not a category of product you can buy. This course takes no position, and nothing in the next fifteen paths depends on the answer.
Ask what it perceives, what it does, and what it is scored on
You now have a definition that survives the technology improving. And a test you can apply to anything calling itself AI.
content/notebooks/introduction-to-ai/what-are-we-actually-talking-about.ipynb
Change the price of electricity and watch the winner change with it. Then try writing a scorer for “thinks like a human”. The exercise is discovering that you cannot.
Show the code6 cells
import random
SIZE, STEPS, TRIALS = 5, 60, 400
MOVES = {'N': (-1, 0), 'S': (1, 0), 'E': (0, 1), 'W': (0, -1)}
def new_room(seed):
rng = random.Random(seed)
dirt = {(r, c) for r in range(SIZE) for c in range(SIZE) if rng.random() < 0.4}
dirt.discard((0, 0))
return dirt, rng
def percept(pos, dirt):
"""Everything the agent is allowed to know: where it is, and whether
THIS square is dirty. It cannot see the rest of the room."""
return pos, pos in dirt
record('room_size', f'{SIZE}x{SIZE}')
record('steps', STEPS)
record('trials', TRIALS)
record('avg_dirt', round(sum(len(new_room(s)[0]) for s in range(TRIALS)) / TRIALS, 1))def random_agent(pos, dirty, memory, rng):
"""Ignores the percept completely. It is an agent — it acts — but it does
not perceive, so it sucks at empty squares and drives past dirty ones."""
return rng.choice(['suck'] + list(MOVES))
def reflex_agent(pos, dirty, memory, rng):
"""The whole difference from Random is one `if`: it LOOKS at the square it
is standing on. No memory, though — it cannot tell a square it has already
done from one it has not."""
if dirty: return 'suck'
return rng.choice(list(MOVES))
def systematic_agent(pos, dirty, memory, rng):
"""Model-based: it remembers where it has been, and walks the room in
boustrophedon order — along a row, down, back along the next."""
if dirty: return 'suck'
r, c = pos
memory.add(pos)
going_east = (r % 2 == 0)
ahead = (r, c + 1) if going_east else (r, c - 1)
if 0 <= ahead[1] < SIZE: return 'E' if going_east else 'W'
return 'S' if r + 1 < SIZE else ('W' if c > 0 else 'N')
def humanish_agent(pos, dirty, memory, rng):
"""Written to look like a person doing the job: doubles back to check its
own work, and now and then does nothing at all."""
if dirty: return 'suck'
if rng.random() < 0.25: return 'wait' # a pause
if memory and rng.random() < 0.35: # go back and check
return rng.choice(list(MOVES))
memory.add(pos)
return rng.choice(list(MOVES))
AGENTS = [
('Random', random_agent),
('Reflex', reflex_agent),
('Remembers', systematic_agent),
('Human-like', humanish_agent),
]
record('n_agents', len(AGENTS))MOVE_COST = 0.6
def run(agent, seed):
dirt, rng = new_room(seed)
started = len(dirt)
pos, memory, moves = (0, 0), set(), 0
for _ in range(STEPS):
where, dirty = percept(pos, dirt)
action = agent(where, dirty, memory, rng)
if action == 'suck':
dirt.discard(pos)
elif action in MOVES:
dr, dc = MOVES[action]
nxt = (pos[0] + dr, pos[1] + dc)
if 0 <= nxt[0] < SIZE and 0 <= nxt[1] < SIZE:
pos = nxt
moves += 1
cleaned = started - len(dirt)
return cleaned, moves
scores = {}
for name, agent in AGENTS:
runs = [run(agent, s) for s in range(TRIALS)]
cleaned = sum(c for c, _ in runs) / TRIALS
moves = sum(m for _, m in runs) / TRIALS
scores[name] = {
'cleaned': round(cleaned, 1),
'moves': round(moves, 1),
'net': round(cleaned - MOVE_COST * moves, 1),
}
for name, s in scores.items():
print(f"{name:12} cleaned {s['cleaned']:5} moves {s['moves']:5} net {s['net']:6}")
record('move_cost', MOVE_COST)
for name, s in scores.items():
key = name.lower().replace('-', '_')
record(f'{key}_cleaned', s['cleaned'])
record(f'{key}_moves', s['moves'])
record(f'{key}_net', s['net'])names = [n for n, _ in AGENTS]
cleaned = [scores[n]['cleaned'] for n in names]
net = [scores[n]['net'] for n in names]
winner_clean = max(names, key=lambda n: scores[n]['cleaned'])
winner_net = max(names, key=lambda n: scores[n]['net'])
record('winner_cleaned', winner_clean)
record('winner_net', winner_net)
record('scorecard_changes_winner', 'yes' if winner_clean != winner_net else 'no')
def plot_cleaned(ax):
bars = ax.bar(names, cleaned, color=['#9aa1ab', '#9aa1ab', '#ee785b', '#9aa1ab'])
for b, v in zip(bars, cleaned):
ax.text(b.get_x() + b.get_width() / 2, v + 0.15, f'{v}', ha='center', fontsize=11)
ax.set_ylabel('squares cleaned')
ax.set_ylim(0, max(cleaned) * 1.25)
ax.spines[['top', 'right']].set_visible(False)
save_fig('who-cleaned-most', plot_cleaned, figsize=(7, 4))def plot_two_scorecards(ax):
x = range(len(names))
w = 0.38
ax.bar([i - w / 2 for i in x], cleaned, w, label='squares cleaned', color='#9aa1ab')
ax.bar([i + w / 2 for i in x], net, w, label='cleaned minus electricity', color='#ee785b')
ax.axhline(0, color='#6b7280', linewidth=0.8)
for i, (c, n) in enumerate(zip(cleaned, net)):
ax.text(i - w / 2, c + 0.2, f'{c}', ha='center', fontsize=10)
ax.text(i + w / 2, n + (0.2 if n >= 0 else -0.9), f'{n}', ha='center', fontsize=10)
ax.set_xticks(list(x)); ax.set_xticklabels(names)
ax.set_ylabel('score')
ax.legend(frameon=False, fontsize=10)
ax.spines[['top', 'right']].set_visible(False)
save_fig('two-scorecards', plot_two_scorecards, figsize=(7.6, 4.2))
print('best at cleaning:', winner_clean)
print('best once movement costs something:', winner_net)definitions = ['Thinking\nlike a human', 'Thinking\nrationally',
'Acting\nlike a human', 'Acting\nrationally']
scoreable = [0, 0, 0, 1]
record('definitions', len(definitions))
record('definitions_scored', sum(scoreable))
def plot_scoreable(ax):
ax.bar(definitions, [1, 1, 1, 1], color='#eceef1')
ax.bar(definitions, scoreable, color='#ee785b')
for i, s in enumerate(scoreable):
ax.text(i, 0.5, 'a number' if s else 'no test', ha='center', va='center',
fontsize=10, color='#ffffff' if s else '#6b7280')
ax.set_yticks([])
ax.spines[['top', 'right', 'left']].set_visible(False)
save_fig('what-can-be-scored', plot_scoreable, figsize=(7.6, 3.4))Next we open the box. If machine learning is only one way of building AI, what are the others, and why did this one take over? The next lesson maps every approach the field has tried, sorted by one question: where does the knowledge come from?
Further reading. The four-definition framing is the opening chapter of Russell and Norvig’s Artificial Intelligence: A Modern Approach, the standard text for the field. Tesler’s own correction of his famous line is on his site.

