is SF contempt too low (or too high)?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

yanquis1972
Posts: 1766
Joined: Wed Jun 03, 2009 12:14 am

is SF contempt too low (or too high)?

Post by yanquis1972 »

i just stumbled upon this study by stefan pohl --
2018/01/05 I repeated the 5000 games testrun of Stockfish 171206 with some different Contempt settings. Let's see, if the new contempt-algorithm of Stockfish can lower the draw-rate and/or gain some Elo.


Games Completed = 5000 of 5000 (Avg game length = 424.849 sec)
Settings = Gauntlet/512MB/180000ms+1000ms/M 400cp for 4 moves, D 130 moves
1. Stockfish 171206 bmi2 3521.5/5000 2299-256-2445 (L: m=0 t=0 i=0 a=256) (D: r=1631 i=411 f=109 s=17 a=277)
2. Komodo 11.2.2 x64 412.5/1000 86-261-653 (L: m=0 t=0 i=0 a=261) (D: r=379 i=178 f=35 s=2 a=59)
3. Houdini 6 pext 462.0/1000 115-191-694 (L: m=1 t=0 i=0 a=190) (D: r=510 i=77 f=35 s=10 a=62)
4. Fire 6.1 popc 209.0/1000 11-593-396 (L: m=0 t=0 i=0 a=593) (D: r=270 i=39 f=15 s=3 a=69)
5. Shredder 13 x64 207.0/1000 15-601-384 (L: m=0 t=0 i=0 a=601) (D: r=260 i=69 f=13 s=2 a=40)
6. Fizbo 1.9 bmi2 188.0/1000 29-653-318 (L: m=1 t=0 i=0 a=652) (D: r=212 i=48 f=11 s=0 a=47)


Games Completed = 5000 of 5000 (Avg game length = 437.087 sec)
Settings = Gauntlet/512MB/180000ms+1000ms/M 400cp for 4 moves, D 130 moves
1. Stockfish 171206 C=15 3551.0/5000 2400-298-2302 (L: m=0 t=0 i=0 a=298) (D: r=1412 i=430 f=128 s=17 a=315)
2. Komodo 11.2.2 x64 412.5/1000 105-280-615 (L: m=0 t=0 i=0 a=280) (D: r=327 i=175 f=27 s=2 a=84)
3. Houdini 6 pext 461.5/1000 126-203-671 (L: m=0 t=0 i=0 a=203) (D: r=432 i=121 f=31 s=11 a=76)
4. Fire 6.1 popc 199.0/1000 21-623-356 (L: m=1 t=0 i=0 a=622) (D: r=226 i=34 f=28 s=1 a=67)
5. Shredder 13 x64 186.5/1000 11-638-351 (L: m=0 t=0 i=0 a=638) (D: r=223 i=53 f=24 s=3 a=48)
6. Fizbo 1.9 bmi2 189.5/1000 35-656-309 (L: m=1 t=0 i=0 a=655) (D: r=204 i=47 f=18 s=0 a=40)


Games Completed = 5000 of 5000 (Avg game length = 439.036 sec)
Settings = Gauntlet/512MB/180000ms+1000ms/M 400cp for 4 moves, D 130 moves
1. Stockfish 171206 C=25 3554.0/5000 2463-355-2182 (L: m=1 t=0 i=0 a=354) (D: r=1293 i=455 f=118 s=19 a=297)
2. Komodo 11.2.2 x64 434.0/1000 139-271-590 (L: m=0 t=0 i=0 a=271) (D: r=282 i=194 f=36 s=1 a=77)
3. Houdini 6 pext 470.0/1000 150-210-640 (L: m=0 t=0 i=0 a=210) (D: r=436 i=100 f=34 s=16 a=54)
4. Fire 6.1 popc 175.0/1000 11-661-328 (L: m=0 t=0 i=0 a=661) (D: r=192 i=37 f=16 s=1 a=82)
5. Shredder 13 x64 186.5/1000 17-644-339 (L: m=0 t=0 i=0 a=644) (D: r=205 i=64 f=18 s=1 a=51)
6. Fizbo 1.9 bmi2 180.5/1000 38-677-285 (L: m=2 t=0 i=1 a=674) (D: r=178 i=60 f=14 s=0 a=33)


Games Completed = 5000 of 5000 (Avg game length = 442.943 sec)
Settings = Gauntlet/512MB/180000ms+1000ms/M 400cp for 4 moves, D 130 moves
Time = 554778 sec elapsed, 0 sec remaining
1. Stockfish 171206 C=40 3618.0/5000 2598-362-2040 (L: m=0 t=0 i=0 a=362) (D: r=1140 i=447 f=93 s=25 a=335)
2. Komodo 11.2.2 x64 403.0/1000 118-312-570 (L: m=0 t=0 i=0 a=312) (D: r=234 i=212 f=23 s=4 a=97)
3. Houdini 6 pext 483.0/1000 183-217-600 (L: m=0 t=0 i=0 a=217) (D: r=380 i=97 f=33 s=16 a=74)
4. Fire 6.1 popc 172.5/1000 12-667-321 (L: m=2 t=0 i=0 a=665) (D: r=197 i=31 f=14 s=3 a=76)
5. Shredder 13 x64 164.5/1000 17-688-295 (L: m=0 t=0 i=0 a=688) (D: r=171 i=60 f=15 s=2 a=47)
6. Fizbo 1.9 bmi2 159.0/1000 32-714-254 (L: m=3 t=0 i=0 a=711) (D: r=158 i=47 f=8 s=0 a=41)




Conclusions: (all comparsions to the result of Stockfish 171206 with default Contempt=0)

1) C=+15 gained +5 Elo. Draws overall lowered from 48.9% to 46.0%. 3fold-draws lowered from 32.6% to 28.2%

2) C=+25 gained +5 Elo. Draws overall lowered from 48.9% to 43.6%. 3fold-draws lowered from 32.6% to 25.9%

3) C=+40 gained +17 Elo. Draws overall lowered from 48.9% to 40.8%. 3fold-draws lowered from 32.6% to 22.8%
from https://www.sp-cc.de/experiments.htm

worth noting that contempt wasn't pushed to failure (eg a value of 50+ might produce even better results).

raising contempt from 25 (default is 24, i think) to 40 traded 7 losses (essentially noise) for 135 wins.

from default of 0 each step up (5. 15, 25) decreased draw rate but didn't really increase elo.

even with a level of opponent argument, i wonder if play contempt shouldn't be set to 40 or higher for stockfish. suppose lc0 matches it in overall strength; i'd speculate greater contempt settings will benefit stockfish there as well due to the known strengths & weaknesses of NNs. no one else is close.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: is SF contempt too low (or too high)?

Post by zullil »

Stockfish should not have any contempt. Contempt is just fluff added to help Stockfish win chess games.

Stockfish is not a chess program; it's a chess engine:

"Stockfish is a free, powerful UCI chess engine derived from Glaurung 2.1. It is not a complete chess program ..."

As such, winning games is not its purpose. :shock: