Chess Position Evaluation Philosophy – Part 2

Tim Ferriss of “Four Hour Work Week / Body / Chef” fame has championed the idea of Minimum Effective Dose.  This is simply the smallest does which will have the desired outcome.  In the context of computer chess evaluation I think it’s interesting. 

I would like to try to create an automatic parameter tuning framework for the evaluation function using Probability Based Incremental LearningThomas Petzke is doing some cool stuff in this area.  However the more parameters I have the more difficult it will be to tune.  So my aim is to create a Minimum Effective Evaluation.  Of course over time I’ll add to the evaluation but only when improvements are significant and proven (at least that’s the intention).

To this end I’ve been going over some articles which I have previously saved to Evernote.  This one from Ed Schroeder is of particular interest – The Value of an Evaluation Function.  Ed shows the relative importance of each evaluation term.  In summary it would seem the high level order of importance is as follows:

  1. Mobility
  2. Passed Pawn
  3. Piece Square Tables
  4. King Safety
  5. Minor Piece “Stuff”
  6. Pawn Evaluation

I’m going to use this to prioritize my effort.

  • TonyRo

    Really interesting stuff, thanks! And thanks for starting this blog! I’m just starting out in chess programming (hence why I’m hanging out here), but it does seem there’s a lot of room for automated optimization of these parameters. I’m a thermal engineer at a big engineering firm, and we use automated processes to design optimal (or close to it) heat sinks (the geometry of the structure is modified in accordance with minimizing, let’s say, temperature of electrical components, etc…) with a click of a button (and a lot of time). Chess has a lot of parameters and so it could be time consuming, but I look forward to tackling such problems soon.

    I wonder about the piece mobility tables. I don’t know that much about the subject, but it seems as though (at least in what I’ve read on the Rebel site) they’re mostly constant. Has anyone ever generated these tables on the fly based on opponents King position? It seems as though if it’s your goal to produce an engine that’s aggressive (I’ve read the design philosophy), then the piece tables values should fluctuate in-game based on the location of the opponent’s King. Also, just taking a look at the knight table here for instance:

    I wonder about the values in these tables just on a completely philosophical level – at least in the middlegame, I get that they’re based on the idea that your pieces should control the squares in the center, but take a knight on e5 – I find it somewhat silly to rate the squares d3 and f7 the same. In any normal middlegame position, d3 is likely less relevant to your knight’s action than one of the squares in the heart of your opponent’s position. This is less true in most endgames. Also, I wonder if it’s possible that these weightings are just wrong in general – landing a knight on your opponent’s sixth rank, like e6 for instance, is typically stronger than e5, but less probable. I even remember reading somewhere that Kasparov thought f5 was one of the best squares for a knight, but again this would score lower.

    Again, this somewhat circles back to changing these tables on the fly – based perhaps on phase of the game and the position of your opponents king. Perhaps this is too short-sighted of me though – maybe other things like the King Safety evaluation come into play here as well to balance things out, and I’m not considering them. Like I said, I don’t have a lot of experience. Thanks again,


    • Steve Maughan

      Hi Tony,

      The old Super Constellation chess computers from Novag (engine by David Kittinger) computed the piece tables at the root. This meant they didn’t need to do much processing to evaluate a node in the tree. This was back in the early 80’s when a 7 ply search was “quite deep”. For the time this approach was quite revolutionary. The drawback is with deeper searches the end nodes may look quite different from the root. So the knowledge created in the piece tables becomes less relevant.

      If I were you I wouldn’t try to ask too much of piece tables. Most of the knowledge aspects you mention can be covered by other terms (e.g. king safety). I see piece tables as a ways to guide the search in the absence of anything better to do!

      Also, most modern programs have two piece tables for each types of piece – one for the middle game and one for the endgame. They interpolate between the two as the game progresses. A good example would be the king’s PST – which has a bonus for the castles location in the middle game and bonuses the center in the endgame.

      (Admirals Club São Paulo – heading to Florida!)

  • TonyRo

    Also, regarding the unusually low importance of pawn structure like doubled pawns, etc…

    I remember reading an article somewhere (I can’t seem to dig it up) where Larry Kaufman expressed the same surprise during his testing of Rybka. Thomas Petzke noted the same thing here during his testing of the genetic optimization schemes:


  • Hi Steve,

    I’m not so sure about the piece square table stuff. They are a cheap way to express some basic chess principles like knight on the rim or centralization. Ed found them very important because when he removed them the strength of the engine dropped a lot. But I think not because they are so important but because they interact with almost all features of the engine. Most likely PSQ was after material one of the first features he added, so all other features are tuned with PSQ already being present. If you remove them all other features get out of balance (especially mobility) and this hits the engine. If you had a tuned engine version without PSQ tables I guess it probably would not be much weaker than the one with it.

    Up to version 0.3 iCE played without PSQ tables, it was one of the last features I added in 0.4 and iCE did not get a 100+ ELO boost from them for sure.

    Double pawns are a very difficult term, sometimes they are weak and sometimes they are strong. They might be a bit more often weak than strong, but the value for “just the presence of the double pawn” is probably small. I think Larry and Don have different terms for double pawns to separate the strong from the weak ones. If you have a 3000+ engine this probably makes sense.

    • Steve Maughan

      Hi Thomas – You’re confirming my initial suspicions. As I said in one post, writing a chess program is really a manual hill-climb optimization. Which implies “where you start impacts where you’ll end up”. This is the reason I’d like to create a more rounded evaluation function for Maverick from day-1. However, based on Ed’s research I’m just going to have “weak” pawns in the first evaluation function. These will be backward, double, isolated etc. I’ll give a bonus for attacking any of these weak pawns.