Problem Solving Without Trial and Error
By far the greatest advantage humans possess over other species is our ability to solve problems by thinking about them. This ability forms the basis of human creativity, technology, and social organizations. What a massive leap forward humankind has secured for itself. Every fascinating technological advance that you can think of is the result of our ability to innovate, to come up with solutions to problems in our minds. Every serious terror or misfortune we face as a species, like smallpox or famine, either has been fixed, or will be fixed through creative problem solving.
If we can figure out how humans can think of creative solutions to problems, we can recreate that ability in A.I., and multiply our creative capabilities as a species. Let’s look at an example of how this can be done.
The Limits of Trial and Error
Imagine you are trying to create a new cake recipe by pure trial and error. You must try a random combination of foods in random amounts, cooked for variable times. After each batch you try the result and see how it tastes.
How many hundreds of failed cakes would you have to make before you made one that was edible? Think of how long it would take, as well as the cost of all those experiments. Furthermore, if you randomize the baking times and temperatures, you might risk a fire and other kinds of damage. This doesn’t seem like the right way to create something new.
So what’s the alternative?
You know from experience what the answer is. It’s a combination of learning from others, and using your best judgement to predict the results before you carry them out. For example:
- You know that using 20 parts sugar to 1 part flour is unlikely to make anything good.
- You know around how long to bake the cake, between 20–80 minutes depending on the type. Not 5 hours.
- You know that some ingredients are more likely to harmonize than others. Asparagus and Twizzlers will rarely produce a great cake.
- And most importantly, you can learn helpful tips on which combination and order of ingredients work better, from online recipes.
All the above have one thing in common: they produce a better cake without you having to work it out through manual trial and error. When you learn from others, you learn from their mistakes so you don’t have to repeat them, as well as some rules of thumb to guide you in the right direction.
Creative problem solving is intelligent. It requires you to understand how the world works, to have the right goals to aim for, and most importantly, the ability to think through actions and imagine their results without actually having to carry them out. Rules of thumb, heuristics, and learning from others let you skip over costly or dangerous trial and error, and jump to a better conclusion.
Now let’s take a look at how this could be done in practice.
Avoiding Pedestrians
Imagine that you’re developing a self-driving car. You’d like your car to understand how the world works, and use that understanding to solve problems and plan future actions. In this case, the problem it’s going to encounter is:
How can it learn to avoid pedestrians if it predicts they will cross its path?
To simplify the problem, assume that the car already has the following ‘belief’:
If it sees a person walking along looking at his cellphone, the car predicts that the person will continue walking in the same direction.
Think of the above as a short movie. If it sees the first two frames, it automatically imagines the next ones. There are a few things to note here:
- The background context around the person is irrelevant to its prediction. The car has decided that these trigger inputs are the only important ones. Anything else behind and around them can be ignored as noise. (I’ll explain how it came to learn this further down.)
- The car quite literally “foresees” the person walking across its field of view. The car creates an experience in its own mind of the pedestrian walking across its field of view. It then reacts as though this imagined scenario were actually happening in front of its eyes.
The car has also learned to react negatively to certain sights. For example:
If it is moving forward, and sees an object in front of it, that is a problem.
This is the car’s equivalent of “pain” or “worry”. As in the case of the walking pedestrian above, the background here is irrelevant. All that matters is that it will have a bad reaction to this sight, whatever the context.
Now let’s put these two thoughts together.
The car is driving down the road. It sees a person walking in from the left. Assume that it has never seen encountered this scenario before.
It then imagines what it would expect to see if a person continued walking along, looking at his cellphone.
One of the frames of this prediction presents a problem. It predicts that the person will soon be in front of the moving car. The car foresees this before the pedestrian ever gets there, so it has time to work out a solution before it’s too late.
Even though the above is a new situation that it has never experienced before, it recognizes it as a problem by thinking through the consequences.
Now it must solve the problem. Trial and error would be problematic here. If it decided to accelerate to see what the effect was, the risk of harm would be too great. So how does it solve this problem without trial and error?
Thinking Through a Solution
First, let’s give the car a few more beliefs:
If there’s an object in front of the car, it’s a problem. But if the car is stopped, and the object is in front of the stopped car, there is no problem anymore.
The car also has another belief:
If the car is moving forward, and the brakes are applied, the car will slow down and stop.
The car’s beliefs might remind some of you of logical premises. The “if this, then that” language is akin to inductive reasoning. This is not a coincidence. The car is using inferences from one situation to another, then combining them together to see what the outcomes might be.
At this point it has a handful of actions it can do. But trying them all could be dangerous. However, it could imagine the consequences of all of them, and see if any of them solves its problem.
One of these actions it considers is braking. The car then foresees the consequences of that action.
The car sees that it will have stopped by the time it gets to the pedestrian. Since that situation is no longer a problem, the problem is now solved.
Everything that occurred so far happened in the mind of the car. It took no actions, and no trial and error was needed to solve the problem. The car imagined the consequences, played around with some options, then solved its problems solely in thought.
Learning
You don’t want your car have to think through the problem and rediscover the solution every time it experiences this same situation. It already figured out the solution once; you’d like it to automatically think of this plan every subsequent time too.
What do I mean by “this plan”? Well, the car naively assumes that anything that came before the moment the problem disappeared was in some way responsible for getting rid of the problem. So whatever it was, it’s wise to remember it and try to recreate it the next time it encounters this same situation. In this case, it is the thought of braking and slowing down.
When is the right time to think of this plan? If the car wants its solution to be useful, it should give itself enough time to react. So thinking of the plan sometime before the pedestrian is in front of the car would be ideal.
Let’s put these two ideas together. Take a look at what the car experienced while it was problem-solving:
- At times 1 and 2 it saw the pedestrian.
- At time 3 it played out the consequences of its own actions as well as the pedestrian’s actions.
- At time 4 it had played out the consequences, and foresaw the potential problem.
- At time 6 it thought of braking. It may have thought of any number of options between 4 and 6. But since they don’t solve the problem, they are irrelevant.
- At time 7 and 8 it played out the consequences and realized the problem would no longer be a problem.
Everything it experienced during a span of time before the problem occurred (frames 1, 2) is now the trigger. This includes the sight of the pedestrian on the sidewalk about to walk into traffic.
Everything during a span of time before the problem went away (frames 6, 7, 8) is a plan. This includes braking, and slowing down until it is stopped.
The car’s goal is not to solve the problem when it happens, but to avoid the problem altogether. It learns that in order to avoid the problem altogether, it should slow down. That way it never has to experience an accident. It doesn’t even have to experience the accident in its thoughts, because the solution will also be present in its thoughts, like a ready antidote.
So now these two experiences are attached together in the mind of the car The next time it experiences this same situation, it will immediately think of its plan, i.e. play it out in its mind as thoughts.
Does the image above look familiar? This is the same trigger -> imagined prediction that the car used earlier to predict the behaviour of the pedestrian.
In both cases, when the car sees the first part, the trigger, it imagines the next part as a thought. Both predictions and plans are types of thoughts, they are imagined consequences based on the current situation.
Granted, predictions and plans are not exactly the same. One is a prediction of what will happen, i.e. the pedestrian will walk across my view, and the other is a plan for what it would like to happen, i.e. I’d like to slow down. But both are formed in the same way, and the underlying process is the same in both cases: on experiencing a trigger, it imagines something that it is useful for it to imagine.
A plan is an imperative. When the car imagines it’s plan it is asserting: “this is what I will make happen”. Then it considers the consequences of this plan. So it treats plans and predictions in the same way. Now that the car has a new plan in its imagination, it can use it to make other decisions going forward as well.
For instance, imagine that your car was being tailgated by another car. It sees a pedestrian about to walk in front of it. Its plan, to slow down, plays out in its mind.
However, since the car is being tailgated, this imagined scenario presents a new problem, that of being hit from behind. It now has to solve this new problem, in the same way it solved the previous one. And so on; the cycle repeats with each new problem creating a new plan.
Transparent, Generalizable A.I.
Besides being able to solving problems using logical inference, you get a few additional benefits by using a thought-based A.I.
Existing neural networks tend to be blackboxes. It is hard for you to analyze and isolate which triggers cause which responses, and even harder to separate one chunk of learning from the rest. In the above cases, you saw how the A.I.’s predictions and plans are written in the language of its experiences; that is, visual and auditory “videos”. They are stored as isolated, separate thought responses.
As a developer you can scan through the car’s memories and plans, see how it’s interpreting the world, and delete any thoughts you find problematic. This gives you transparency into the mind of the car. If you decide that its plan to slow down when it sees an inattentive pedestrian is unwise, you would delete that plan (that thought response), put it back on the road, and encourage it to learn something different next time. You can ‘undo’ its thoughts piece by piece.
Isolating thought responses also allows A.I. to compose thoughts together. You saw above how the car activated more than one thought response at a time. In the midst of these arrangements, something noteworthy popped out.
The separability of individual thoughts also makes the A.I.’s responses more generalizable. All visual and auditory inputs are processed in a binary, ‘on-off’ way, and its thought responses are triggered if the requisite inputs are present. It ignores and prunes away any inputs that aren’t relevant to the task, on the assumption they are noise. As a result, it can apply what it has learned to a greater range of situations, including ones it hasn’t experienced before. (I’m writing a longer article on how this system generalizes. For a preview, see ‘Day 10: Generalizing from specific examples’).
The A.I. is not just reacting to what is in front of it, but also what it imagines will happen. Different scenarios that cause it to imagine the same set of predictions or plans will be treated the similarly. It sees a pedestrian on the sidewalk, and perceives a pedestrian on the street. It combines together what it sees and hears in the world, as well as its plans and expectations. It then reacts to the result, in whole or in part. This gives it even more generalizability.
Altogether, these abilities let the A.I. think through problems using something akin to inductive logic, whose premises are rooted in what it has learned through its own motivations.
If you’d like to read a more detailed breakdown of how a problem solving A.I. can be built from the ground up, see Thinking and Problem-Solving, from the Ground Up.
Are you also interested in applying Artificial Intelligence to human creativity, human understanding, even human values? Do you feel that our current goals with A.I. are limited? I’m looking to connect with others who have a similarly ambitious vision of the future of A.I., whose goal is to tap the full creative potential of human intelligence through software.