Open the photo gallery on a phone and type “momo” in its search box. Up come your photos of momos: on a plate at a party, in a steamer at a shop, half eaten. Nobody typed the word “momo” beside those photos. The phone looked at them and found the momos by itself.
How? In Unit 3 and Unit 4 you learned that a computer does exactly what its program says. But try writing the rules for “a photo with momos in it”. Round? White? Folded at the top? On a plate? A bowl of rice is round and white. A momo seen from the side isn’t round at all. Fried momos aren’t white. You will never finish the list. So nobody wrote those rules. Instead, the computer was shown a great many photos, each with the right answer, and it learned from them.
In this unit you will find out what that kind of computer, an artificial intelligence, is and what it is not. You will teach one yourself, on this page, and watch it make mistakes. You will find the AI hiding in the phones and apps around you, and learn when to trust it and when to check.
What is artificial intelligence?
Think of how you learned to tell a kagati from a suntala. Nobody gave you a rule book. When you were small, people showed you fruit and said its name: “this is a suntala”, “that’s a kagati”. After enough of them, you could name a fruit you had never seen before. You learned from examples.
There are two ways to make a computer sort fruit.
- Write the rules. A person thinks hard and writes the rules down: “If the fruit is smaller than 5 cm across, say kagati. Otherwise, say suntala.” The computer follows them exactly, like the programs you wrote in Unit 4. This is an ordinary program.
- Give it examples. A person collects many fruits, each with its right answer, and gives them to the computer. The computer finds the pattern in them by itself, and uses the pattern to name new fruit. This is a program that learns.
Finding the pattern in the examples is called training, and what the computer ends up with, the pattern it found, is called a model. Once it is trained, the model can answer for things it has never seen. Learning from examples like this is called machine learning.
Now we can say what AI is. Artificial intelligence (AI) is a computer doing a job that, when a person does it, we say needs a mind: recognizing faces and things in pictures, understanding speech, translating, choosing. Almost all the AI around you today does it by machine learning: it learned from examples.
Which of these is a program that learns?
Pick an answer to see why.
What is a model, in AI?
Pick an answer to see why.
What AI is not
Films are full of robots that think, feel and plan. Real AI is very different, and knowing what it is not keeps you from trusting it too much.
- It is not alive, and it doesn’t think or feel. It has no wishes, no feelings, no idea that you are there. When a chatbot writes “I think” or “I’m sorry”, it has learned that people write those words; it doesn’t feel sorry.
- It doesn’t understand the way you do. A fruit sorter that names a suntala doesn’t know it is a fruit, that it is sweet, or that it grows on a tree in Gorkha. It knows only the few measurements it was given.
- It is not always right. A model learned from examples, and examples never cover everything. Every AI makes mistakes. You will see why in this unit.
- It doesn’t know what it doesn’t know. Show the fruit sorter a ball, and it will still say “kagati” or “suntala”: they are the only answers it was taught.
- It is not every clever machine. A rice cooker that switches to keep-warm, or a robot arm in a factory repeating the same weld, follows rules people wrote. Not every robot is AI, and not every program that seems clever is AI.
- It is not magic. Inside, it is a computer doing arithmetic on numbers, very fast: on zeros and ones, as in Unit 5.
A chatbot writes: “I’m so happy to help you!” What is really going on?
Pick an answer to see why.
Learning from examples
Let’s look inside a program that learns. It is simpler than you might think.
A computer can’t look at a fruit the way you do. It can only work with numbers, so first it measures the fruit. Our fruit sorter measures just two things:
- its size: how many centimeters across it is;
- its color: from green, through yellow, to orange.
Two numbers are enough to put each fruit on a map: size along the bottom, color up the side. A small green fruit goes at the bottom left; a big orange one at the top right. Each example on the map has a ring that shows its right answer.
Now a new fruit comes along. The sorter measures it, puts it on the map, and asks: which example is closest to it? Then it gives the same answer as that example. That’s all. Closest to a kagati example? Then it says kagati. This way of deciding is called nearest neighbor: your neighbor is whoever lives closest to you.
The shading on the map shows what the sorter would say for a fruit anywhere on it: blue where its nearest example is a kagati, red where it is a suntala. The shading is the model. Change the examples and the shading changes, so the model changes: that is training.
Notice what the sorter did not do. Nobody wrote “a suntala is bigger than 5 cm” into it. Its answers came only from the examples. Give it different examples and it gives different answers. A model is only as good as the examples it learned from.
Real AI works the same way, on a much bigger scale. A model that finds momos in photos doesn’t measure two things; it measures many thousands of tiny things about the colors and shapes in a photo, too many to draw on a map. And it isn’t trained on ten examples but on millions. But the idea is the one you just used: measure, compare with the examples, answer.
How does our fruit sorter decide what a new fruit is?
Pick an answer to see why.
A sorter gets a lot of fruit wrong. What will most likely help it?
Pick an answer to see why.
Why it makes mistakes
When the sorter got a fruit wrong, there was always a reason, and the map showed it. Before you read the reasons, find them yourself.
A model that learned from examples gets things wrong for a few reasons, and they are the same for the biggest AI in the world:
- Too few examples. With two examples, the sorter knows almost nothing. A real model needs a great many.
- Examples that don’t look like the new thing. If every suntala it saw was ripe and orange, a green suntala looks to it like a kagati. A model knows only what its examples showed it. In Grade 7 you will see how this makes AI unfair to some people, and how to fix the examples.
- It measures only some things. Size and color can’t tell a tennis ball from a fruit. You would feel the fuzz, smell it or squeeze it; the sorter can’t. A model is blind to everything it doesn’t measure.
- It can only give the answers it was taught. Asked about something new, it doesn’t say “I don’t know”. It gives the nearest answer it has.
- Wrong examples. If someone put the wrong ring on an example, calling a kagati a suntala, the model learns the mistake and repeats it.
A sorter has learned from photos of ripe red tomatoes only. Shown a green tomato, it says “not a tomato”. Why?
Pick an answer to see why.
AI around you
You use AI many times a day, often without knowing. Here are some of the jobs it does, in Nepal as everywhere:
- Finding things in photos. A phone’s gallery finds faces, momos, dogs and mountains by a model trained on millions of named photos. A phone that unlocks when it sees your face uses one too.
- Voice typing. In Unit 2 you typed by speaking, in Nepali too. A model learned which sounds go with which words from many hours of people speaking, with what they said written out. That is why it stumbles on names and on words it rarely heard.
- Translation. Apps that turn English into Nepali, and Nepali into English, learned from a great many sentences that people had already translated. They do better with languages they have more examples of, so they still make many mistakes in Nepali, and more in languages like Tamang or Nepal Bhasa that have fewer examples online.
- Recommendations. Video and shopping apps choose what to show you next with a model that learned from what millions of people watched, clicked and bought. It learned to keep you watching, which is not the same as showing you what is good for you.
- Checking payments. Many banks and payment apps check each payment with a model trained on past payments, both honest ones and frauds. When a payment doesn’t fit the pattern, like a large one at midnight from a new phone, the bank may hold it and ask you.
- Helping farmers. Some apps look at a photo of a sick leaf, from a tomato, potato or rice plant, and suggest which disease it might be, trained on many photos of leaves whose disease an expert had named.
- Keeping out spam from an email inbox, and predicting traffic on a map app.
Which of these uses AI?
Pick an answer to see why.
When to trust it
AI is useful, and it makes mistakes. So the question is never “Is AI good or bad?” but “Can I trust this answer, here?” Ask three questions:
- What happens if it’s wrong? If the photo search shows a wrong photo, you scroll on. If an app wrongly tells you a mushroom is safe, someone could die. The worse a mistake would be, the less you should rely on AI alone.
- Has it seen things like this? A model is good at what its examples covered. Voice typing does well with everyday Nepali words and badly with your grandmother’s village name. A crop app trained on photos from other countries may not know a disease common in the hills of Nepal.
- Can I check it? Read what voice typing wrote. Look at the road. Ask the agriculture technician, the doctor, the teacher. When you can check, use the AI and then check. When a mistake would be serious and you can’t check, don’t rely on it.
Use AI only where it helps
Answering with AI takes much more computing than an ordinary program. The biggest AI models run on thousands of computers in huge buildings called data centers (Unit 8), which use a great deal of electricity, and many use water to keep the computers cool. So don’t use AI for a job a simple tool already does well: a calculator for a sum, a dictionary for a spelling, your own memory for your times tables.
Your data, and your own work
Many AI apps send what you give them, your photos, your voice, your questions, over the internet to the company’s computers, and some keep it to train their next model. So never give an AI app anything private: your address, passwords, photos of your documents, or secrets about other people (Unit 8 has more about privacy).
And what you hand in as schoolwork must be your own. If an AI wrote it, it isn’t, and you learn nothing from it. In Grade 8 you will learn when AI can help with schoolwork, and how to say that you used it.
Voice typing has written a message to your teacher. What should you do before you send it?
Pick an answer to see why.
Project
In short
Exercise
What is machine learning?
Pick an answer to see why.
Which of these is not true of AI today?
Pick an answer to see why.
A nearest-neighbor sorter has two examples: a kagati 4 cm across and yellow, and a suntala 7 cm across and orange. A fruit 4.5 cm across and yellow-orange is tested. What does it say?
Pick an answer to see why.
A sorter was trained on photos of cats and dogs. It is shown a photo of a goat. What happens?
Pick an answer to see why.
Which job is best done by an ordinary program, not AI?
Pick an answer to see why.
Explain in one sentence each: artificial intelligence, machine learning, training, model.
Answer
What is the difference between an ordinary program and a program that learns? Give one example of each from a phone.
Answer
Write four things AI is not, with a sentence on each.
Answer
Describe how a nearest-neighbor fruit sorter decides whether a new fruit is a kagati or a suntala.
Answer
A fruit sorter was trained only on ripe fruit: yellow kagati and orange suntala. It calls a green, unripe suntala a kagati. Give the reason for the mistake, and say how to fix it.
Answer
Give five reasons why an AI model that learned from examples makes mistakes.
Answer
Name four places where AI is used around you, and say what each one learned from.
Answer
What three questions should you ask before trusting an AI answer? Use them to decide what to do in each case:
- i.A photo app labels your photo of Phewa Lake “beach”.
- ii.A crop app says your rice has a disease and you should spray a chemical.
- iii.A chatbot gives the dose of a medicine for your grandfather.
Answer
Your friend uses a chatbot to work out 48 × 25 for homework. Give two reasons why this is not a good use of AI.
Answer
Why should you never type private information, such as your password or your address, into an AI app?
Answer
Quiz yourself: Artificial intelligence, Grades 6–12 →
Practice every question in the book, and keep track of the ones you miss →
