lichess.org
Donate

Comments on piece values

ChessChess variantChess engineSoftware Development
Continuing the measurement of piece values

Since my first blog post on how to determine piece values got much more attention and comments than I anticipated, I want to follow up on some of the feedback and open questions.

To briefly recap the linked post, the idea is to fit a function - using engine games as input data - that predicts the game result from the material distribution, and to then get the piece values from the function parameters.

Does the engine bias the result?

When doing statistics the source of the data unavoidably has an impact on the results. However, in this case the internal piece values of the engine is not communicated in any way to the output. The generated data only contains positions and the final result of the corresponding game in which the position occurred, i.e., no engine evaluations whatsoever. E.g., if the engine had inaccurate piece values and would go for unfavorable exchanges and lose a game, the method just sees that the position lead to a loss in the end and won't be biased by the engines misevaluation.

One can also put this idea to the extreme and try the algorithm on Stockfish with a completely random evaluation but a normal search algorithm (not to be confused with a random mover), with the following results:

PieceQRBNP
Value5.093.562.181.831.00

As you can see in the table above, despite the engine not knowing the piece values, the analysis on the resulting games still is able to at least determine the hierarchy of the pieces quite reliably. Due to the low quality of the games the values are not very precise of course, but definitely much better than what was put in, so it isn't just "garbage in, garbage out".

How do the piece values depend on the game phase?

Definitions of game phase often consider the value of pieces, but that is what we want to determine here in the first place. So in order to avoid that problem, we can resort to a simple definition and just identify game phase via the number of pieces. In this case I classify 17-32 pieces as opening/middlegame and 2-16 pieces as endgame. In order to get equally much data per game phase as for the initial analysis I generated another 100k positions, and extended the script to separate the data by game phase. With that the resulting game phase specific piece values are:

PieceQRBNP
Midgame9.764.012.972.891.00
Endgame9.294.652.992.901.00

The most significant game phase dependency according to these results is that the rook comparatively gets stronger towards the endgame. Considering that rook vs. minor piece(s) imbalances commonly get more favorable for the rook side towards the endgame this result seems intuitive to me.

Why does the king have no value?

As indicated in the initial post, the approach of correlating the material with the game result cannot apply to kings, because by the rules kings cannot be captured, so there never is an imbalance in their count. However, if we are not just interested in the king per se, but how powerful a piece with the king's movement would be, we can try to introduce non-royal king pieces, usually referred to as a commoner. Since Fairy-Stockfish supports almost arbitrary fairy chess pieces, I simply generated 200k positions where randomly one of the minor pieces of each side in the starting position was replaced by a commoner (C), and merged the resulting data with the 200k positions from the standard chess data.

PieceQRCBNP
Midgame9.774.573.123.203.081.00
Endgame9.134.613.192.942.801.00

Here the value of the king movement is roughly on par with minor pieces in the early phases of the game, but, as often assumed, is stronger than knight and bishop in the endgame. This still does not assign a value to the king, but at least to a non-royal piece moving like a king.

What is the value of the bishop pair?

One feedback also was that it would be interesting to get values on material imbalances, so I extended the tool to be able to consider arbitrary imbalances. However, the more complex the model, the more data you need to get reliable results, so for now I only enabled it for the bishop pair and left out other imbalances. The result then was:

PieceQRBNPB pair
Midgame9.794.022.922.871.000.46
Endgame9.294.652.922.891.000.63

So given this data it seems to estimate a bishop pair at approximately half a pawn.

Why is the value of a move so low?

With only 1/100th of a pawn the value of having the turn seems pretty low. However one needs to consider that this value does not specify how valuable the right to move is in a specific position, but rather how much predictive power the right to move adds on top of the material distribution to predict the game result. E.g., if the material distribution remains the same for a long time, but the right to move switches countless times, it does not help much in predicting the result. That is why this value is quite low and should not be equated with the value of a tempo in general.

What are the piece values for variant X?

I did not generate data for all variants, but for the variants where I did, including antichess, the results can be found in the wiki of the code repository. As the code is open source anyone can feel free to apply it to other games as well, or to try it on more or different data.

I very likely did not answer all questions and certainly this post will raise new ones, but I hope it still provides some useful insight and food for thought. All values given here are of course from a limited dataset and would likely change/refine with more and higher quality data. The message here is more about the methodology and the direction indicated by the values than about setting piece values in stone.