Lonely queen

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

Moderators: hgm, Rebel, chrisw

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

Re: Lonely queen

Post by Lyudmil Tsvetkov »

Thanks for the effort Evert. Interesting material.

It would be even more interesting to repeat it with a significantly stronger engine, like Stockfish for example.

What we still do not know very well is how R+Ms or Rs+M operate in the imbalance.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Lonely queen

Post by Evert »

hgm wrote: So in short: 'effective' elephantiasis is the cost of trade-avoiding strategy, and when such a strategy for a certain class of pieces becomes too costly, it should be abandoned. But then trading will be unavoidable, so that the effective elephantiasis should be calculated based on the remaining pieces.
Hmm... ok, I think I understand the idea, qualitatively. What isn't so clear to me is how to translate that into a quantitative piece value model. What I've tried before in the past is to include linear terms based on the number of enemy pieces of a given type as well as the number of friendly pieces of a given type. This turned out to not work very well, but with the above refinements to the theory that's not very surprising.

Have you ever tried to convert this into something quantitative?
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Lonely queen

Post by Evert »

Lyudmil Tsvetkov wrote: It would be even more interesting to repeat it with a significantly stronger engine, like Stockfish for example.
I'm not so sure that matters much. What you actually do is measure the winning rate for a given imbalance in a Monte-Carlo like method. You don't necessarily care about the quality of the games themselves, as long as the quality doesn't favour one side over the other.

That this is the case is an assumption, of course, and it would be useful to get a sense of the spread using different engines. However, you can probably get a similar sense for this effect by changing the time controls.

Having said that, I would expect that an engine that knows how to handle bishops very effectively would measure something different for QN-BBNN than an engine that doesn't...
What we still do not know very well is how R+Ms or Rs+M operate in the imbalance.
I may have a look at that at some point. In fact, there are some other imbalances mentioned in Kaufman's article that may be worth investigating using this method.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Lonely queen

Post by hgm »

When you say 'linear', do you mean that the value of individual pieces have a correction linear in the number of other pieces, so that the total material evaluation contains second-order products?

