October 01, 2019

Formalizing Artificial Intelligence

In addition to a previous blog post, I'd like to describe a general strategy how to create a game playing AI. The first step is to select a certain domain which has to be solved. For example to control a self-driving car in a simulator. The next step is to divide the problem into subproblems. For example, a car needs a vision system, a pathplanner, a distance control, a speed control and so on. The categories are dependent from the game domain, a self-driving has different subproblems than a real time strategy game. In the next step, for each category a system identification task is realized.

System identification means, to predict the future game state. It's a what-if algorithm. Let me give an example. The desired subproblem is the abstract pathplanner for the car. The options which are available for the car driver is to drive to a certain node in the graph. As a result, the game is a new state. Sometimes the strategy is called model predictive control, but system identification is only a part of it. It means, only to anticipate the future without selecting an action.

As a result the AI prototype can be realized. It contains of submodules for pathplanning, speed control and wheel control and each submodul is able to predict the future. The last step is to create an action generator which is using the existing information for controlling the car. This kind of problem solving technique can be repeated for any domain. If the domain is more complex, for example in a real time strategy game, the amount of subproblems growths quickly, and it will become harder to predict future states.

A general strategy for handilng complex problem is to see it as a software engineering task. It can be solved by lots of people who are creating commits in a version control system. In parallel they have to write the documentation and test if the system is working correctly. And exactly this is perhaps the largest bottleneck. The described general AI system isn't a library written in C++, but it's only a software engineering pattern, which is equal to a guideline how to build new AI Systems from scratch. The workflow can't automated, that means, the AI won't evolve by itself, but it's up to the programmer to write sourcecode.

For simple domains, like a snake game in 2d, a single programmer is able to realize such a project. He can create all the tasks by himself. At first, he defines subproblems, then he creates the system identification for each subproblem and at the end, he writes the controller and tests it in the game. For complex games like a self-driving car, UAV or a humanoid robot it's not possible for a single programmer to realize such project. Existing robotics projects are usually the result of a group of programmers how have invested many years and wrote million lines of code.

The reason why robotics and artificial intelligence is so complicated is, that the written code can't be used for a different project. That means, each domain needs a different kind of sourcecode. It's not possible to write a general system identification module which can predict all domains. Or to define in general which subproblems a game has. The only thing which is fixed is a programming language. The same Python interpreter and the same git version control software can be used to manage all sorts of AI projects.