Advanced levers

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

Moderator: Ras

Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Advanced levers

Post by Lyudmil Tsvetkov »

I just updated my knowledge on pawn levers (an own and an enemy pawn attacking each other) on the internet, and also finally browsed for the first time Hans Kmoch's book Pawn power in chess. Great book, I must say, especially what concerns the description of levers. One thing however I did not understand from reading the book, as well as other lever-related sites, is how exactly to treat pawn levers in eval? What values to assign to which levers and in what cases?

It is great that there are so many lever types according to Kmoch, for example inner levers (when the pawn captures toward the center), outer levers (when the pawn captures toward the edge of the board), center levers (when both involved pawns are on central e and d files), etc. But how we implement them with some added value?

From looking at different positions with levers, my only suggestion for a reasonable pawn lever evaluation would be to give bonus for advanced levers on the 5th and 6th ranks. I.e. when you have an own pawn on the 5th or 6th rank attacking an enemy pawn. Bonus might be some 5-10cps for the 5th rank and some 10-20cps for the 6th rank. I think that in some 70% of cases an advanced lever ensures advantage as long as the tension persists, and you do not know how long it is going to persist. There are advanced levers that are quickly resolved and would not need special lever eval, but also levers that endure and in that case it would be good to have some lever tension eval. The bottom line would be that a pawn lever on the 5th and 6th ranks is bound to bring you some benefit in the long term, even if you do not see currently that benefit.

[d]6k1/ppp5/8/PPP5/8/8/8/6K1 w - - 0 1
Well, obviously, advanced levers help, for example above white wins by playing b6. Black on the other hand can achieve nothing with b7-b6, as a lever on the 3rd rank lacks almost any efficiency, apart from some special defensive cases.

[d]1r1rq1k1/1p3pbp/2p1p1p1/1P1pP2P/3P1PP1/3P1N1Q/7R/2R3K1 w - - 0 1
Of course, advanced levers like b5 and h5 open lines, help attacking the enemy king, etc., so they are essential. If they are easily resolved, you probably do not need special lever eval, however, when they are not quickly resolved and stay as a medium-term features of the position, you will probably need some eval on this to guide you. Besides, bonusing advanced levers might have the additional merit of encouraging active attacking chess both on the queen and king side, which is one of the keys to success. So that my advice would be to score in some way advanced pawn levers on the 5th and 6th ranks.

I would be very interested to know how you treat pawn levers in your engines. Do you have some special eval features for them and how you exactly score them?
User avatar
cdani
Posts: 2204
Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra

Re: Advanced levers

Post by cdani »

Thanks again for all those ideas.
I suspect that evaluating well those advanced levers require some more elaborated knowledge, like for example understanding if it will be good to open the section of the board affected.
Those things I think that will be more profitable in a new line of engines, not based on simple understanding but on heavy knowledge, but capable, at the same time, to go very deep to clean the horizon. One of those engines, in my idea, will have not big difficulty to surpass stockfish like engines, because they don't see/understand a lot of things.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Advanced levers

Post by Lyudmil Tsvetkov »

cdani wrote:Thanks again for all those ideas.
I suspect that evaluating well those advanced levers require some more elaborated knowledge, like for example understanding if it will be good to open the section of the board affected.
Those things I think that will be more profitable in a new line of engines, not based on simple understanding but on heavy knowledge, but capable, at the same time, to go very deep to clean the horizon. One of those engines, in my idea, will have not big difficulty to surpass stockfish like engines, because they don't see/understand a lot of things.
Thanks Jose.

I was aiming at the simplest approach. When I had to do a bit with engines I learned that engines need simple things. It is hard to find something simpler than bonus for any pawn on the 5th or 6th ranks attacking an enemy pawn.

The reason levers might be difficult to apply in eval is mainly that everything in a pawn lever is fully equal and symmetrical: basically, both pawns attack each other and are of absolutely equal value. Things that are not fully symmetrical and equal, like which pawn captures toward the center and which toward the edge, would more or less be registered by pawn psqt. So, at least for me, the only easy and reasonable thing you could do to evaluate levers in a meaningful way is to give bonus to pawn levers in the enemy camp. This is already not equal and symmetrical and eval might work.