I have never actually built an engine that incorporates these (Spartacus is supposed to do this, but there wasn'rt any progress in its development for years). But it should not be difficult to make an algorithm that unambiguously calculates the imbalance values according to the model. You would just consider all pairs of opposing piece types (where you could cound all minors as a single type, for simplification), and then loop over all possibilities for trade avoiding strategies for each of them. E.g. for QRN-RBBNN you would have pairs (Q,R), (Q,minor), (R,R), (R,minor), (N,R), (N,minor). For the (Q,R), (Q,minor), (R,minor) and (N,R) it is immediately obvious that the stronger piece has to avoid being traded for the weaker one, as the difference in base value is just too much. So the only non-obvious pairs are (R,R) and (N,minor). Each side could independently decide whether to avoid such trade or not, and you would have to loop over all possibilities for this.

When neither avoid trade for a certain pair, one piece on each side is removed, and the algorithm is applied recursively on the remaining pieces. This recursion continues until a case is left where there is trade avoidance in every pair. A side that avoids trading, then gets a penalty proportional to the product of the number of pieces on each side of the pair (the raw elephantiasis). This defines the payoff for this combination of strategies, which is then optimized for both sides.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Lonely queen

Post by Evert »

hgm wrote:When you say 'linear', do you mean that the value of individual pieces have a correction linear in the number of other pieces, so that the total material evaluation contains second-order products?
Yes.
I have never actually built an engine that incorporates these (Spartacus is supposed to do this, but there wasn'rt any progress in its development for years). But it should not be difficult to make an algorithm that unambiguously calculates the imbalance values according to the model. You would just consider all pairs of opposing piece types (where you could cound all minors as a single type, for simplification), and then loop over all possibilities for trade avoiding strategies for each of them. E.g. for QRN-RBBNN you would have pairs (Q,R), (Q,minor), (R,R), (R,minor), (N,R), (N,minor). For the (Q,R), (Q,minor), (R,minor) and (N,R) it is immediately obvious that the stronger piece has to avoid being traded for the weaker one, as the difference in base value is just too much. So the only non-obvious pairs are (R,R) and (N,minor). Each side could independently decide whether to avoid such trade or not, and you would have to loop over all possibilities for this.

When neither avoid trade for a certain pair, one piece on each side is removed, and the algorithm is applied recursively on the remaining pieces. This recursion continues until a case is left where there is trade avoidance in every pair. A side that avoids trading, then gets a penalty proportional to the product of the number of pieces on each side of the pair (the raw elephantiasis). This defines the payoff for this combination of strategies, which is then optimized for both sides.
Hmm... ok, that does sound like a reasonable approach. Quite a bit of effort though, especially considering that the different coefficients are unknown, but with enough imbalance measurements that's not necessarily a problem. Probably too slow to do on the fly, but if the calculation is done once and the result stored in a material table that shouldn't be an issue.

I'm not entirely sure that treating knights and bishops the same is (ultimately) the best idea because the decision for trade-avoid or trade-accept can be different for both, depending on whether there are pawns on both wings or not and whether a colour-weakness develops (near the king, for instance) when a bishop is traded. It is also the most common imbalance in regular chess. Perhaps those considerations can (and should) be split off though. Something to think about.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Lonely queen

Post by hgm »

Indeed, heaping all minors was just to make the example easier. For 10x8 Chess you could obviously not do that, as there already is an effective 50cP difference between a single N and B, and the raw elephantiasis inflicted on a B by a single N (or even two N) is smaller than that, so that the trade-avoiding strategy works (So the 50cP difference actually already incorporates it.)

For orthodox Chess it could be a different matter; I always wondered about this 'amazing coincidence' of two so completely different pieces beng so close in effective value. Elephantiasis says it is no coincidence, however. The bare value of B is higher, but a fully trade-avoding strategy for it would cost you more than the difference. So you won't put any more effort in avoiding trades as what would push you down below the Knight value, meaning they will eventually be traded, and thus effectively become equal. For your second Bishop trade avoiding might be worth it, due to the pair bonus.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Lonely queen

Post by Evert »

hgm wrote:Indeed, heaping all minors was just to make the example easier. For 10x8 Chess you could obviously not do that, as there already is an effective 50cP difference between a single N and B, and the raw elephantiasis inflicted on a B by a single N (or even two N) is smaller than that, so that the trade-avoiding strategy works (So the 50cP difference actually already incorporates it.)
Yes. That does touch on another point: the functional form for the scaling of piece values. I once tried a linear model for the 3Q-6/7N imbalance. It's fairly simple (I think I used something like V_Q = 950 - 25 (#N-2)) which proved to work well for positions with that imbalance, but actually performed measurably worse for normal material combinations. My conjecture was that the term should actually be more important when there are more enemy pieces (in other words, super linear). Doesn't sound unreasonable but makes things more complicated.
For orthodox Chess it could be a different matter; I always wondered about this 'amazing coincidence' of two so completely different pieces beng so close in effective value. Elephantiasis says it is no coincidence, however. The bare value of B is higher, but a fully trade-avoding strategy for it would cost you more than the difference. So you won't put any more effort in avoiding trades as what would push you down below the Knight value, meaning they will eventually be traded, and thus effectively become equal. For your second Bishop trade avoiding might be worth it, due to the pair bonus.
Yes, I've read that, and it's one of the reasons I think the idea is neat. It's less ad-hoc than "the bishop is really stronger but it doesn't show because it only sees half the board", which is the usual explanation I've seen.
The pair bonus of course needs to include the trade-avoid penalty already, but in a way this really says that the bishop is worth more than the knight, but suffers for two reasons: avoiding trade with knights and the lack of its partner (so the "pair bonus" would really be a "singleton penalty").