Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Latest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Comments/Ratings for a Single Item

LatestLater Reverse Order Earlier
Chess programs move making[Subject Thread] [Add Response]
Aurelian Florea wrote on Fri, Sep 9, 2022 02:42 AM EDT in reply to H. G. Muller from Thu Sep 8 05:53 PM:

@HG,

The alpha-beta search would have replaced the feature extraction part of the NN. That is from what I understand. That is the part I did not understood (especially what filters does the CNN use). Anyway even if it takes a huge amount of time the algorithm will still improve. So I could present a user with monthly updates. But I'm afraid it will take time until an challenging AI is outputed by the program.

Once again thanks a lot for your help!


Aurelian Florea wrote on Thu, Sep 8, 2022 05:58 PM EDT:

Well hundreds of times slower it is not that but. 1000 times slower will be 4000 hours which is 167 days. That is doable. I have one computer for one game (2 in total, remakes of apothecary chess). But my games are 10x10 and have bent riders and an imitator which could itself make things much worse. There could be artifices in the beginning by inserting fake endgame conditions which will train things like "Do not exchange your queen for a knight!".

Anyway I'm doing this because it is the only thing that motivates me so far. With the new treatment (actually 3 years now), I am able to pay attention to stuff. I really enjoy doing this. And the programming is not that hard actually, although there are also NN things I do not understand.

@HG and @Greg Thanks for your advices!


H. G. Muller wrote on Thu, Sep 8, 2022 05:53 PM EDT in reply to Aurelian Florea from 03:17 PM:

It would be a few month when you had a few dozen computers with very powerful GPU boards as graphics cards. For orthodox chess.

But I should point out there is another approach called NNUE, which uses a far simpler neural net just for evaluation in a conventional alpha-beta search. This is far easier to train; for orthodox chess a few hundred-thousand positions from games with known outcome would be enough.


Greg Strong wrote on Thu, Sep 8, 2022 05:23 PM EDT:

Pretty sure H. G. is correct. There is a reason I spend no effort on the neural network approach.


Aurelian Florea wrote on Thu, Sep 8, 2022 03:17 PM EDT in reply to H. G. Muller from 03:09 PM:

I'm aware of this fact, but I'm not sure about six years. Isn't it closer to a few months?


H. G. Muller wrote on Thu, Sep 8, 2022 03:09 PM EDT in reply to Aurelian Florea from 01:19 PM:

Also note that LeelaChess Zero, the imitation of Alpha Zero that can run on a PC, took about 6 months of computer time donated by a large collaboration of people with powerful computers to learn how to play Chess. For AlphaZero this only took 4 hours, but only by virtue of the fact that they used 5000 of their servers equiped with special hardware that calculated hundreds of times faster than an ordinary PC. On a single PC you would be lucky to achieve that in 6 years of non-stop computing.


Aurelian Florea wrote on Thu, Sep 8, 2022 01:19 PM EDT in reply to Greg Strong from 01:06 PM:

Yes, Greg I'm sure you are correct. Moreover in this context it matters less. This is a training program. It can take more time to learn the game, but as HG has said, it is of little consequence.


Greg Strong wrote on Thu, Sep 8, 2022 01:06 PM EDT:

A mistake most starting chess programmers make is trying to optomize these kinds of things. It is not a good use of your effort. Even if you double the computational speed of your program, that is only good for about 70-100 ELO. The important thing is being bug-free and the optimizaitons make things more complicated and introduce more bugs.


Aurelian Florea wrote on Thu, Sep 8, 2022 12:17 PM EDT in reply to H. G. Muller from 12:04 PM:

Thanks a lot, HG!


H. G. Muller wrote on Thu, Sep 8, 2022 12:04 PM EDT in reply to Aurelian Florea from 08:31 AM:

Virtually all chess programs generate moves completely from scratch in every new position they reach. So after 1. e4 (and the opponent's reply) they would generate all Knight moves again (and now Ng1-e2 would be amongst those), and would try to generate new Rook moves (again without getting any). What you mention would only be relevant if you wanted to generate moves incrementally, by deriving the new list of moves from one you already had, by adding some new moves, and deleting some old, but keeping most of them. This can be done, but for games with the complexity of orthodox chess is not very much faster than generating the moves from scratch. That is, it could be much faster, but it would be very complicated to achieve that. So no one does it. (I wrote a kind of blog about it on talkchess.com, though, under the title "The Mailbox Trials'.)

For larger variants (larger board, more pieces) the incremental method could become competitive, however. I used it in my Tenjiku Shogi engine ('Inferno'), and could reach a speed of 500k positions/sec, which is similar to what most engines for orthodox chess can do, despite the 4 times larger board and and 5 times as many pieces. One problem is that it would be quite hard to make it general enough to do many variants. The incremental method must figure out which slider moves are blocked and which discovered by the move that is searched. If all sliders move along orthogonals and diagonals (as they tend to do in Shogi variants, and certainly do in orthodox chess) it is still manageable, but if the variant also has bent sliders (like the Griffon) or hook movers (like in Maka Dai Dai Shogi) it becomes far more complex to figure that out. The area move of the Fire Demon and Vice General in Tenjiku Shogi is almost impossible to do incrementally, so Inferno generates that from scratch in every position.

Alpha Zero relies on an enormously large neural network for evaluating a position, and suggesting moves to search. This takes so much time to compute that the time to generate moves is completely negligible to it, no matter how inefficiently you do it.


Aurelian Florea wrote on Thu, Sep 8, 2022 08:31 AM EDT:

@HG or @Greg

I'm writing my own chess variant program (I'm finally making progress) alpha zero style. When generating moves I can't help wondering about loss time due to regenerating the same moves after a move was made.

For example in orthodox chess after 1.e4 there appear a few more queen moves, but you shouldn't try again to check for rook moves. As of now my algorithm works this way an it is probably slow.


11 comments displayed

LatestLater Reverse Order Earlier

Permalink to the exact comments currently displayed.