Hello, this is Akitomo.
The theme for Part 1 of Series 2, ‘How AI Learns,’ is ‘To begin with, how is machine learning different from a regular program?’
In Part 0, we established that ‘AI learning’ means ‘gradually adjusting internal knobs.’ This time, as a foundation, we will look at the difference in thinking between a ‘program’ and ‘machine learning.’ Once you understand this, everything that follows will fall into place.
A regular program is where ‘humans write the rules’
The software and apps we use every day are basically made of programs. A program is something that makes a computer execute rules (procedures) decided in advance by humans.
The image is similar to a cooking recipe. Humans decide and write down everything: ‘These are the ingredients, these are the steps, and this is the heat level.’ The computer repeats that accurately as many times as you want.
This method is unbeatable when the rules can be clearly articulated. For example, in tax calculations or calculator operations, the way to get the answer is completely determined, so the program processes it correctly every time.
But there are problems where you cannot write the rules
The trouble arises with problems where it is difficult to put the rules into words.
For example, suppose you want to distinguish whether an email is spam. If you were to write it as a rule, you would list conditions like ‘If it contains the word “You’ve won,” it’s spam.’ But the sender will immediately change the wording. The rules would increase endlessly, leading to a game of cat and mouse.
The same applies to ‘Is this a photo of a cat?’ or ‘Is this text positive or negative?’ Even though humans can tell at a glance, it is almost impossible to write down every single rule for ‘what you looked at to make that judgment’ without missing anything.
Machine learning is ‘passing examples and letting the machine find the rules’
That is where machine learning comes in. The way of thinking is reversed.
In machine learning, instead of rules, humans prepare ‘examples.’ When you show the machine many examples with correct answers, such as ‘This email was spam’ or ‘This was not spam,’ the machine finds for itself the line to draw regarding ‘what kind of characteristics make something look like spam.’
Let’s look at a small example. Suppose we represent fruit with two numbers: ‘weight’ and ‘color intensity.’
-
Apple examples: (150g, dark), (170g, dark), (140g, somewhat dark)
-
Mandarin orange examples: (110g, light), (100g, light), (120g, somewhat light)
If a human were to write a program, they would decide the boundary themselves, saying, ‘If it’s 150g or more, it’s an apple; if it’s less, it’s a mandarin orange.’ But in machine learning, the machine looks at the arrangement of data and draws the boundary itself, determining ‘drawing the line around here results in the fewest mistakes.’
And the yardstick for measuring this ‘fewness of mistakes’ and the task of moving the line little by little to a better position are exactly the topics of ‘loss’ and ‘adjustment knobs’ that I talked about in Part 0. Learning in machine learning is the task of ‘finding the rule with the fewest mistakes from the data.’
Strengths and weaknesses are reversed
Because of this difference, their areas of expertise are clearly divided.
-
Program strengths: Calculations and procedures where the rules are clear and mistakes are not allowed (tax calculations, reservation systems, etc.)
-
Machine learning strengths: Things where the rules are hard to put into words, but many examples can be collected (image recognition, text classification, recommendation displays, etc.)
On the other hand, the weaknesses of machine learning are also clear.
-
It cannot learn without examples (data)
-
If it learns from incorrect or biased examples, it will develop biased rules accordingly
-
Struggling to explain ‘why it made that decision’ in words
AI like ChatGPT is also an extension of this ‘finding rules from examples’ mechanism. The difference is that the volume of examples is orders of magnitude larger, and the rules it finds cover every possible pattern in text. We will cover that in ⑤ ‘The Truth Behind the “Large” in LLMs’.
Summary
-
In programming, ‘humans write the rules,’ while in machine learning, ‘machines find the rules from data.’
-
Machine learning training = searching for the ‘line with the fewest errors’ within the data.
-
Their strengths differ: programming is for problems with clear rules, while machine learning is for problems where examples can be gathered.
Even when we say ‘show examples to make it learn,’ there are different ways to show them. In the next part, ②, we will organize the three typical ways machine learning learns (supervised learning, unsupervised learning, and reinforcement learning) using familiar examples.
Follow to receive updates. Likes and comments are also encouraging.
Leave a comment