Genetic Programming and Go

   

The idea of evolving programs by analogy with natural selection has been around for a long time. Holland pioneered genetic algorithms in the 70s. Other forms of genetic programming have arisen since.

Without adding domain knowledge, these are weak methods, and have not so far been successfully applied to go. However, Russell Wallace has devised [ext] Lithos and applied it to go. It is fun to watch the programs evolve.


Bisqwit: I once made a tetris-playing bot that analyzed the field and had values for different features of the playing field, like the stack heights, number of windows. It was difficult to adjust those values by hand, so I made a genetic algorithm to automatically adjust those values towards better gaming results. It worked remarkably well.

In computer go, it's difficult to make a good evaluation function for board positions (for deciding what move is the best move). There are many factors affecting the value, and it's not easy to decide how should they be put to balance. I think a genetic algorithm would work here too: It could adjust the balances between different things affecting the evaluation of a board position. Values which result best win/lose ratio are mutated less, and values which result in more losing than winning, are mutated more.

Unfortunately it's difficult to say how efficient the engine is. With go, an opponent is needed. Computer can't measure its own strength by playing against itself. It could however measure its strength by evaluating random positions from pro games and testing how many moves it gets the same way as the pros do.

Note that this is not a magic solution: It does not invent new algorithms. It only finetunes parameters we humans are too lazy (or unskillful) to put the right way. In the case of the tetrisbot though, the finetunes made the bot 100 times stronger than with my initial careful settings.


Bill: I have been having fun with Lithos. Here is the final board of a game between the 2 fittest individual programs out of 100 after 300 generations.

[Diagram]

Evolved go


After a few generations one player discovered a good trick: the diagonal rows one space apart. If you can get away with it, you can score some solid territory. Note that White is trying a greedy mutation. The play stopped early because the players do not know where the stones are on the board and play on top of them, producing passes. Sooner or later some reply to the good trick will emerge. (Note the spoilers in the middle of the board and top right corner.) Meanwhile, it's not a bad strategy against a blind novice -- if you are also a blind novice. ;-)

BTW, the best program consists of only 21 instructions in virtual assembler. ;-)



This is a copy of the living page "Genetic Programming and Go" at Sensei's Library.
(OC) 2005 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About