Here are some amateurish musings...
Position evaluation function returns a scalar product of position features and their corresponding weights. For example, a rook is worth 500 points, so position evaluation might involve calculating the difference between how many rooks each player has and multiplying that by 500.
On one hand, it makes sense to have feature weights symmetrical for both players. If "d2-d4" is the best move for a given position, then swapping color of every piece on the board and changing the side player whose turn it is would not alter the best move. It would just be mirrored to "d7-d5".
On the other hand, White has the advantage of the first move, which results in significant skew of the outcome statistics in high-level play.
I have come across the maxim "White plays trying to win, black plays trying to draw". Which in my eyes would imply that players are very much asymmetrical and the base worth of a white rook should be somewhat different from that of a black rook. Same would follow for all the other weights being considered in the evaluation.
I am curious how to get out of this logical contradiction...
I realize that there might be a case for symmetrical function for the sake of simplicity and having fewer variables to tune.
Should the evaluation function be symmetrical for both players?
Moderators: hgm, Rebel, chrisw
-
- Posts: 6
- Joined: Tue Sep 07, 2021 6:17 pm
- Full name: Olexiy Svitashev
-
- Posts: 313
- Joined: Tue Aug 03, 2021 2:41 pm
- Full name: Bill Beame
Re: Should the evaluation function be symmetrical for both players?
My objective is to find mate in the minimum possible moves. Using chess puzzles from 4-ply to 20-ply I developed an optimization function for both sides. That function is no where near symmetrical; however, check moves do carry the most significant weights for both sides. In ELO optimization there is no such thing as symmetry. If you optimize by openings and defense, most of the metrics are not included in both sets, let alone symmetrical.osvitashev wrote: ↑Tue Sep 21, 2021 11:45 pm Here are some amateurish musings...
Position evaluation function returns a scalar product of position features and their corresponding weights. For example, a rook is worth 500 points, so position evaluation might involve calculating the difference between how many rooks each player has and multiplying that by 500.
On one hand, it makes sense to have feature weights symmetrical for both players. If "d2-d4" is the best move for a given position, then swapping color of every piece on the board and changing the side player whose turn it is would not alter the best move. It would just be mirrored to "d7-d5".
On the other hand, White has the advantage of the first move, which results in significant skew of the outcome statistics in high-level play.
I have come across the maxim "White plays trying to win, black plays trying to draw". Which in my eyes would imply that players are very much asymmetrical and the base worth of a white rook should be somewhat different from that of a black rook. Same would follow for all the other weights being considered in the evaluation.
I am curious how to get out of this logical contradiction...
I realize that there might be a case for symmetrical function for the sake of simplicity and having fewer variables to tune.
I use minimum calls to the engine, not speed like nps. You can have a very fast engine and lousy evaluation. There is an optimum number of evaluation metrics which differs depending on opening. Symmetry schemmetry.
-
- Posts: 6997
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: Should the evaluation function be symmetrical for both players?
For some reason making the own queen 1% more worth than the opponent gave me elo.
90% of coding is debugging, the other 10% is writing bugs.
-
- Posts: 27817
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Should the evaluation function be symmetrical for both players?
One would expect that to work only when your engine handles Queens better than the average opponent. That could of course very well be the case, but one could argue that this makes it a testing artifact.
-
- Posts: 373
- Joined: Wed Mar 22, 2006 10:17 am
- Location: Novi Sad, Serbia
- Full name: Karlo Balla
Re: Should the evaluation function be symmetrical for both players?
I think you are mixing a symmetrical evaluation with a symmetrical position. I don't know if there is a formal definition of the symmetrical evaluation, but I would define it as E(x) = -E(~x) where ~ is the flipping operator. It just means that if you flip the board together with the side to move you get a value of the same magnitude but with the opposite sign. It has almost nothing to do with a symmetrical position.osvitashev wrote: ↑Tue Sep 21, 2021 11:45 pm Here are some amateurish musings...
Position evaluation function returns a scalar product of position features and their corresponding weights. For example, a rook is worth 500 points, so position evaluation might involve calculating the difference between how many rooks each player has and multiplying that by 500.
On one hand, it makes sense to have feature weights symmetrical for both players. If "d2-d4" is the best move for a given position, then swapping color of every piece on the board and changing the side player whose turn it is would not alter the best move. It would just be mirrored to "d7-d5".
On the other hand, White has the advantage of the first move, which results in significant skew of the outcome statistics in high-level play.
I have come across the maxim "White plays trying to win, black plays trying to draw". Which in my eyes would imply that players are very much asymmetrical and the base worth of a white rook should be somewhat different from that of a black rook. Same would follow for all the other weights being considered in the evaluation.
I am curious how to get out of this logical contradiction...
I realize that there might be a case for symmetrical function for the sake of simplicity and having fewer variables to tune.
What you propose to score more for the side to move doesn't make the evaluation asymmetrical. You just decided to score one feature of the position (tempo). To make a true asymmetrical evaluation you should fix the sides and define for example Q=10 and q = 9 (as Rebel pointed out). Asymmetrical evaluation can heavily impact the style of the engine. If you score your pieces more than the opponent's pieces your program will avoid exchanges and vice versa. Like with the evaluation, it is possible to make the search asymmetrical. In the past, there were some famous engines with asymmetrical search. For example, Lang's engines tend to prune more for their own side, making the engine more solid, while Whittington's engines prune more for the opponent's side making the engine more aggressive.
Last, but not least, I think there is no such thing as a symmetrical position since one side has always a move at its disposal.
Best Regards,
Karlo Balla Jr.
Karlo Balla Jr.
-
- Posts: 6997
- Joined: Thu Aug 18, 2011 12:04 pm
- Full name: Ed Schröder
Re: Should the evaluation function be symmetrical for both players?
Well, the elo came from self-play, that's why I said for some reason.
90% of coding is debugging, the other 10% is writing bugs.
-
- Posts: 373
- Joined: Wed Mar 22, 2006 10:17 am
- Location: Novi Sad, Serbia
- Full name: Karlo Balla
Re: Should the evaluation function be symmetrical for both players?
If there is an Elo difference then it is not the same engine. If it is not the same engine then it is not the self-playRebel wrote: ↑Wed Sep 22, 2021 11:48 amWell, the elo came from self-play, that's why I said for some reason.
Best Regards,
Karlo Balla Jr.
Karlo Balla Jr.
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: Should the evaluation function be symmetrical for both players?
Of course it should be symmetrical.
Think about switching the colors and turning the board 180°. You end up with the same position again. In fact its not a bad idea to do that for the transposition table for every odd move since its the same position.
Think about switching the colors and turning the board 180°. You end up with the same position again. In fact its not a bad idea to do that for the transposition table for every odd move since its the same position.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
Re: Should the evaluation function be symmetrical for both players?
All the Rodent personalities are based on asymmetric evaluation. A few are within 10 ELo to default. I wouldn't be surprised if there is an asymmetric setting that beats default, haven't found it in 10 years though.
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm
-
- Posts: 710
- Joined: Sat Dec 06, 2014 1:53 pm
Re: Should the evaluation function be symmetrical for both players?
To my understanding (I'm not a programmer or math scientist), rules of chess are highly assymetrical.osvitashev wrote: ↑Tue Sep 21, 2021 11:45 pm I am curious how to get out of this logical contradiction...
For symmetrical evaluation, you need rules to be symmetrical. At least this 3 rules (may be some more):
1) a king in check may leave in check, if his side immediately gives check to attacking kingdom (allow 2 kings to be in check simultaneously). OR completely remove check rule.
2) if king is mated and opponent king can be mated in 1 turn - it is draw (allow 2 kings to be mated simultaneously)
3) abandone castling requirment "The king does not pass through a square that is attacked by an enemy piece" (Attacking enemy empty squares cannot prevent his right for castling)