KwickAcademy Artificial Intelligence · 6 min · free
Modelling: Rule-based vs Learning-based AI
A rule-based model follows if-then rules written by humans. A learning-based model finds patterns from labelled examples.
Follows the syllabus of: CBSE Class 9 Artificial Intelligence (417), CBSE Class 10 Artificial Intelligence (417)
On screen in this lesson
What is modelling?
| Fourth stage of the AI project cycle |
| A model turns input data into a decision |
| Two main kinds: rule-based and learning-based |
Rule-based model
| A human writes the rules |
| Rules are written as if-then statements |
| The model follows the rules exactly |
| It does not learn or improve by itself |
Pause and predict
| SMS: "Congrats! You have won a free phone" |
| Neither rule matches the exact words |
| The rule-based model marks it Safe |
Learning-based model
| We give the model many labelled examples |
| It finds the patterns by itself |
| It predicts answers for new data |
| More good data usually means a better model |
Types of learning
| Type | Data given | Example |
|---|---|---|
| Supervised | with labels | spam or safe |
| Unsupervised | no labels | group customers |
| Reinforcement | rewards | game-playing AI |
Rules vs learning
| Point | Rule-based | Learning-based |
|---|---|---|
| Who decides? | human rules | patterns in data |
| Needs data? | little | a lot |
| Explains itself? | easily | often hard |
| New cases? | often fails | adapts better |
Quick answers
"Congrats! You have won a free phone" hits no rule. What does the rule model say?
Safe, because no rule matches the exact words.
When do rules work best?
When rules are clear, fixed and every decision must be explained.
KwickClips from this lesson
Short clips, one idea each. Good for revision the night before.
Who writes the rules?39 sec
Can AI decide without rules?41 sec
When should you use rules?40 sec
Do you need code for Teachable Machine?42 secThe full lesson, in text
Hello students, welcome to Kwickprep. Can you teach a computer to spot a spam message by writing rules? Or should it learn from examples? Today we compare rule-based and learning-based AI models, see when each one fails, and build a model without writing any code.
First, what is modelling? It is the fourth stage of the AI project cycle, after data exploration. A model is the part that takes input data and gives a decision or prediction. There are two main kinds of models, rule-based and learning-based.
Let us start with a rule-based model. Here, a human expert writes the rules. Each rule is an if-then statement, like, if the message says you won a lottery, then mark it spam. The model follows these rules exactly, every time. But it never learns anything new by itself.
Here is a small rule-based model drawn as a flowchart. First, it reads the SMS. The first rule asks, does it say you won a prize? If yes, mark it spam. If no, the second rule asks, does it ask for your OTP? If yes, again spam. If both answers are no, the message is marked safe.
Pause and predict what our model does with this message. Congrats, you have won a free phone. It does not say you won a prize, and it does not ask for an OTP, so no rule matches. So the model marks it safe, even though it is clearly spam. This is the big weakness of rules.
Now a learning-based model, also called machine learning. Instead of rules, we give it many examples with labels, like thousands of SMS messages already marked spam or safe. The model finds the patterns by itself, such as words like free, won and urgent. Then it predicts the answer for new messages it has never seen. Usually, more good data gives a better model.
Learning-based models learn in three main ways. In supervised learning, every example has a label, like spam or safe. In unsupervised learning, there are no labels, so the model groups similar items, like shoppers with similar habits. In reinforcement learning, the model learns by trying actions and getting rewards, like an AI learning to play a game.
Let us compare them side by side. In a rule-based model, human rules decide, while a learning-based model uses patterns found in data. Rules need very little data, but learning needs a lot of good data. A rule-based model can easily explain why it decided, while a learning model often cannot. And for new, unseen cases, rules often fail, while learning adapts better.
So when should we use rules? Rules work well when they are clear and do not change often. They also suit problems where every decision must be explained, like a fee or a result. A school result rule, pass if marks are thirty three or more, is a perfect example. But rules fail when there are too many cases to list, like every way to write a spam message.
And when should a model learn? Learning works well when patterns are too complex to write as rules. It also needs plenty of good, labelled data. Recognising faces, voices or handwriting are good examples, because no one can write rules for every face. But learning fails with too little data, or biased data, which means data that is unfair to some groups.
Now let us build a learning-based model without code. We will use Teachable Machine, a free website made by Google that runs in your browser. You do not need to write any code. You teach it using photos from your webcam, sound recordings, or body poses.
Here are the steps for a model that tells a pen from a pencil. Open the website and start a new image project. Name two classes, which means two groups, Pen and Pencil. Hold each object in front of the webcam and add about fifty photos to each class. Click Train Model, and wait a few seconds while it learns. Now hold up a pen it has never seen. It shows its prediction, like Pen, with a confidence bar.
What did this demo teach us? We never wrote a rule, we only gave labelled examples. Photos from different angles and backgrounds give better predictions. And if every training photo had poor light, the model may get confused in bright light, which shows why good data matters.
Let us revise what we learned today. A rule-based model follows if-then rules written by humans. A learning-based model finds patterns from labelled examples by itself. Rules suit clear, fixed problems where decisions must be explained. Learning suits complex patterns, when we have lots of good data. And tools like Teachable Machine let you build a model with no code, so try it at home.
Courses that teach this
| Course | Unit |
|---|---|
| CBSE Class 9 Artificial Intelligence (417) | Part B - Unit 1: AI Reflection, Project Cycle and Ethics |
| CBSE Class 10 Artificial Intelligence (417) | Part B Unit 2: Advanced Concepts of Modelling in AI |
Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.
Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

