Lesson 1 of 6, about 20 minutes
How AI really works
You've probably used AI today without thinking about it: TikTok's For You page, Google Translate, a filter on your camera, maybe a chatbot. In this course you'll go behind the scenes and then build AI yourself.
AI learns patterns from data
Most modern AI is machine learning: instead of a programmer writing every rule, the computer is shown lots of examples and finds patterns by itself.
Example: to build an AI that spots scam SMS messages ("You have won KSh 50,000! Send your PIN to claim"), you collect thousands of real messages labelled scam or safe. The AI learns which words and patterns usually appear in scams. Then it can check new messages it has never seen.
The result of training is called a model. A model is the "learned brain": a mathematical recipe that turns an input (a message) into a prediction (scam or safe).
How chatbots like ChatGPT work
Chatbots are built on large language models (LLMs). During training, an LLM reads a huge amount of text and practises one task billions of times: predict the next word.
If you see "Nairobi is the capital city of…", you can predict "Kenya". An LLM does this kind of prediction one small chunk at a time to write whole answers. Because it has seen so much text, it picks up grammar, facts, writing styles and even coding.
Why AI makes mistakes
An LLM is trained to produce text that sounds right. Usually that is also true, but not always. When it doesn't know something, it may still produce a confident, fluent answer that is wrong. This is called a hallucination. AI is especially unreliable on:
- Exact facts like dates, statistics and quotes
- Very recent news
- Local details about Kenyan towns, schools or events
- Long maths calculations
Types of AI you'll hear about
| Term | Meaning | Example |
|---|---|---|
| Machine learning | Learning patterns from examples | Scam SMS detector |
| Deep learning | Machine learning with large "neural networks" | Face recognition, voice assistants |
| Generative AI | AI that creates new text, images, audio or video | Chatbots, image generators |
Try it: list 5 apps you use every week. For each one, guess: what does its AI predict? What data might it have learned from? (Example: TikTok predicts which videos you'll watch longest, learning from what millions of people watch and skip.)
Key takeaways
- Machine learning finds patterns in labelled examples and produces a model.
- Chatbots predict the next word, which is why they can sound right but be wrong.
- Always check important facts from AI.
Enjoyed this? Create a free account, then unlock all 6 lessons, the quiz and the certificate for US$35.
Unlock the full course