What AI Is, and What It Is Not
Defining artificial intelligence
There is no single agreed definition, which is part of why arguments about AI get heated. Three useful ones:
| Source | Definition |
|---|---|
| John McCarthy, who coined the term | "The science and engineering of making intelligent machines, especially intelligent computer programs" |
| A practical definition | Computer systems that do tasks which would need intelligence if a person did them: seeing, understanding language, reasoning, learning and deciding |
| The EU AI Act (2024) | In summary, a machine-based system that works with some level of autonomy and infers from the input it receives how to produce outputs such as predictions, content, recommendations or decisions |
The key word in the legal definition is infers. A calculator follows a fixed formula. An AI system works out how to turn its input into an output, usually because it learned how from examples.
Narrow, general and super
| Kind | Meaning | Exists? |
|---|---|---|
| Narrow AI | Very good at one task or a family of tasks: recognising faces, translating, playing Go | Yes, everywhere |
| General AI (AGI) | As capable as a person across almost any intellectual task, able to learn new ones | Not yet, and experts disagree on when or whether |
| Superintelligence | Far beyond the best humans at nearly everything | Hypothetical |
Today's large language models are a puzzle for this table. They are far more general than earlier narrow AI, writing code, poems and maths, yet still fail at some things a child can do. Most researchers describe them as broad but not yet general.
AI is building systems that turn inputs into useful outputs by recognising patterns, mostly patterns they learned from data. That is less mysterious than the films, and far more useful.
The AI family: AI, machine learning, deep learning, generative AI
The four terms you hear most fit inside each other like nesting bowls.
| Term | What it is | Example |
|---|---|---|
| Artificial intelligence | The whole field: any technique that makes a machine act intelligently, including hand-written rules and search | A chess program searching moves, a route planner |
| Machine learning (ML) | AI that learns its behaviour from data instead of being given rules | A spam filter that learns from emails people have marked |
| Deep learning | Machine learning with neural networks of many layers | Face unlock, speech recognition |
| Generative AI | Deep learning models that create new content: text, images, audio, video, code | A chatbot, an image generator |
Fields named after tasks
AI is also divided by the task, and each task can be tackled with any method:
- Computer vision: understanding images and video
- Natural language processing (NLP): understanding and producing human language
- Speech: turning sound into words and back
- Robotics: sensing and moving in the physical world
- Planning and search: finding a sequence of actions that reaches a goal
- Recommendation: predicting what a person will want next
Since about 2012, deep learning has become the best method for almost all of them, which is why the words are often used as if they meant the same thing. They do not.
Traditional programming versus machine learning
This is the most important idea in the whole course.
In traditional programming, a person writes the rules. The computer applies the rules to data and produces answers.
In machine learning, a person supplies data and the answers, and the computer works out the rules. The rules it learns are called a model. The model is then used to produce answers for new data it has never seen.
Why learn the rules?
Try writing rules to recognise a cat in a photo. Pointy ears? Some cats have folded ears, and so do foxes. Whiskers? Hidden in half the photos. Fur colour? Every colour. Every rule has exceptions, and the exceptions have exceptions.
But it is easy to collect a hundred thousand photos labelled "cat" and "not cat". Machine learning turns that pile of examples into a model that recognises cats better than any rule list could.
If the rules are known, simple and must be exactly right, write them. VAT at 20%, a bank's opening hours or the rules of chess should never be learned. Machine learning is for problems where the rules are too many, too fuzzy or unknown.
Perceive, decide, act: AI as an agent
In the most widely used AI textbook, Artificial Intelligence: A Modern Approach, Stuart Russell and Peter Norvig define AI as the study of agents: things that perceive their environment and act on it to achieve goals.
| Agent | Sensors (perceive) | Decides | Actuators (act) |
|---|---|---|---|
| Self-driving car | Cameras, radar, GPS | Where to steer, when to brake | Steering, brakes, accelerator |
| Robot vacuum | Bump sensors, cliff sensors, camera | Which way to go next | Wheels, brushes |
| Chess program | The board position | Which move scores best | Making the move |
| Video recommender | What you watched, skipped and liked | What to show next | The thumbnails on your screen |
| AI assistant | Your message, files, search results | What to say or which tool to use | Text, actions in other apps |
From simple to clever
- A simple reflex agent reacts to what it senses now: a thermostat switches the heating on below 19 °C.
- A model-based agent keeps track of things it cannot currently see: a robot remembers where the stairs were.
- A goal-based agent plans actions to reach a goal: a satnav.
- A utility-based agent weighs how good each outcome is: a satnav that trades speed against tolls.
- A learning agent improves its own behaviour from experience. Most of this course is about how that learning works.
What today's AI is good and bad at
| Good at | Weak at |
|---|---|
| Finding patterns in huge amounts of data | Common sense that nobody wrote down |
| Recognising images, speech and handwriting | Situations unlike anything in its training data |
| Producing fluent text, images and code | Knowing when it is wrong: it can state falsehoods confidently, called hallucination |
| Doing the same task millions of times without tiring | Explaining why it made a decision |
| Games with clear rules and scores | Learning from one or two examples, as a child can |
| Predicting what usually happens next | Telling cause from coincidence |
A language model is trained to produce text that is likely, not text that is true. Most of the time likely and true agree. When they do not, the model sounds just as sure of itself. Always check facts that matter.
Moravec's paradox
Reasoning that humans find hard can be easy for computers, while perception and movement that humans find effortless can be very hard. A computer beat the world chess champion in 1997. A robot that can tidy any child's bedroom still does not exist.
Hands-on: a spam filter written two ways
Rules versus learning, in code
Both filters below decide whether a message is spam. The first uses rules a person wrote. The second counts how often each word appeared in eight labelled examples and learns which words point to spam.
def rule_filter(message):
rules = ["win", "free", "prize", "click"] # written by a person
return any(word in message.lower().split() for word in rules)
training = [
("win a free prize now", "spam"),
("claim your free gift card today", "spam"),
("cheap pills click here", "spam"),
("you have won cash reply now", "spam"),
("are we still meeting for lunch", "ham"),
("here are the notes from class", "ham"),
("can you send me the homework", "ham"),
("happy birthday see you at the party", "ham"),
]
# Learning: count each word's appearances in spam and in normal mail (ham)
counts = {"spam": {}, "ham": {}}
for message, label in training:
for word in message.split():
counts[label][word] = counts[label].get(word, 0) + 1
def learned_filter(message):
score = 0
for word in message.lower().split():
score += counts["spam"].get(word, 0) - counts["ham"].get(word, 0)
return score > 0
tests = ["claim your cash now", "send me the class notes",
"free pizza at lunch for the team", "you won a gift card"]
for t in tests:
by_rules = "spam" if rule_filter(t) else "ham"
by_learning = "spam" if learned_filter(t) else "ham"
print(f"{t:34} rules: {by_rules:5} learned: {by_learning}")The rules miss two spam messages because they contain none of the four magic words, and they flag a perfectly normal message about free pizza. The learned filter gets all four right because it weighs every word, using evidence from the examples.
Try this
- Add the test
"click here for the class notes". Which filter gets it right? - Look at
counts["ham"]["the"]. The learned filter has decided "the" is a sign of normal mail, only because it appeared in three normal messages. What does that tell you about learning from only eight examples? - Add four more labelled messages of your own and run it again.
Activity: spot the AI
List ten pieces of technology you used in the last 24 hours. For each, decide whether it uses no AI, rules, or learning from data, and what its sensors, decisions and actions are. Compare your list with a partner's and argue about the borderline cases.
Level check
- Give two definitions of AI and explain what the word "infers" adds
- Explain the difference between narrow AI and general AI, with examples
- Draw the AI family as nested circles and give an example for each ring
- Explain how machine learning differs from traditional programming
- Describe an AI system as an agent: its sensors, decisions and actions
- Give three things today's AI is good at and three it is weak at
Key terms you must be able to define
- Artificial intelligence (AI)
- Computer systems that do tasks which would need intelligence if a person did them, usually by recognising patterns.
- Narrow AI
- AI that performs one task or a family of related tasks very well. All AI that exists today is at most broad, not general.
- Artificial general intelligence (AGI)
- A hypothetical AI as capable as a person across almost any intellectual task.
- Machine learning
- AI that learns its behaviour from data instead of following rules a person wrote.
- Deep learning
- Machine learning that uses neural networks with many layers.
- Generative AI
- Models that create new content, such as text, images, audio, video or code.
- Model
- The learned rules: a function with adjustable numbers that turns inputs into outputs.
- Agent
- Something that perceives its environment through sensors and acts on it through actuators to achieve goals.
- Hallucination
- A confident output from an AI model that is false or made up.
- Moravec's paradox
- The observation that reasoning is easy for computers while perception and movement, effortless for people, are hard.
Flashcards
Go further: notes for future AI engineers
How engineers decide whether a problem needs ML
Before any model is built, a good engineer asks four questions:
- Is there a pattern to learn? If the outcome is random, no model can predict it.
- Is it hard to write the rules? If a short rule list would work, use it: it is cheaper, faster and easier to test.
- Is there data? Usually thousands of examples, with labels if the task is supervised.
- Can mistakes be tolerated? A model will be wrong some of the time. A film recommendation can afford that. A dose of medicine needs a human check.
Google's well-known Rules of Machine Learning guide opens with exactly this advice: do not be afraid to launch a product without machine learning.
Misconceptions to avoid
- Using AI, machine learning and deep learning as if they mean the same thing. Each is a smaller part of the one before.
- Thinking all AI learns. Route planners, chess searchers and expert systems are AI with no learning at all.
- Believing that a fluent answer must be a correct one. Language models are trained to be likely, not to be true.
- Assuming AI understands the way people do. It finds patterns in data, which can look like understanding and sometimes is not.
- Thinking machine learning should replace all rules. If the rules are known and must be exact, write them.
Hans Moravec noticed in 1988 that the things humans find hard, such as chess and algebra, are easy for computers, while the things a toddler does without thinking, such as walking across a cluttered room or picking up a sock, are fiendishly hard. It is called Moravec's paradox, and robots still feel it.
Knowledge check
Check you could explain this
- LIn traditional programming a person writes the rules
- LThe computer applies the rules to data to give answers
- LIn machine learning the computer is given data and answers / examples
- LIt learns the rules, the model, itself
In traditional programming a person writes the rules, and the computer applies those rules to data to produce answers. In machine learning the person supplies data together with the correct answers, as labelled examples, and the computer works out the rules for itself. The learned rules are called a model, which is then used to produce answers for new data it has never seen.
- LRules for faces are very hard to write
- LFaces vary: lighting, angle, expression, glasses, hair
- LMachine learning can learn patterns from labelled photos
- LIt needs enough photos of each student
- LIt will sometimes be wrong, so mistakes need handling
- LPrivacy or consent concerns about storing faces
Hand-written rules would be almost impossible here, because nobody can describe a particular face precisely enough, and the same face changes with lighting, angle, expression, glasses and hair. Every rule would have exceptions. Machine learning suits the problem, because it can learn the patterns that distinguish each student from labelled photos. However, it needs several photos of every student, it will sometimes misidentify someone, so there must be a way to handle mistakes, and storing biometric data about children raises serious privacy and consent issues under data protection law. Machine learning is the right technique, but only with consent, security and a human fallback.
- LSensors such as cameras, radar or GPS perceive the environment
- LIt decides what to do, such as when to brake or where to steer
- LActuators such as steering, brakes or accelerator act
A self-driving car perceives its environment through sensors such as cameras, radar and GPS. Its software decides what to do next, such as when to brake, how fast to go and where to steer, to reach its goal safely. It then acts on the world through actuators: the steering, brakes and accelerator.