Article on proposed heuristic for computer chess program

Discussion of chess software programming and technical issues.

Moderator: Ras

RVisitor

Article on proposed heuristic for computer chess program

Post by RVisitor »

The following link
http://mysite.verizon.net/vzesz4a6/current/id80.html

takes you to an article I wrote on a new idea for doing the evaluation function for a chess program.

Some of you have seen this before. Any comments, good or bad, are welcome.
Aleks Peshkov
Posts: 922
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Article on proposed heuristic for computer chess program

Post by Aleks Peshkov »

Influence of nearest 1-ply, 2-ply, 3-ply "mobilities" are dramatically different, so sum of them have very little meaning. So I think your "deep" mobility number is not any better then a simple 1-ply mobility lookup, and may be even worse because it is too optimistic.

IMHO positional pressure is not the same as single side mobility at all. Pressure is a fight for a few selected positionally valuable squares.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Article on proposed heuristic for computer chess program

Post by Michael Sherwin »

RVisitor wrote:The following link
http://mysite.verizon.net/vzesz4a6/current/id80.html

takes you to an article I wrote on a new idea for doing the evaluation function for a chess program.

Some of you have seen this before. Any comments, good or bad, are welcome.
In RomiChess it has always been a sum of the first ply mobility * a constant + the sum of second ply mobility + the number of attacked enemy pieces * a constant. The constants are different for each piece.

However, instead of multiplying by a constant I am going to try creating look-up tables instead. Also I plan on taking into consideration the quality of the attacks as well.

I like the idea of Aleks of figuring in a pressure bonus for a piece on a square and I wonder what should be considered in such a bonus. For instance, how does one go about figuring out which squares even deserve a pressure bonus? I precompute the piece-square tables at the root before each iteration ( I use history table data to tune the piece-square tables after each iteration), so I have lots of time for some rather complicated algorithms.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Aleks Peshkov
Posts: 922
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Article on proposed heuristic for computer chess program

Post by Aleks Peshkov »

Some important squares are well-known: weakness in pawn formations, opened files, light/dark squares, knight outposts can be precomputed in piece-square tables.

Another important square type is local SEE complexity: the more attackers and defenders, the more valuable became the control of that square. Pinning and tying attackers and defenders should also be counted.

Static and dynamic square bonuses can be added. I think pieces of different type and different sides can share that discovered board bonus values. Not only SEE control can be awarded but any "useful" piece attack.
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Article on proposed heuristic for computer chess program

Post by Michael Sherwin »

SEE complexity pressure can easily be measured, so adding a bonus to a square for say a bishop that the bishop can land on that increases that pressure even if it does not tip the scales of the SEE to the side with the bishop can still be counted as pressure. And bonusing squares that lead to a hole in the pawn formation that a piece can occupy can also be counted as pressure.

The generality that I see in this is to encourage the pieces to move in the direction of a weakness, even if they can not really get there during the search. Is this what you mean by increasing the pressure?

Sounds easy to achieve as I already have a set bit for every piece to every 1st and 2nd ply square that a piece can land on!
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Aleks Peshkov
Posts: 922
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: Article on proposed heuristic for computer chess program

Post by Aleks Peshkov »

Well, term "pressure" I have taken from the topic article just to point that it is not equal to mobility.

I think it is good to bonus any single attacking/defending for any known weak spot, even if the immediate move here is tactically losing. I think it is useful to bonus any general progress in tactical complexity, for example knight attacking bishop and vice versa assuming that this can be a start of future trade combination.

Computer can have no understanding about opponent's (human) long-term plans, but should counter-play any concrete steps toward that unknown plan. I do not ever think about looking more then 1 ply deep from "quiet" position, but moving toward known weak spot can be a candidate for search extension.

Right know I discovered that this idea is generalization of chess opening development principle: develop pieces in hope that it can be used later.
Dan Andersson
Posts: 442
Joined: Wed Mar 08, 2006 8:54 pm

Re: Article on proposed heuristic for computer chess program

Post by Dan Andersson »

I experimented using the history table to compute piece*square bonuses. Like you I updated the information per iteration. I found a piece*square history the most efficacious. Other things I thought of and experimented with where a decay function to keep a smoother contribution between iterations and adding a bit of the value from pieces with supersets and subsets of movement capabilities.

MvH Dan Andersson
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Article on proposed heuristic for computer chess program

Post by Michael Sherwin »

Dan Andersson wrote:I experimented using the history table to compute piece*square bonuses. Like you I updated the information per iteration. I found a piece*square history the most efficacious. Other things I thought of and experimented with where a decay function to keep a smoother contribution between iterations and adding a bit of the value from pieces with supersets and subsets of movement capabilities.

MvH Dan Andersson
And how did it fare? And what was your range of bonus?

I have it working quite well now, it seems, but there is much room for improvement! The Elo gain is not huge, only about +40 at most, however it has had a good positive effect on playing style IMO as well.
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Michael Sherwin
Posts: 3196
Joined: Fri May 26, 2006 3:00 am
Location: WY, USA
Full name: Michael Sherwin

Re: Article on proposed heuristic for computer chess program

Post by Michael Sherwin »

Aleks Peshkov wrote:Well, term "pressure" I have taken from the topic article just to point that it is not equal to mobility.

I think it is good to bonus any single attacking/defending for any known weak spot, even if the immediate move here is tactically losing. I think it is useful to bonus any general progress in tactical complexity, for example knight attacking bishop and vice versa assuming that this can be a start of future trade combination.

Computer can have no understanding about opponent's (human) long-term plans, but should counter-play any concrete steps toward that unknown plan. I do not ever think about looking more then 1 ply deep from "quiet" position, but moving toward known weak spot can be a candidate for search extension.

Right know I discovered that this idea is generalization of chess opening development principle: develop pieces in hope that it can be used later.
Thank you for the reply. I will give what you have written, some thought!
If you are on a sidewalk and the covid goes beep beep
Just step aside or you might have a bit of heat
Covid covid runs through the town all day
Can the people ever change their ways
Sherwin the covid's after you
Sherwin if it catches you you're through
Dan Andersson
Posts: 442
Joined: Wed Mar 08, 2006 8:54 pm

Re: Article on proposed heuristic for computer chess program

Post by Dan Andersson »

The base program was pretty basic stuff built mainly for speed. The modified program was a whole lot smarter and go about 65% of the points. The bonus range was set by a sigmoid function that I adjusted by hand so that the program didn't sacrifice pieces too often.
And the playing style was much more attractive.

MvH Dan Andersson