Actually, levers into the enemy camp are indeed stronger than the average nonspecified lever, as chances are the side with such a lever could have more resources to exercise further influence upon the lever so that the tension is resolved in a beneficial way. The side with less advanced levers usually has less available resources to influence positively the existing tension.

SF is easy to surpass, you just need an author to do it. :D
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Advanced levers

Post by tpetzke »

Thanks for your interesting ideas. They are always inspiring.

If you are thinking about pawns currently, what are your thoughts on doubled pawns. I find this a very difficult feature, and I've read Larry's article on it, but so far I had not really luck with it.

Sometimes the double pawn are no weakness at all, sometimes even a strength and this makes it a difficult feature to implement for me.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Advanced levers

Post by Lyudmil Tsvetkov »

tpetzke wrote:Thanks for your interesting ideas. They are always inspiring.

If you are thinking about pawns currently, what are your thoughts on doubled pawns. I find this a very difficult feature, and I've read Larry's article on it, but so far I had not really luck with it.

Sometimes the double pawn are no weakness at all, sometimes even a strength and this makes it a difficult feature to implement for me.

Thomas...
Thanks Thomas.

You are flattering me unnecessarily, but never mind.

I can hardly give an advice to an author whose engine evaluates the queen higher in the middlegame than in the endgame. :D

Concerning doubled pawns however, there is nothing easier than that, although many people say they are worthless. A couple of very easy rules:

1. Give standard penalty, say 20cps, to a random doubled pawn.
2. Increase this penalty by 25% if the pawn is opposed by an enemy pawn, so the 20cps become 25cps. This is because such opposed pawns undouble more difficult.
3. Decrease this penalty by 25% if the pawn is not opposed on the same file by an enemy pawn, so the 20cps become 15cps. This is because the pawn undoubles easier.
4. increase the penalty by 25% if the pawn is blocked by an enemy pawn, further to already being opposed, as this makes undoubling even more difficult. Thus the 20cps become 25cps for this.
5. Increase the penalty by another 25% further if the pawn is opposed and conditions on the 2 adjacent files are fully equal for the 2 sides: no pawns or just one pawn each side, as this makes the doubled feature very permanent and greatly depreciates the doubled pawn.
6. increase the penalty by another 25% if the pawn is blocked and conditions on the 2 adjacent files are fully equal as above, for the similar reason, but highlighted further.

7. increase the penalty by 50% if the doubled pawn is isolated at the same time. So the 20cps become 30cps. Please note that this increase is above the isolated penalty. Penalising doubled and isolated separately does not explain things and is not enough, as doubled pawns that are isolated at the same time are an enormous liability.
8. score edge a and h doubled pawn significantly higher than other files, as they are depreciated there enormously and very immobile. The standard 20cps penalty could become 30cps for a and h files.

Very simple rules. Considering that rules 5 and 6 are a bit difficult to implement (you have to specify), I think you could easily and successfully implement at least 1,2,3,4,7 and 8. On the other hand, 5 and 6 are important rules as bigger penalties are involved.

[d]6k1/6p1/8/4P3/4P3/1P4P1/1PP3PP/6K1 w - - 0 1
Standard 20cps penalty for b3, any doubled pawn (I will refer here to the more advanced pawn as the doubled pawn)
50% higher penalty for e5, that is also isolated, so it gets 30cps.
25% higher penalty for g3 that is opposed by enemy g7, so the penalty becomes 25cps.

[d]6k1/2p2pp1/4p3/8/4P3/1P2PP2/1PP4P/6K1 w - - 0 1
25% lower penalty for b3, as it is not opposed by an enemy pawn on the same file, so the 20cps become 15cps.
increased penalty for e4, as it is opposed and conditions on the 2 adjacent files are equal for both sides in terms of pawns.

[d]6k1/p7/2p5/1p2p2p/1P2P1p1/2P1P1P1/1P4PP/6K1 w - - 0 1
25% higher penalty for b4, e4 and g3, as they are blocked by enemy pawns. The 20cps become 25cps.
further penalty for e4 and g3, as conditions on the 2 adjacent files are equal in terms of pawns and they are blocked.

[d]6k1/pp3pp1/2ppp2p/8/3P4/1P1P2PP/1PP4P/6K1 w - - 0 1
I can not tell you if the b or d doubled pawn is weaker, probably about equal (and the same would hold true for c and f doubled pawns, I can not see distinction between those pawns in terms of doubleness), but the h doubled pawn is quite certainly much weaker than all other doubled pawns. So that I would evaluate edge a and h doubled pawns apart with bigger penalties. They are much less mobile and also more difficult to connect to other friendly pawns on adjacent files.

