can data about probabilities help for reductions?

Discussion of chess software programming and technical issues.

Moderator: Ras

Uri Blass
Posts: 11183
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

can data about probabilities help for reductions?

Post by Uri Blass »

I think that it may be interesting to do the following:

1)Get 1,000,000 random positions from chess games.
2)Get 1,000,000 random positions that the program search from many searches that some chess program searchs during.

You have 2 sets of 1,000,000 positions.

3)calculate the best move in every one of the 2,000,000 positions(you can use 1 second per move)

4)build the following arrays for both sets of 1,000,000 positions:
For the first set:
Legal_In_Games[12][64][64]
Best_In_Games[12][64][64]

For the second set:
Legal_In_Analysis[12][64][64]
Best_In_Analysis[12][64][64]

12,64,64 because you have the following
1)piece that is moving including the color (can be translated to a number that is 1-12)
2)from square(1-64)
3)to square (1-64)

The Legal arrays have the number of cases when the move is legal out of 1,000,000 positions when the Best array has the number of cases when the move is best out of 1,000,000 positions.

The idea is that chess programs may reduce more a move if
Best_In_Analysis[j][k]/Legal_In_Analysis[j][k] is relatively small.

Note that the data for games and not for analysis may be interesting for humans because they can learn from it what quiet moves have higher probability to be best.
asanjuan
Posts: 214
Joined: Thu Sep 01, 2011 5:38 pm
Location: Seville, Spain

Re: can data about probabilities help for reductions?

Post by asanjuan »

Hi Uri,
This is very similar to the relative history heuristic. See the wiki.

http://chessprogramming.wikispaces.com/ ... +Heuristic

The only difference is that the heuristic is considering the cutoffs (good moves) dinamically during the search and you are trying to get the same with a static set of positions. Sure, 1.000.000 positions are not enough and you will find any situation where a reduction may apply, but is missing in your array.
I think that the dynamic approach is preferable.

This is what i'm currently using in my engine. My implementation is quite simple, but seems to work.

Regards.
Still learning how to play chess...
knigths move in "L" shape ¿right?
Uri Blass
Posts: 11183
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: can data about probabilities help for reductions?

Post by Uri Blass »

asanjuan wrote:Hi Uri,
This is very similar to the relative history heuristic. See the wiki.

http://chessprogramming.wikispaces.com/ ... +Heuristic

The only difference is that the heuristic is considering the cutoffs (good moves) dinamically during the search and you are trying to get the same with a static set of positions. Sure, 1.000.000 positions are not enough and you will find any situation where a reduction may apply, but is missing in your array.
I think that the dynamic approach is preferable.

This is what i'm currently using in my engine. My implementation is quite simple, but seems to work.

Regards.
cutoff during the search are often not best move because more than one move may fail high and the program may fail high on a move that is not the best move so it is not the same.

Another disadvantage of cutoff is that they may also be based on very small search depth and it is possible that the same move is bad based on a deeper search.

If statistics tell me that a move is not good based on deep search but can be best move at small depth then it may be better to prune it when the remaining depth is small and when the remaining depth is high we may have enough depth to refute it.

Note that cases when a move is best at small depth but not best at high depth may give us also information to improve the evaluation so it may be interesting also to get statistics also about probability of a move to be best move at small depths compared to high depth.

For example suppose a program believes that e2 is better to the king in the opening relative to e1 then Ke1-e2 may be often best at small depth but not at big depth and it suggest to fix the piece square table.
asanjuan
Posts: 214
Joined: Thu Sep 01, 2011 5:38 pm
Location: Seville, Spain

Re: can data about probabilities help for reductions?

Post by asanjuan »

Uri Blass wrote:
asanjuan wrote:Hi Uri,
This is very similar to the relative history heuristic. See the wiki.

http://chessprogramming.wikispaces.com/ ... +Heuristic

The only difference is that the heuristic is considering the cutoffs (good moves) dinamically during the search and you are trying to get the same with a static set of positions. Sure, 1.000.000 positions are not enough and you will find any situation where a reduction may apply, but is missing in your array.
I think that the dynamic approach is preferable.

This is what i'm currently using in my engine. My implementation is quite simple, but seems to work.

Regards.
cutoff during the search are often not best move because more than one move may fail high and the program may fail high on a move that is not the best move so it is not the same.
Agree, but are good enough to prune the irrelevant part of the tree, so this information can be used to reduce other moves.

Another disadvantage of cutoff is that they may also be based on very small search depth and it is possible that the same move is bad based on a deeper search.

If statistics tell me that a move is not good based on deep search but can be best move at small depth then it may be better to prune it when the remaining depth is small and when the remaining depth is high we may have enough depth to refute it.

Note that cases when a move is best at small depth but not best at high depth may give us also information to improve the evaluation so it may be interesting also to get statistics also about probability of a move to be best move at small depths compared to high depth.
It depends much on the move ordering. Normally, there is a 95% of chances that the hash move will cut the search in a cut-node. The hash move came from a depth-1 search for the same position.

For example suppose a program believes that e2 is better to the king in the opening relative to e1 then Ke1-e2 may be often best at small depth but not at big depth and it suggest to fix the piece square table.
Then, use the statistics to fill the PST, sort moves using pst[dest]-pst[from], and then, reduce the late moves.
I used to do this before using the relative history heuristic, and history is working better than pst. At least in my engine.

But, my PST was not created from statistics builded from a set of 2.00.000 positions, so maybe the information stored can be more precise with your proposal.

Maybe someone would try, but not me. I'm very happy with the relative history heuristic.

:D
Still learning how to play chess...
knigths move in "L" shape ¿right?
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: can data about probabilities help for reductions?

Post by tpetzke »

Hi,

have you performed this experiment and did it gain you something at the end ?

I tried developing PSQ based on statistics how likely it is that a piece moves to a certain square and failed. It did not improve the engine.

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
Joerg Oster
Posts: 994
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany
Full name: Jörg Oster

Re: can data about probabilities help for reductions?

Post by Joerg Oster »

Hi Thomas,

I tried this once and failed as well. ;-)
But then I realised, that this distribution only shows the natural development of the pieces. E.g. for a knight, squares c3 and f3 get the highest percentage. That doesn't necessarily mean, knights on these squares are best placed.
Jörg Oster