- Foundation
- About 15 min
- 5 practice questions
AI versus machine learning: rules-based systems, learning systems and deep learning
Explain how AI, machine learning and deep learning fit inside one another, compare rules-based systems with learning systems, and use the words data, model, training and inference correctly.
If something looks wrong, please tell us.
By the end of this lesson you can
- Explain how AI, machine learning and deep learning fit inside one another.
- Compare a rules-based system with a learning system and choose the right one for a given task.
- Use the words data, algorithm, model, training and inference correctly.
Many people use 'AI' and 'machine learning' as if they meant the same thing. They do not, and questions often test the difference. AI is the whole field; machine learning is one way of building AI - the way behind most of the AI you use today. This lesson draws the map and gives you the handful of words that explain almost every AI system.
Circles inside circles
Picture three circles, one inside the next. AI is the biggest circle: any technique that makes machines perform intelligent tasks. Inside it is machine learning (ML): AI that learns from data instead of following only hand-written rules. Inside ML is deep learning (DL): machine learning that uses neural networks with many layers (lesson 3). So all deep learning is machine learning, and all machine learning is AI, but not the other way round. Some AI uses no learning at all.
Rules-based AI: expert systems
Before learning methods took over, much AI was rules-based. An expert system stores the knowledge of human experts as if-then rules in a knowledge base, and an inference engine applies those rules to a new case. An early example, MYCIN, advised doctors on bacterial infections and which antibiotics to consider. Expert systems were useful in narrow areas but brittle: every rule had to be written and updated by hand, and they failed on cases their rules did not cover.
Machine learning: the building blocks
In machine learning people do not write the rule; they supply examples, and a learning method finds the pattern.
| Term | Plain meaning | Exam-preparation comparison |
|---|---|---|
| Data / dataset | The examples the system learns from - numbers, text, images, sounds | Previous papers and practice questions |
| Algorithm | The step-by-step method used to learn from the data | Your study method |
| Model | What the algorithm produces after learning: the stored patterns used to make predictions | The knowledge in your head after studying |
| Training | The stage in which the model learns patterns from data | The months of preparation |
| Inference | Using the trained model on new input to produce an answer | Writing the exam on new questions |
The model and the algorithm are not the same thing: the same algorithm trained on different data gives different models. Training happens first and needs much data and computing power; inference happens every time someone uses the system. A model is tested on data it has never seen, to check that it learned general patterns and did not just memorise.
How machine learning works
- Data + algorithm Examples, and the method used to learn from them.
- Training Needs much data and computing power.
- Model The stored patterns used to make predictions.
- Inference The model is used on new input to produce an answer.
Rules-based versus learning systems
| Feature | Rules-based system | Learning system |
|---|---|---|
| Source of knowledge | Rules written by people | Patterns learned from data |
| Needs large data? | No | Yes |
| Easy to explain its decision? | Yes - you can read the rule | Often hard - patterns are spread across the model |
| Handles messy, varied input | Poorly | Well, if trained on similar examples |
| Example | Expert system, a fixed rule 'block payments above a set limit' | Face recognition, speech recognition, recommendations |
Neither is always better. Rules suit clear, stable tasks where every decision must be explained; learning suits tasks such as recognising faces, where nobody can write down all the rules.
Three ways machines learn
Three ways machines learn
-
Supervised learning
From examples labelled with the right answer.
- Emails marked spam or not spam
-
Unsupervised learning
From unlabelled data, finding groups on its own.
- Grouping shoppers with similar buying habits
-
Reinforcement learning
By trial and error, with rewards and penalties.
- A program learning a game by playing it many times
| Type | How it learns | Example |
|---|---|---|
| Supervised learning | From examples labelled with the right answer | Emails marked spam or not spam |
| Unsupervised learning | From unlabelled data, finding groups on its own | Grouping shoppers with similar buying habits |
| Reinforcement learning | By trial and error, with rewards and penalties | A program learning a game by playing it many times |
Worked example 1: two ways to catch spam
- Rules-based way: a programmer writes 'if the subject contains the word lottery, mark it spam'.
- Problem: a scammer writes 'l0ttery' or 'lucky draw' and the rule misses it, while a genuine email that mentions a lottery is wrongly blocked.
- Learning way: the filter is shown thousands of emails already marked spam or not spam by users (supervised learning).
- It learns many signals together - wording, sender, links, timing - and gives each new email a spam score (inference).
- Result: it catches new tricks it was never told about and improves as users keep marking emails.
Worked example 2: predicting a flat's price
Suppose a model is trained on past sales in one locality, and in that data flats sell for about ₹5,000 per square foot (an illustrative figure). Inference: a new 1,000 square-foot flat is entered. Working: 1,000 × 5,000 = ₹50,00,000, so the model predicts about ₹50 lakh. If the market changes and the model is not retrained, it keeps predicting from the old pattern - one reason models need monitoring.
AI ⊃ machine learning ⊃ deep learning. Rules-based AI: people write the rules. Machine learning: data + algorithm → training → model; model + new input → inference → answer.
Key takeaways: AI is the whole field, ML is AI that learns from data, and DL is ML using many-layered neural networks. Expert systems are rules-based AI: easy to explain but brittle. Learning systems handle messy input but need data and are harder to explain. Training builds the model; inference uses it.
Check your understanding
-
1. Which statement about AI, machine learning (ML) and deep learning (DL) is correct?
- AI is a part of ML, and ML is a part of DL
- DL is a part of ML, and ML is a part of AI
- ML is a part of DL, and DL is a part of AI
- The three are unrelated fields
Show answer
Answer: B. Think of circles inside circles: AI is the largest, ML is AI that learns from data, and DL is ML that uses many-layered neural networks. So DL lies inside ML, which lies inside AI.
-
2. In machine learning, using an already trained model to give an answer for new input is called:
- Labelling
- Training
- Data collection
- Inference
Show answer
Answer: D. Inference is the use stage: the trained model receives new input, such as a fresh photo, and produces an output. Training is the earlier learning stage, and labelling and data collection come before training.
-
3. Which task is best suited to a rules-based system rather than a learning system?
- Marking a form incomplete when the date of birth is left blank
- Recognising a person's face in different lighting
- Understanding many accents in speech
- Suggesting videos a user might like
Show answer
Answer: A. Checking whether a field is blank is a clear, stable rule that a programmer can write exactly. Faces, accents and taste vary too much for people to write all the rules, so learning systems suit them.
-
4. An expert system is made up mainly of:
- A camera and a microphone
- Millions of unlabelled photographs
- A knowledge base of if-then rules and an inference engine that applies them
- A neural network with many hidden layers
Show answer
Answer: C. An expert system stores experts' knowledge as if-then rules (the knowledge base) and uses an inference engine to apply them to a new case, as MYCIN did for bacterial infections. It is rules-based AI, not a learning network.
-
5. A model learned from past sales that flats in a locality sell for about ₹6,000 per square foot. It is asked to price a 750 square-foot flat. Its prediction is about:
- ₹4.5 lakh
- ₹45 lakh
- ₹4.5 crore
- ₹75 lakh
Show answer
Answer: B. 750 × 6,000 = 45,00,000 rupees, which is ₹45 lakh. This is inference: the learned pattern is applied to a new input.
Sign in to keep track of the lessons you finish.