As you see, it is all very simple:

- increased penalty when doubled is opposed, blocked or isolated
- increased penalty when conditions on the 2 adjacent files are equal
- increased penalty for edge a and h files
- decreased penalty when doubled is unopposed

Happy testing. :D
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Advanced levers

Post by Lyudmil Tsvetkov »

Btw., I must say that rules like doubled is weaker when blocked or isolated ignore even many of the top engines.
Lyudmil Tsvetkov
Posts: 6052
Joined: Tue Jun 12, 2012 12:41 pm

Re: Advanced levers

Post by Lyudmil Tsvetkov »

Btw., going back to the main topic of advanced levers, I recently posted a game against SF which featured advanced levers that lasted very long. In contradiction to the theory that pawn levers usually last very short, the 2 levers that arose on move 17 in the game lasted respectively 9 and 14 moves! This is not a short time, is it? So that I really think advanced levers could be part of eval.

[d]r3qr1k/2pnbb1p/2n2pp1/1p2pPP1/p2pP2P/3P1B1N/PPP5/RNBQ1R1K w - - 0 18
SF has just played 17...g6 and 2 levers arose: g5-f6 and f5-g6. g5 and f5 could be considered as advanced levers on the 5th rank and get some bonus. The theory is that such advanced levers could get with time better support from the own pieces than the enemy less advanced levers, so that, no matter how long it lasts, the levers are resolved successfully for the side with more advanced levers. The increased gradual support of the own pieces might take time, but in the end it is bound to prevail in the general case. It is not always possible to see 30 plies ahead, so that some eval info concerning the levers might be welcome.

[d]r2b1qrk/2pb3p/2n2p2/1pn1ppP1/3pP2P/pP1P1BNN/P1PB3Q/5RRK w - - 0 27
SF has just captured gf5 on move 26, liquidating one of the levers.

[d]r2b1q1k/2pn2rp/2n2pP1/4p2B/1p1pP2P/pP1P3N/P1PB3Q/5RRK b - - 0 31
White has just played g6 on move 31, liquidating the second lever. So this second lever lasted 30 plies!

Here the game again to see how permanent those levers can be.

[pgn][PlyCount "90"]
[Event "Blitz 2m+2s"]
[Site "Sofia"]
[Date "2014.06.05"]
[White "Tsvetkov, Lyudmil"]
[Black "Stockfish 5 64 SSE4.2"]
[Result "1-0"]
[ECO "A07"]
[TimeControl "120+2"]
[Annotator "Tsvetkov,Lyudmil"]
[MLNrOfMoves "45"]
[MLFlags "000100"]

