• 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.

TermPlain meaningExam-preparation comparison
Data / datasetThe examples the system learns from - numbers, text, images, soundsPrevious papers and practice questions
AlgorithmThe step-by-step method used to learn from the dataYour study method
ModelWhat the algorithm produces after learning: the stored patterns used to make predictionsThe knowledge in your head after studying
TrainingThe stage in which the model learns patterns from dataThe months of preparation
InferenceUsing the trained model on new input to produce an answerWriting 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

  1. Data + algorithm Examples, and the method used to learn from them.
  2. Training Needs much data and computing power.
  3. Model The stored patterns used to make predictions.
  4. Inference The model is used on new input to produce an answer.

Rules-based versus learning systems

Rules-based vs learning systems
FeatureRules-based systemLearning system
Source of knowledgeRules written by peoplePatterns learned from data
Needs large data?NoYes
Easy to explain its decision?Yes - you can read the ruleOften hard - patterns are spread across the model
Handles messy, varied inputPoorlyWell, if trained on similar examples
ExampleExpert 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
TypeHow it learnsExample
Supervised learningFrom examples labelled with the right answerEmails marked spam or not spam
Unsupervised learningFrom unlabelled data, finding groups on its ownGrouping shoppers with similar buying habits
Reinforcement learningBy trial and error, with rewards and penaltiesA program learning a game by playing it many times

Worked example 1: two ways to catch spam

  1. Rules-based way: a programmer writes 'if the subject contains the word lottery, mark it spam'.
  2. Problem: a scammer writes 'l0ttery' or 'lucky draw' and the rule misses it, while a genuine email that mentions a lottery is wrongly blocked.
  3. Learning way: the filter is shown thousands of emails already marked spam or not spam by users (supervised learning).
  4. It learns many signals together - wording, sender, links, timing - and gives each new email a spam score (inference).
  5. 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. 1. Which statement about AI, machine learning (ML) and deep learning (DL) is correct?

    1. AI is a part of ML, and ML is a part of DL
    2. DL is a part of ML, and ML is a part of AI
    3. ML is a part of DL, and DL is a part of AI
    4. 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. 2. In machine learning, using an already trained model to give an answer for new input is called:

    1. Labelling
    2. Training
    3. Data collection
    4. 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. 3. Which task is best suited to a rules-based system rather than a learning system?

    1. Marking a form incomplete when the date of birth is left blank
    2. Recognising a person's face in different lighting
    3. Understanding many accents in speech
    4. 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. 4. An expert system is made up mainly of:

    1. A camera and a microphone
    2. Millions of unlabelled photographs
    3. A knowledge base of if-then rules and an inference engine that applies them
    4. 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. 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:

    1. ₹4.5 lakh
    2. ₹45 lakh
    3. ₹4.5 crore
    4. ₹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.

Privacy · Terms · Refunds · Delivery