Contempt
Posted: Tue May 14, 2013 7:30 am
I recently implemented a contempt feature in DiscoCheck, as follows: the value of a draw by chess rules is -Contempt for the engine (root color) and +Contempt for the opponent.
I suppose this is the most basic and standard approach to contempt. The good thing about it is that it doesn't require any modification in the eval that would make it asymmetric (symmetry is important for me as I use the post null move trick to skip lots of eval calls).
I experimented with Contempt = 25 cp, and got the following results (no early stopping, tc=10+0.1, hash=16, opening played symmetrically and sequentially from same EPD file, so all is perfectly fair and equal)
=> self-play: equal
(BayesELO ratings and LOS matrix)
Difference is well with the error bar, as shown by the LOS matrix.
The draw rate is significantly lower than without contempt. Self-play gives me a draw rate around 55% in these conditions usually. So it behaves as expected, and avoid engines accepting 3-repetition draws in +/- equal positions (same for 50-move, insufficient material, stalemate, but 3-repeeition is by far the biggest plague).
=> foreign opponents: equal
Each version (Contempt=0 and Contempt=25) plays the same gauntlet in the exact same conditions (5000 games vs. Fruit and 5000 vs. Gaviota)
Difference is well with the error bar, as shown by the LOS matrix.
Draw rate is also decreased against foreign opponents (starting from a much lower figure of 28%, while self-play w/o contempt was around 55%).
So I will leave the default value to 25cp, as it makes the playing style more entertaining. I much prefer when the engines fight to the death, rather than agree on a 3-move repetition a few moves out of the opening in a +/- equal position.
It's interesting to note that there is no ELO cost (nor gain obviously). I don't have the time and CPU resources to experiment with higher values, but it's possible that this value can be increased even more without hurting ELO.
Another thing that we would expectis that Contempt=25 performs relatively(to Contempt=0) better against Fruit (the weaker opponent) and worse against Gaviota (the stronger opponent). This is neither confirmed nor refuted by the empirical evidence, perhaps because the ELO difference between these engines is probably too small to be able to measure it reliably. Anyway, if I isolate the 2 gauntlets, here are the BayesELO ratings table:
I suppose this is the most basic and standard approach to contempt. The good thing about it is that it doesn't require any modification in the eval that would make it asymmetric (symmetry is important for me as I use the post null move trick to skip lots of eval calls).
I experimented with Contempt = 25 cp, and got the following results (no early stopping, tc=10+0.1, hash=16, opening played symmetrically and sequentially from same EPD file, so all is perfectly fair and equal)
=> self-play: equal
Code: Select all
ResultSet-EloRating>ratings
Rank Name Elo + - games score oppo. draws
1 Contempt=0 1 4 3 12000 50% -1 46%
2 contempt=25 -1 3 4 12000 50% 1 46%
Co co
Contempt=0 72
contempt=25 27
Difference is well with the error bar, as shown by the LOS matrix.
The draw rate is significantly lower than without contempt. Self-play gives me a draw rate around 55% in these conditions usually. So it behaves as expected, and avoid engines accepting 3-repetition draws in +/- equal positions (same for 50-move, insufficient material, stalemate, but 3-repeeition is by far the biggest plague).
=> foreign opponents: equal
Each version (Contempt=0 and Contempt=25) plays the same gauntlet in the exact same conditions (5000 games vs. Fruit and 5000 vs. Gaviota)
Code: Select all
Rank Name Elo + - games score oppo. draws
1 Gaviota v0.86 22 6 5 10000 53% 0 22%
2 Contempt=25 1 6 6 10000 50% 0 25%
3 Contempt=0 -1 6 5 10000 50% 0 28%
4 Fruit 05/11/03 -22 5 5 10000 47% 0 30%
Ga Co Co Fr
Gaviota v0.86 99 99100
Contempt=25 0 70 99
Contempt=0 0 29 99
Fruit 05/11/03 0 0 0
Draw rate is also decreased against foreign opponents (starting from a much lower figure of 28%, while self-play w/o contempt was around 55%).
So I will leave the default value to 25cp, as it makes the playing style more entertaining. I much prefer when the engines fight to the death, rather than agree on a 3-move repetition a few moves out of the opening in a +/- equal position.
It's interesting to note that there is no ELO cost (nor gain obviously). I don't have the time and CPU resources to experiment with higher values, but it's possible that this value can be increased even more without hurting ELO.
Another thing that we would expectis that Contempt=25 performs relatively(to Contempt=0) better against Fruit (the weaker opponent) and worse against Gaviota (the stronger opponent). This is neither confirmed nor refuted by the empirical evidence, perhaps because the ELO difference between these engines is probably too small to be able to measure it reliably. Anyway, if I isolate the 2 gauntlets, here are the BayesELO ratings table:
Code: Select all
Rank Name Elo + - games score oppo. draws
1 Gaviota v0.86 22 6 7 5000 53% -1 23%
2 Contempt=0 -1 5 5 10000 50% 0 28%
3 Fruit 05/11/03 -21 6 6 5000 47% -1 32%
Rank Name Elo + - games score oppo. draws
1 Gaviota v0.86 21 6 7 5000 53% 1 21%
2 Contempt=25 1 5 5 10000 50% 0 25%
3 Fruit 05/11/03 -22 6 6 5000 47% 1 29%