positional patterns for "human" engine

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
PK
Posts: 755
Joined: Mon Jan 15, 2007 10:23 am
Location: Warsza
Contact:

positional patterns for "human" engine

Post by PK » Sat Feb 16, 2013 11:59 pm

Recently there were some threads about engines that emulate human play. Creating an attacking player seems relatively easy - tweaking king safety, asymmetric mobility scoring (the fun thing is that skewing it in either side has its merits). Making an engine play something that at least looks like positional chess seems to be much more difficult. One of Glass personalities played something that looked like smooth, strategic game by overvaluating own mobility and enemy king attacks, but what if we want to avoid such tricks? Correct evaluation of endgames is a must, but positional plays does not begin when pieces come off.

Some chess trainers claim that it is about patterns. A positional player, especially in a favourite opening, knows what to do, where the pieces and the pawns belong.

I'd like to collect such ideas (for implenentation and perhaps for creating a test suite called "what would Brian Boitano do"). The problem is that I'm only a 1880 Elo player and therefore know only a limited subset of such patterns. So can You - especially the people eager to get a positional chess engine of moderate strength ;) - give some suggestions? A couple of ideas for starters:

001. with enemy pawns on a6 and b7, it is good to have own pawn on a4, and spectacularly good to have it on a5.

002: even better formulation is: if enemy pawn can make a jump move, it's qood to control a square it jumps over, more so if an opponent does not control it with a pawn

003. bishop on f1 is OK if white castled short, and should not be penalized

004: it's at least interesting to "artificially isolate" enemy pawn that went too far - i.e with wp on e5 and f2/f3, Black can consider ...g5

005: double pawns on e4/e3 and d4/d3 are more an asset than a liability (as long as they don't block the bishop)

006: there are bishops that should get a bonus for complementing one's pawn structure - i.e. wp on d4 and e3 "want" light squared bishop, bp on c6 and e6 (d5 exchanged) "want" dark squared bishop.

007: knight has good synergy with a pawn one square ahead of it

008: non-outpost knight has good synergy with a pawn 2 squares right/left of it

anything more? can we make it to 100?

carldaman
Posts: 1543
Joined: Sat Jun 02, 2012 12:13 am

Re: positional patterns for "human" engine

Post by carldaman » Sun Feb 17, 2013 1:51 am

This is a worthy initiative, Pawel. I very much like the way Rodent and Glass play chess, and the whole idea of distinct engine personalities, especially those emulating human playing styles.

The patterns you mentioned are a very good start. I hope others will contribute ideas. It is hard to instantly think of additional patterns per se, but I will mention some positional factors that come to mind such as: bonuses for protected, connected and outside passed pawns, pawns capturing towards the center (unless a more dangerous open file is a better option), pawn storm + mobility potential; 2 rooks on seventh rank bonus, penalties for 2 knights and 2 rooks redundancies (unless open files), lower value for the knight in endgame, bonus for an active king in endgame, bad/inactive bishop penalties, bonus for aiming pawn chain towards opponent's king + opening file(s) via pawn breaks/levers; bonuses for blockade square control, knights and bishops being best blockaders; penalties for dark/light square complex weaknesses, and for backward or doubled pawns on open files; penalties for opposite color bishop endings or rook + pawn endings (when up a pawn), extra bonus for permanent knight outposts, bonus for having fewer pawn islands, penalty for allowing queenside minority attack vs. bonus for healthy queenside majority, bonus for greater control of center, asymmetrical king safety where it's safer for own king to stay in the center behind pawn/piece shelter while attacking on flank.

I recommend reading the stuff that Larry Kaufman has written on the (relative) value of the pieces and material imbalances, and the classic Pawn Power in Chess, by Hans Kmoch, a very useful book.

Sorry if this is nothing new that I'm stating here, but it's a fascinating topic. :)

Regards,
CL

Maarten

Re: positional patterns for "human" engine

Post by Maarten » Sun Feb 17, 2013 5:27 am

For human chess it must be all about patterns, computer chess engines can easily out calculate any human chess player. To be even more specific: it's all about pattern recognition, and the assessment (read: evaluation) if the particular pattern is applicable in the given position. E.g. when you king is under heavy fire the pattern of having a pawn on a5 when black has pawns on a6 and b7 will not make any difference.

I also suspect that you need not only 100 patterns, but some thousands of patterns. Each pattern is only valid (read: shall have impact on evaluation) under certain conditions: pawn structure and piece placement. So the problem for each chess engine programmer is :
a. formulate the patterns
b. formulate the rules when a pattern is applicable
Both under the restriction that they can be:
- stated in a form you can translate in a programming language
- can be executed efficiently (i.e. within milliseconds). It doesn't make sense to have a pattern recognizer which takes minutes to establish the pattern and calculated the evaluation of that pattern, by then you have probably already lost the game on time.

It is quite difficult to take a chess handbook written for humans and try to formulate the patterns and rules for implementing in a chess program. I struggled already on formulating the patterns for a simple position as KPK.
Take for example your pattern: "004: it's at least interesting to "artificially isolate" enemy pawn that went too far - i.e. with wp on e5 and f2/f3, Black can consider ...g5 ". I'm really struggling on how to implement this in a programming language, and how to come up with evaluation parameters.

This is to me also the reason why Larry Kaufman’s article on material imbalance (see Larry’s wiki) is be read over and over by chess programmers, it one of the few texts from which you can extract patterns and formulate the rules for applicability. But Larry's article hardly mentions the concepts of pawn structure and piece placement. It is a groundbreaking article on material evaluation; we now need similar knowledge on pawn structure and piece placement patterns and the corresponding rules when each pattern is applicable. This task will not be covered by an article of 3 or 4 pages long I'm afraid.

Most of the patterns you mention I have in some form implemented in my private engine, except for pattern of doubled pawns on d3/d4 or e3/e4 being an asset. I'll give this a try, just for fun: I don't expect my engine jump from its current elo 2500 level to anything significant higher.

By studying the source of for example SF or Crafty, you'll find at least a 100 patterns, if not already much more. It would be a great idea to have a structured inventory of these patterns, something to include/extend in CPW?

Maarten

Post Reply