Most important eval elements

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

Most important eval elements

Post by silentshark »

Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.

For instance, how many ELO points will you engine gain if it understands about isolated pawns? How many will it gain if it understands the concept of a bishop pair? Rooks on the 7th rank? Mobility?

I'm sure there are many other variables.. search being one.. but it'd be fascinating to take a certain engine, strip out most of it's eval, work out it's ELO, then add in the various "standard" eval elements seeing the effect on ELO..
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Most important eval elements

Post by michiguel »

silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.

For instance, how many ELO points will you engine gain if it understands about isolated pawns? How many will it gain if it understands the concept of a bishop pair? Rooks on the 7th rank? Mobility?

I'm sure there are many other variables.. search being one.. but it'd be fascinating to take a certain engine, strip out most of it's eval, work out it's ELO, then add in the various "standard" eval elements seeing the effect on ELO..
Mobility is important, but I cannot say how much. Together with a correct passed pawn evaluation is one of the most important parameters, besides material. Proper king activity in the endgame was very important for me too (~40 elo points).

I think it is difficult to strip a parameter and measure ELO. Everything else needs to be retuned.

Miguel
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Most important eval elements

Post by Dann Corbit »

If you go here:
http://sites.google.com/site/strategict ... st-results

And look for the file results.xls, you will see scores for many engines based upon ten different strategic evaluation themes:
1. Undermining
2. Open Files and Diagonals
3. Knight Outposts
4. Square Vacancy
5. Bishop vs Knight
6. Re-Capturing
7. Offer of Simplification
8.Advancement of f/g/h pawns
9. Advancement of a/b/c Pawns
10. Simplification

You can also see that there is some kind of correlation between the scores and the Elo values for the engines on various lists.

In general, tactical tests do not correspond to Elo scores very well (except that to be a strong engine you must at least do reasonably well on simple tactical sets like WAC).

In general, one of the most important things for a good evaluation is mobility. Look at how strong Olithink is, and it's eval is just about pure mobility and nothing else.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Most important eval elements

Post by hgm »

The issueis complicated by the fact that the engine should not only understand the concept, but also assign the proper value to it. With wrong tuning a valuable term might actually backfire, and cost Elo rather than add it.

The Bishop pair is an important concept, but you can get by without it by setting Bishops more valuable than Knights. This prevents your engine will waste its own Bishoppair, and makesit attempt to destroy the opponent's pair. OTOH, once you have destroyed the opponent's pair,it might give away the advantage by trading Bishops, and it gets an unreasonable fear for trading last Knight against last Bishop.
User avatar
phhnguyen
Posts: 1434
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: Most important eval elements

Post by phhnguyen »

silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Most important eval elements

Post by Dann Corbit »

phhnguyen wrote:
silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
And yet it is sometimes surprising how well a program can play with the evaluation constants badly set away from their correct values of:

opening:
Pawn = 100
Knight = 413
Bishop = 422
Rook = 641
Queen =1273

endgame:
Pawn = 130
Knight = 427
Bishop = 433
Rook = 645
Queen =1292
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Most important eval elements

Post by Dann Corbit »

Dann Corbit wrote:
phhnguyen wrote:
silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
And yet it is sometimes surprising how well a program can play with the evaluation constants badly set away from their correct values of:

opening:
Pawn = 100
Knight = 413
Bishop = 422
Rook = 641
Queen =1273

endgame:
Pawn = 130
Knight = 427
Bishop = 433
Rook = 645
Queen =1292
Those were approximations using the Stockfish model. These are from Gull:

opening:
Pawn = 100
Knight= 361.111
Bishop= 361.111
Rook = 555.556
Queen =1083.33

endgame:
Pawn = 111.111
Knight = 361.111
Bishop = 361.111
Rook = 555.556
Queen =1083.33
Dann Corbit
Posts: 12537
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Most important eval elements

Post by Dann Corbit »

Dann Corbit wrote:
Dann Corbit wrote:
phhnguyen wrote:
silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
And yet it is sometimes surprising how well a program can play with the evaluation constants badly set away from their correct values of:

opening:
Pawn = 100
Knight = 413
Bishop = 422
Rook = 641
Queen =1273

endgame:
Pawn = 130
Knight = 427
Bishop = 433
Rook = 645
Queen =1292
Those were approximations using the Stockfish model. These are from Gull:

opening:
Pawn = 100
Knight= 361.111
Bishop= 361.111
Rook = 555.556
Queen =1083.33

endgame:
Pawn = 111.111
Knight = 361.111
Bishop = 361.111
Rook = 555.556
Queen =1083.33
Crafty uses these:
# define PAWN_VALUE 100
# define KNIGHT_VALUE 325
# define BISHOP_VALUE 325
# define ROOK_VALUE 500
# define QUEEN_VALUE 1050

and seems to do pretty well despite the drastic undervalue for knight and bishop of nearly a pawn weight.
User avatar
silentshark
Posts: 327
Joined: Sat Mar 27, 2010 7:15 pm

Re: Most important eval elements

Post by silentshark »

Dann Corbit wrote:
phhnguyen wrote:
silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
And yet it is sometimes surprising how well a program can play with the evaluation constants badly set away from their correct values of:

opening:
Pawn = 100
Knight = 413
Bishop = 422
Rook = 641
Queen =1273

endgame:
Pawn = 130
Knight = 427
Bishop = 433
Rook = 645
Queen =1292
Interesting.. why do you feel these are correct.

I've been using

pawn=100
knight=bishop=400
rook=600
queen=1200

for a long time now, but maybe these values are smarter.
bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: Most important eval elements

Post by bhlangonijr »

Dann Corbit wrote:
Dann Corbit wrote:
Dann Corbit wrote:
phhnguyen wrote:
silentshark wrote:Hi all,

I've been looking again at my eval. It got me thinking, what are the most important things to include in an evaluation function, and what are they worth, ELO wise? I appreciate this isn't an exact science.
IMO, the most important thing is very clear and simple which programmers usually forget: materials. It can cost 99% of a program's ELO if wrongly set.
And yet it is sometimes surprising how well a program can play with the evaluation constants badly set away from their correct values of:

opening:
Pawn = 100
Knight = 413
Bishop = 422
Rook = 641
Queen =1273

endgame:
Pawn = 130
Knight = 427
Bishop = 433
Rook = 645
Queen =1292
Those were approximations using the Stockfish model. These are from Gull:

opening:
Pawn = 100
Knight= 361.111
Bishop= 361.111
Rook = 555.556
Queen =1083.33

endgame:
Pawn = 111.111
Knight = 361.111
Bishop = 361.111
Rook = 555.556
Queen =1083.33
Crafty uses these:
# define PAWN_VALUE 100
# define KNIGHT_VALUE 325
# define BISHOP_VALUE 325
# define ROOK_VALUE 500
# define QUEEN_VALUE 1050

and seems to do pretty well despite the drastic undervalue for knight and bishop of nearly a pawn weight.
I have been using values close to these ones. I think you should have a good balance between static values and dynamic terms rather than approximating the static values to a general case.

I would say material + PST + mobility are the most important evaluation terms. Althought king safety helped a lot my program's playing strength.