One of the major weaknesses of pawn at the moment is that its evaluation function is a linear combination of features. This means that even if we tune the weights to their best possible value (e.g., via genetic algorithms optimization), it is still unable to play various phases of the game with enough precision because what is relevant in one phase (e.g., king protection during the opening and middle game), becomes less relevant in another (e.g., with few pieces on the board, it is no longer a good idea to keep the king away from the battle.)
I first noticed this while I was watching it play against crafty and realized that even though at some point it seemed to have an interesting advantage, it wasn't able to capitalize on it because of the above.
It seems to me that one solution might be to define a set of weights w_i as a function of the features F, according to something along the lines of:
where
This last equation shows that the weight for a given feature is a non-linear function (sigma could be a sigmoid function, a ReLU or any other non-linear function) of all features. In other words, the importance of a feature at any point in the game is determined by all other features at that moment. Of course, this last mapping (w*) must be learned in some way to reach optimal play, so this again becomes an optimization problem, except that we must now learn a matrix of weights instead of a single vector.
The possibilities to learn this matrix of weights are many (e.g., genetic algorithms framework, temporal differences learning, supervised learning using other chess engines, etc.)
This idea can also be roughly but imprecisely implemented by using a ser of different weights in discrete phases of the game (i.e., opening, middle game, ending), which are usually determined via heuristics (e.g., the ending starts after a certain amount of material is left; the weight for mobility is smaller in the end than in the opening; etc.) Of course, this can help improve the engine's performance, but it's always limited by our own human prejudices about what's good or bad in chess. As AlphaZero has proven, humans aren't necessarily at the top of the knowledge pyramid in any given domain.
One of the major weaknesses of
pawn
at the moment is that its evaluation function is a linear combination of features. This means that even if we tune the weights to their best possible value (e.g., via genetic algorithms optimization), it is still unable to play various phases of the game with enough precision because what is relevant in one phase (e.g., king protection during the opening and middle game), becomes less relevant in another (e.g., with few pieces on the board, it is no longer a good idea to keep the king away from the battle.)I first noticed this while I was watching it play against
crafty
and realized that even though at some point it seemed to have an interesting advantage, it wasn't able to capitalize on it because of the above.It seems to me that one solution might be to define a set of weights
w_i
as a function of the featuresF
, according to something along the lines of:where
This last equation shows that the weight for a given feature is a non-linear function (sigma could be a sigmoid function, a ReLU or any other non-linear function) of all features. In other words, the importance of a feature at any point in the game is determined by all other features at that moment. Of course, this last mapping (
w*
) must be learned in some way to reach optimal play, so this again becomes an optimization problem, except that we must now learn a matrix of weights instead of a single vector.The possibilities to learn this matrix of weights are many (e.g., genetic algorithms framework, temporal differences learning, supervised learning using other chess engines, etc.)
This idea can also be roughly but imprecisely implemented by using a ser of different weights in discrete phases of the game (i.e., opening, middle game, ending), which are usually determined via heuristics (e.g., the ending starts after a certain amount of material is left; the weight for mobility is smaller in the end than in the opening; etc.) Of course, this can help improve the engine's performance, but it's always limited by our own human prejudices about what's good or bad in chess. As AlphaZero has proven, humans aren't necessarily at the top of the knowledge pyramid in any given domain.