{1024MB, Dell XPS 4Cores} 1. d3 {[%emt 0:00:00]} 1... d5 {[%emt 0:00:06]} 2.
Nf3 {[%emt 0:00:02]} 2... Nf6 {[%emt 0:00:07]} 3. g3 {[%emt 0:00:02]} 3... Nc6
{[%emt 0:00:04]} 4. Bg2 {[%emt 0:00:05]} 4... e5 {[%emt 0:00:05]} 5. O-O
{[%emt 0:00:03]} 5... Be7 {[%emt 0:00:03]} 6. Nc3 {[%emt 0:00:12]} 6... d4
{[%emt 0:00:11]} 7. Nb1 {[%emt 0:00: 02]} 7... O-O {[%emt 0:00:04]} 8. e4
{[%emt 0:00:02]} 8... Be6 {[%emt 0:00:19]} 9. Kh1 {[%emt 0:00:09]} 9... Nd7
{[%emt 0:00:05]} 10. Ng1 {[%emt 0:00:04]} 10... a5 {[%emt 0:00: 12]} 11. f4
{[%emt 0:00:02]} 11... f6 {[%emt 0:00:21]} 12. f5 {[%emt 0:00:01]} 12... Bf7
{[%emt 0:00:04]} 13. g4 {[%emt 0:00:02]} 13... a4 {[%emt 0:00:03]} 14. h4
{[%emt 0:00: 04]} 14... b5 {[%emt 0:00:04]} 15. Nh3 {[%emt 0:00:32]} 15... Qe8
{[%emt 0:00:05]} 16. Bf3 {[%emt 0:00:03]} 16... Kh8 {[%emt 0:00:06]} 17. g5
{[%emt 0:00:08]} 17... g6 {[%emt 0:00: 00]} 18. Rg1 {[%emt 0:00:13]} 18... Rg8
{[%emt 0:00:00]} 19. Nd2 {[%emt 0:00:21]} 19... Nc5 {[%emt 0:00:08]} 20. Nf1
{[%emt 0:00:11]} 20... Qd8 {[%emt 0:00:12]} 21. Ng3 {[%emt 0:01:18]} 21... Be8
{[%emt 0:00:00]} 22. Bd2 {[%emt 0:01:15]} 22... Bd7 {[%emt 0:00:07]} 23. Qe2
{[%emt 0:00:19]} 23... a3 {[%emt 0:00:03]} 24. b3 {[%emt 0:00:03]} 24... Qf8
{[%emt 0:00:07]} 25. Raf1 {[%emt 0:00:21]} 25... Bd8 {[%emt 0:00:08]} 26. Qh2
{[%emt 0:00:35]} 26... gxf5 {[%emt 0:00:05]} 27. Nxf5 {[%emt 0:00:04]} 27... b4
{[%emt 0:00:00]} 28. Bh5 {[%emt 0:01:07]} 28... Bxf5 {[%emt 0:00:02]} 29. Rxf5
{[%emt 0:00:37]} 29... Nd7 {[%emt 0:00:02]} 30. Rff1 {[%emt 0:02:03]} 30... Rg7
{[%emt 0:00:03]} 31. g6 {[%emt 0: 00:23]} 31... Qe8 {[%emt 0:00:00]} 32. Bh6
{[%emt 0:00:52]} 32... Rxg6 {[%emt 0:00:02]} 33. Bxg6 {[%emt 0:00:47]} 33...
hxg6 {[%emt 0:00:06]} 34. h5 {[%emt 0:00:43]} 34... g5 {[%emt 0:00:02]} 35. Nxg5
{[%emt 0:01:40]} 35... fxg5 {[%emt 0:00:00]} 36. Bxg5 {[%emt 0:00: 02]} 36...
Bxg5 {[%emt 0:00:00]} 37. Rxg5 {[%emt 0:00:05]} 37... Ne7 {[%emt 0:00:00]} 38.
Rg6 {[%emt 0:04:34]} 38... Ng8 {[%emt 0:00:00]} 39. Rfg1 {[%emt 0:00:21]} 39...
Qf7 {[%emt 0:00:03]} 40. Qh3 {[%emt 0:00:55]} 40... Ngf6 {[%emt 0:00:00]} 41.
Qf5 {[%emt 0:00: 24]} 41... Qf8 {[%emt 0:00:03]} 42. h6 {[%emt 0:01:07]} 42...
Rd8 {[%emt 0:00:00]} 43. Rg7 {[%emt 0:00:16]} 43... Re8 {[%emt 0:00:02]} 44. Qg6
{[%emt 0:00:00]} 44... Re7 {[%emt 0:00: 03]} 45. Rg5 {[%emt 0:00:36]} 45... Nb6
{[%emt 0:00:00]} 1-0
[/pgn]

But do not look at the result and the quality of chess, just the levers, I already explained why I am not proud of it.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Advanced levers

Post by tpetzke »

I can hardly give an advice to an author whose engine evaluates the queen higher in the middlegame than in the endgame.
iCE currently does not but it is a bit hard to tell anyway without considering the mobility scores.

Thanks for the double pawn stuff. I'll bookmark this and test some of them when I turn my focus on eval again, currently I'm doing a bit on my search framework.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Advanced levers

Post by tpetzke »

Currently I'm only score double pawns when they are isolated, blocked or closing 3 ranks (I think I have the last one from you).

Scoring a random dbl pawn did not work well.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
carldaman
Posts: 2285
Joined: Sat Jun 02, 2012 2:13 am

Re: Advanced levers

Post by carldaman »

Lyudmil Tsvetkov wrote:
tpetzke wrote:Thanks for your interesting ideas. They are always inspiring.

If you are thinking about pawns currently, what are your thoughts on doubled pawns. I find this a very difficult feature, and I've read Larry's article on it, but so far I had not really luck with it.

