Ahhh... the holy grail of computer chess

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: Ahhh... the holy grail of computer chess

Post by mike_bike_kite »

Don wrote:The changes would be almost random (with only slight pressure to improve) and you would have to run a lot of games for each single change.
Definitely not random - it's just genetics applied to algorithms. It's that same "slight pressure to improve" that makes us different to yeast cells. Admittedly the testing period was 3.5 billion years for life but it deals with quite long strands of DNA rather than just a couple of hundred weighting parameters for chess.
Don wrote:I think what you might like is some variation of simulated annealing. You basically make lot's of changes at one time, test, do again.
I'm not sure about the "simulated annealing" but I haven't tried it. I suppose if all the changes that are made work well together then you'll get a good positive jump. Of course if any part of the changes was bad then it will destroy any benefit. I'm not sure whether evolutionary mutations work by altering multiple genes at the same time or whether it's one gene at a time. If "simulated annealing" isn't used in nature then I suspect it won't benefit chess programs either.
Don wrote:Learning could be improved I think if a human put limits on the values each parameter could take i.e. we know that it would be unreasonable for a knight be less than 200 or more than 500 and that most positional terms should not be more than half a pawn - and any that are could be identified.
That might work assuming you know exactly what the right limits are - the problem is we don't. I play chess and have always assumed that knights and bishops are roughly 3 pawns but that's because I read it in a book and it seems to work over the board. Methods like this actually test these assumptions and check that they are correct. If a rook is really worth 5.5 pawns then it will find that out (obviously it isn't as simple as this).

I'll admit it's very different to ordinary programming methods but sometimes it's worth trying something new. The other benefit is that it effectively checks all your code as well. I have switches in my code to turn on/off alpha beta, size of extensions etc and I can test whether this code works by just looking at the weighting values that control these things - if a weighting starts to fade to zero or go negative then this tells you there's something wrong with that part of your code.

Does it really matter if it takes a month to run enough test games? You could probably speed it up by having a pool of programs playing each other. At the end of the day you'll have tested all your algorithms and adjusted your weights better than you could ever do by hand. If it uncovers a few bugs then that's an added benefit.
User avatar
marcelk
Posts: 348
Joined: Sat Feb 27, 2010 12:21 am

Re: Ahhh... the holy grail of computer chess

Post by marcelk »

michiguel wrote: It looks very similar to what I posted here a couple of years ago, both, tuning and the style.
http://www.talkchess.com/forum/viewtopic.php?t=27266
I used games from CCRL.

Miguel
That is very interesting and I wasn't aware of that. I wasn't following talkchess at that time.

[D]r4rk1/1bqnbppp/pp1ppn2/8/2PNP3/2N1B1P1/PP3PBP/2RQR1K1 w - - 5 13

Regarding your position: My program briefly suggests Nd5 at ply 7 but quickly changes its mind back to f4 and sticks with that.

I have two questions:

1. How did you do the fit? I do hill climbing due to all the min/max and possible non-linear response of evaluation features, but I'm interested if regalar fit methods from linear algebra have been applied with success.

2. Why didn't you stick to the method if it gave you so much improvement? Because of the Nd5?

In my case I gained at least 250 elo compared to rookie v2, but a lot of that can be attributed to neglecting weights in that old version (as was the case in yours).
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Ahhh... the holy grail of computer chess

Post by michiguel »

marcelk wrote:
michiguel wrote: It looks very similar to what I posted here a couple of years ago, both, tuning and the style.
http://www.talkchess.com/forum/viewtopic.php?t=27266
I used games from CCRL.

Miguel
That is very interesting and I wasn't aware of that. I wasn't following talkchess at that time.

[D]r4rk1/1bqnbppp/pp1ppn2/8/2PNP3/2N1B1P1/PP3PBP/2RQR1K1 w - - 5 13

Regarding your position: My program briefly suggests Nd5 at ply 7 but quickly changes its mind back to f4 and sticks with that.

I have two questions:

1. How did you do the fit? I do hill climbing due to all the min/max and possible non-linear response of evaluation features, but I'm interested if regalar fit methods from linear algebra have been applied with success.
I have an ad-hoc method. if I have to define it, I think it would be a combination of "simplex" method and hill climbing.

2. Why didn't you stick to the method if it gave you so much improvement? Because of the Nd5?
Still using it today!

In my case I gained at least 250 elo compared to rookie v2, but a lot of that can be attributed to neglecting weights in that old version (as was the case in yours).
In many cases, helped me to realize that some terms were useless or that some of them were overlapping. In a way, it helps to detects bugs too.

Miguel
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Ahhh... the holy grail of computer chess

Post by abulmo »

mike_bike_kite wrote:
Don wrote: It's that same "slight pressure to improve" that makes us different to yeast cells.
I am not sure the comparison to yeast cells is adequate. The two most studied yeasts, the budding yeast and the mating yeast are supposed to have diverged 1 billion (10^9) years ago, based on their genetic differences. In that case, on billion years of evolution just produces another yeast, not a great improvement.
Richard
mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: Ahhh... the holy grail of computer chess

Post by mike_bike_kite »

abulmo wrote:In that case, on billion years of evolution just produces another yeast, not a great improvement.
If it's gene's haven't mutated then that indicates it's effectively "perfect" at whatever it does. Just because we're more complex certainly doesn't mean we're better. The aim of life's game is simply to have more of your gene's survive in the long run.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Ahhh... the holy grail of computer chess

Post by tpetzke »

The only reason I do 2-ply instead of 0-ply is because I haven't optimized the communication between tuner and engine. That I/O still has such a big contribution that the ply difference is hardly noticeable. (First make something that works, then make it fast.)
Do you do a 2-ply + qSearch or just stop after 2 ply ? I can imagine that pure 2 ply work because an immediate capture is considered when moving to a bad square.

I think a 1 ply search without qSearch would take much longer to produce something reasonable.

Thomas...
abulmo
Posts: 151
Joined: Thu Nov 12, 2009 6:31 pm

Re: Ahhh... the holy grail of computer chess

Post by abulmo »

mike_bike_kite wrote:
abulmo wrote:In that case, one billion years of evolution just produces another yeast, not a great improvement.
If it's gene's haven't mutated then that indicates it's effectively "perfect" at whatever it does..
But the opposite happened. Genes have mutated a lot between the two yeasts, and the estimation of the age of divergence is based on the mutation count. Mutations do not always produce an improvement. Most of them just have a neutral effect. There is nothing like a perfect gene that do not mutate anymore.
Richard
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Ahhh... the holy grail of computer chess

Post by tpetzke »

Depending how close the individual is to an optimum the more likely a mutation will have a negative effect, and the selection process makes sure this mutation does not survive.

But mutation has only a small effect on the properties of the individuals anyway because they are rare, a much bigger diversity is reached through mating two individuals to produce off springs where the genoms of the parents are mixed.

Thomas...
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Ahhh... the holy grail of computer chess

Post by Don »

marcelk wrote:
Don wrote: You want something that produces the strongest signal with least effort. I'm not sure game outcome is an ideal signal because it seems very weak to me. In other words a LOT of effort to get back 1 or 2 bits of information. However it does have some nice characteristics too, you cannot argue with results.
Yes, I agree with you.

The problem with TD is that you need something to bootstrap from (at least that is my assumption).
TD also uses the result of the game as a training signal. A checkmate score is in the future and all positions leading to checkmate tend to be high scoring, so even if you have NO knowledge whatsoever of how weights should be set the program very quickly discovers that queens are better than anything else, and so on. Bootstrapping is probably a more accurate description of TDL than the methods you are talking about because it takes it's own signals (as well as the game result) and improves on them.

Ok, I bootstrapped from GM games but I could just as well have used 1000 ELO games and bootstrap from that. And using game outcome can uncover knowledge that the oracle doesn't possess (or knowledge that even the GMs don't have but that be filtered out of their games). I'm not exactly sure if TD can correct blind spots. I have to admid that I haven't thought too much about that yet.

Game outcome is indeed a weak signal but a 2-ply search is a cheap operation also. I was trying to find something more economic than game playing which I consider an extremely wasteful method in terms of resources.

The only reason I do 2-ply instead of 0-ply is because I haven't optimized the communication between tuner and engine. That I/O still has such a big contribution that the ply difference is hardly noticeable. (First make something that works, then make it fast.)
User avatar
marcelk
Posts: 348
Joined: Sat Feb 27, 2010 12:21 am

Re: Ahhh... the holy grail of computer chess

Post by marcelk »

tpetzke wrote: Do you do a 2-ply + qSearch or just stop after 2 ply ?
2-ply + qsearch.