r/MachineLearning • u/benanne • Dec 02 '14
Deep learning for chess
http://erikbern.com/?p=8414
u/hookers Dec 02 '14 edited Dec 02 '14
Really interesting, but I agree that the crux is a better search rather than a good evaluation function.
Random idea on the topic of better search - how about training the neural network on a sequence of boards? This has some advantages:
It makes use of the power of the internal feature representation - a deep enough network might be able to discover an underlying latent motive behind a sequence of moves and so pick the one with a better eventual payoff;
It decreases the cost of the function per time unit - you could do something like an extremely cheap soft pruning function to discard completely irrelevant search paths, but then score whole branches of the search tree at once;
Seems to make more sense in general - experienced chess players would think of moves as a unit (e.g. common tactics such as removing a defender, gaining tempo, zugzwang, etc)
Edit - formatting.
4
u/professor__doom Dec 02 '14
It’s possible to learn an evaluation function directly from raw data, with no preprocessing
That is indeed pretty cool.
4
1
u/GnomyGnomy7 Dec 02 '14
Wow, this is really nice, about six months ago, I set out to train an AI for an advanced version of tic-tac-toe( on a 9*9 board ), by pitching the AI against itself. But after writing the game, I did a quick calculation, which I must have done before the entire thing, and I concluded that it was not viable.
So I just ended up writing the game in Java, and nothing to do with the AI. I must admit though, I am a newbie to ML, let alone DL. So maybe, it's time for me to pick up that project again. :)
Maybe if someone is interested in the code, and perhaps working on the AI with me, PM me :)
3
u/Ubermouser Dec 02 '14
What was it about the project that made you deem it not viable?
1
u/GnomyGnomy7 Dec 03 '14
I thought that the number of possibilities were way too high to effectively train my AI :(
1
1
u/test3545 Dec 02 '14
Why not to train net that simply predicts next board given a current one? 768 inputs and outputs, plus whatever hidden layers.
2
u/Felicia_Svilling Dec 02 '14
Wouldn't that just train the net to play like an average player?
1
u/test3545 Dec 02 '14
Yes. But I've got an impression that model trained above was playing weaker than humans chess players from 100m games dataset.
So why not to kill complexity while improving straight?
1
2
u/mhummel Dec 02 '14
My pet project is like this (with more inputs to capture metadata). In classifier mode it classifies the position as legal/illegal/win for white/draw etc; in generative mode it creates a new position and the next move is determined. At the moment, it's generating interesting, albeit illegal positions. If I can ever get it finished I'll post it if there's interest.
1
u/umustbetrippin Dec 02 '14
Why not switch to a game like Arimaa, which is superficially similar to chess (and therefore some of your work could be reused) but is still much more difficult for computers?
1
1
u/mosquit0 Dec 05 '14 edited Dec 05 '14
Could convolutions be used here? I bet that there is some invariance in the positions.
Another idea is about compressing outputs from a really strong engine. Take a position and try to predict the next move as predicted by the engine.
0
Dec 02 '14
For speed, have you considered training a simpler classifier on the output of the deep nets? I.e. what Geoffrey Hinton calls 'dark knowledge'.
30
u/goltrpoat Dec 02 '14
Amateur chess engine programmer checking in. Very cool. A few suggestions:
Add a transposition table, you should get an enormous speed boost with barely any work (it's kind of surprising that it does anything at all in any reasonable amount of time without it).
Don't bother with MTD(f) -- there's no benefit over PVS. Even your plain alpha-beta should be sufficient, assuming you add transposition tables.
If you add quiescence search, you'll beat Sunfish one hundred times out of a hundred, no matter what your evaluation function. Sunfish isn't even the "hello, world" of chess programming, it's missing crucial parts.
Finally, the FICS dataset is not the best idea, I think -- it consists of very poor quality games for the most part (beginners playing blitz). The best free option would be MillionBase, most of those are tournament games under classical time controls. It's a much smaller dataset, but not nearly as noisy, and ~2mil*80 or whatever positions is still a pretty decent amount of data.