Sometimes the double pawn are no weakness at all, sometimes even a strength and this makes it a difficult feature to implement for me.

Thomas...
Thanks Thomas.

You are flattering me unnecessarily, but never mind.

I can hardly give an advice to an author whose engine evaluates the queen higher in the middlegame than in the endgame. :D

Concerning doubled pawns however, there is nothing easier than that, although many people say they are worthless. A couple of very easy rules:

1. Give standard penalty, say 20cps, to a random doubled pawn.
2. Increase this penalty by 25% if the pawn is opposed by an enemy pawn, so the 20cps become 25cps. This is because such opposed pawns undouble more difficult.
3. Decrease this penalty by 25% if the pawn is not opposed on the same file by an enemy pawn, so the 20cps become 15cps. This is because the pawn undoubles easier.
4. increase the penalty by 25% if the pawn is blocked by an enemy pawn, further to already being opposed, as this makes undoubling even more difficult. Thus the 20cps become 25cps for this.
5. Increase the penalty by another 25% further if the pawn is opposed and conditions on the 2 adjacent files are fully equal for the 2 sides: no pawns or just one pawn each side, as this makes the doubled feature very permanent and greatly depreciates the doubled pawn.
6. increase the penalty by another 25% if the pawn is blocked and conditions on the 2 adjacent files are fully equal as above, for the similar reason, but highlighted further.

7. increase the penalty by 50% if the doubled pawn is isolated at the same time. So the 20cps become 30cps. Please note that this increase is above the isolated penalty. Penalising doubled and isolated separately does not explain things and is not enough, as doubled pawns that are isolated at the same time are an enormous liability.
8. score edge a and h doubled pawn significantly higher than other files, as they are depreciated there enormously and very immobile. The standard 20cps penalty could become 30cps for a and h files.

Very simple rules. Considering that rules 5 and 6 are a bit difficult to implement (you have to specify), I think you could easily and successfully implement at least 1,2,3,4,7 and 8. On the other hand, 5 and 6 are important rules as bigger penalties are involved.

[d]6k1/6p1/8/4P3/4P3/1P4P1/1PP3PP/6K1 w - - 0 1
Standard 20cps penalty for b3, any doubled pawn (I will refer here to the more advanced pawn as the doubled pawn)
50% higher penalty for e5, that is also isolated, so it gets 30cps.
25% higher penalty for g3 that is opposed by enemy g7, so the penalty becomes 25cps.

[d]6k1/2p2pp1/4p3/8/4P3/1P2PP2/1PP4P/6K1 w - - 0 1
25% lower penalty for b3, as it is not opposed by an enemy pawn on the same file, so the 20cps become 15cps.
increased penalty for e4, as it is opposed and conditions on the 2 adjacent files are equal for both sides in terms of pawns.

[d]6k1/p7/2p5/1p2p2p/1P2P1p1/2P1P1P1/1P4PP/6K1 w - - 0 1
25% higher penalty for b4, e4 and g3, as they are blocked by enemy pawns. The 20cps become 25cps.
further penalty for e4 and g3, as conditions on the 2 adjacent files are equal in terms of pawns and they are blocked.

[d]6k1/pp3pp1/2ppp2p/8/3P4/1P1P2PP/1PP4P/6K1 w - - 0 1
I can not tell you if the b or d doubled pawn is weaker, probably about equal (and the same would hold true for c and f doubled pawns, I can not see distinction between those pawns in terms of doubleness), but the h doubled pawn is quite certainly much weaker than all other doubled pawns. So that I would evaluate edge a and h doubled pawns apart with bigger penalties. They are much less mobile and also more difficult to connect to other friendly pawns on adjacent files.

As you see, it is all very simple:

- increased penalty when doubled is opposed, blocked or isolated
- increased penalty when conditions on the 2 adjacent files are equal
- increased penalty for edge a and h files
- decreased penalty when doubled is unopposed

Happy testing. :D
Hi Lyudmil - not sure if it was mentioned, but doubled AND isolated on an (opponent's) open file with no chance of liquidation (trades) should be worth a bigger penalty.


Glad you got around to checking out Kmoch's book. Funny thing is that SF was known to have trouble maintaining the tension up until a year ago. It was one of the main reasons I didn't like to use it for analysis in those days.

CL