Lc0 ... the GOOD and the BAD

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
TSU
Posts: 5
Joined: Sun Feb 03, 2019 7:27 pm
Full name: Tony Su

Re: Lc0 ... the GOOD and the BAD

Post by TSU » Mon Feb 04, 2019 9:34 pm

When you mentioned MC back propagation, that prompted me to do some reading on that... That's an interesting "tweak" with hopeful effect, and will require tuning before it'll work properly (Could this even be implemented as a NN ? That would also be interesting). As an additional "weight," it might even not be too costly as an add-on.

Your suggestion about game length is also something I had been thinking about, unlike what you suggest I was thinking that the fundamental problem in a "pure" MCTS is that all winning rollouts are assigned the same value, and draws and losses perhaps the same. I instead was thinking along the lines of assigning an additional bonus value of some very tiny amount (eg 1/000 of a point) calculated to be the inverse of plies to the end of the rollout (final calculated node) to winning lines that wouldn't substantially affect current primary analysis but could provide a kind of "tie break" value when the primary analysis results in equal winning value. This then would enable Leela to break the tie break and choose the shorter solution when otherwise all are equally winning.

TSU
Posts: 5
Joined: Sun Feb 03, 2019 7:27 pm
Full name: Tony Su

Re: Lc0 ... the GOOD and the BAD

Post by TSU » Mon Feb 04, 2019 9:47 pm

M ANSARI wrote:
Mon Feb 04, 2019 7:54 pm

On another point, if Lc0 can be taught to play such brilliant positional chess, there is no reason why it can't be taught to play tactical chess as well. This would seem to work well as AI by mimicking a strong GM play. A strong GM will tend to always play positional chess and will start calculating tactics only when he feels the position is ripe for a tactical breakthrough or of course the other side blunders. Tactics can be taught as the tactical patterns are pretty consistent. Pinned pieces, over loaded pieces, back rank weaknesses, fast queening pawns, x ray and discovered checks etc... I think Lc0 can be trained to "learn" tactics just like a human learns tactics. But someone has to come up with a good way to teach it tactics. Maybe instead of learning by self play from start position it could be taught self play from pre-set tactical positions, something like Puzzle Rush for Lc0!
I think Leela's developers won't allow for such targeted training, and the point is that Leela was not instructed how to play the positional and tactical things you see, everything was found through self-discovery and trial and error. What you see that looks like attacking patterns aren't because someone programmed the idea, Leela created the "policy" on its own by experiencing the sequence a number of times by accident, found that the sequence appeared often when there was a favored result and further refined the policy by repetition.

At least that's how I understand how Leela "learns."

carldaman
Posts: 1708
Joined: Sat Jun 02, 2012 12:13 am

Re: Lc0 ... the GOOD and the BAD

Post by carldaman » Tue Feb 05, 2019 12:03 am

One wonders how AlphaZero was able to overcome such weaknesses that Leela still has -- occasional tactical blindness, and relatively weaker and sloppier endgame play.

Was it just a matter of a larger amount of hardware resources allocated to training, or perhaps a smarter approach/methodology?

dkappe
Posts: 236
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: Lc0 ... the GOOD and the BAD

Post by dkappe » Tue Feb 05, 2019 2:03 am

carldaman wrote:
Tue Feb 05, 2019 12:03 am
One wonders how AlphaZero was able to overcome such weaknesses that Leela still has -- occasional tactical blindness, and relatively weaker and sloppier endgame play.

Was it just a matter of a larger amount of hardware resources allocated to training, or perhaps a smarter approach/methodology?
I don’t know if you watched any of the a0 world championship analysis video on YouTube. It does look like a0 also suffers from endgame weakness.

Also, DeepMind published a final paper in Science, including the pgn of a 1000 game match against sf8 with tcec openings and real time controls. Chess.com recently ran a similar 100 game match against sf8 with the same time control, tcec openings and very respectable hardware using a t30 net. While a0 had fewer decisive games, leela had an overall higher winning percentage.

As long as the original a0 is not available for play, it’s easy to credit it with almost supernatural abilities. But in the few places where we can compare directly, it’s probably even or slightly worse than the t30 nets.

User avatar
M ANSARI
Posts: 3408
Joined: Thu Mar 16, 2006 6:10 pm

Re: Lc0 ... the GOOD and the BAD

Post by M ANSARI » Tue Feb 05, 2019 6:25 am

A0 does have a similar "tactical bug" to Lc0 (as shown in my other post viewtopic.php?f=2&t=69799) but apparently it does not happen too often. I think Lc0 will end up being much stronger than A0 as there was not so much time spent on A0. If you look at the progress of SF, the SF community became a formidable force and pushed the ELO of the engine to incredible heights. I think something similar will happen with Lc0. There is just so much that can be done to improve things and so much that is still experimental. I expect Lc0 to continually improve in strength and functionality at a very fast pace.

On the other hand, I think that AB engines will also gain a huge boost in strength by having Lc0 to spar with. It is obvious that many of the evaluations that SF and Komodo and Houdini have are inferior to Lc0 and they will be able to tune those evaluations better and improve their engines. Also it is possible that if Lc0 weaknesses are not patched, the AB engines might tune against those weaknesses and improve their score against Lc0. Hopefully those weaknesses will be patched up before that happens.

jkiliani
Posts: 143
Joined: Wed Jan 17, 2018 12:26 pm

Re: Lc0 ... the GOOD and the BAD

Post by jkiliani » Tue Feb 05, 2019 7:44 am

M ANSARI wrote:
Tue Feb 05, 2019 6:25 am
A0 does have a similar "tactical bug" to Lc0 (as shown in my other post viewtopic.php?f=2&t=69799) but apparently it does not happen too often. I think Lc0 will end up being much stronger than A0 as there was not so much time spent on A0. If you look at the progress of SF, the SF community became a formidable force and pushed the ELO of the engine to incredible heights. I think something similar will happen with Lc0. There is just so much that can be done to improve things and so much that is still experimental. I expect Lc0 to continually improve in strength and functionality at a very fast pace.

On the other hand, I think that AB engines will also gain a huge boost in strength by having Lc0 to spar with. It is obvious that many of the evaluations that SF and Komodo and Houdini have are inferior to Lc0 and they will be able to tune those evaluations better and improve their engines. Also it is possible that if Lc0 weaknesses are not patched, the AB engines might tune against those weaknesses and improve their score against Lc0. Hopefully those weaknesses will be patched up before that happens.
It's not that easy to reliably tune an AB engine against Lc0 because of the continually evolving neural network. I agree though that matches against Lc0 will provide the Stockfish community in particular with large pool of data that can be used to fix its weaknesses. We can probably expect SF and Lc0 to improve alongside for quite a while...

TSU
Posts: 5
Joined: Sun Feb 03, 2019 7:27 pm
Full name: Tony Su

Re: Lc0 ... the GOOD and the BAD

Post by TSU » Tue Feb 05, 2019 6:25 pm

M ANSARI wrote:
Tue Feb 05, 2019 6:25 am
A0 does have a similar "tactical bug" to Lc0 (as shown in my other post viewtopic.php?f=2&t=69799) but apparently it does not happen too often. I think Lc0 will end up being much stronger than A0 as there was not so much time spent on A0. If you look at the progress of SF, the SF community became a formidable force and pushed the ELO of the engine to incredible heights. I think something similar will happen with Lc0. There is just so much that can be done to improve things and so much that is still experimental. I expect Lc0 to continually improve in strength and functionality at a very fast pace.

On the other hand, I think that AB engines will also gain a huge boost in strength by having Lc0 to spar with. It is obvious that many of the evaluations that SF and Komodo and Houdini have are inferior to Lc0 and they will be able to tune those evaluations better and improve their engines. Also it is possible that if Lc0 weaknesses are not patched, the AB engines might tune against those weaknesses and improve their score against Lc0. Hopefully those weaknesses will be patched up before that happens.
You guys have been focusing on obvious tactical blunders.
I've been focusing on positional blunders and wide swaths where engines in general and Leela in particular have no positional understanding and play the position either aimlessly (sometimes for several moves) or make a single positional move which in one move completely changes the game from completely winning to drawish or worse... and there are lots and lots of such oddities, the biggest I dub "black holes." The biggest "black hole" I've identified is the Exchange Gruenfeld, throughout the 3rd Stage of the recent Rapid tournament, not a single engine played either side better than a C class player until the position could be transformed into something the engines were more familiar with. Not surprisingly, the finesse maneuver Bg4 provoking f3 was never played, but there were also games where material was lost outright and was refused likely due to mis-evaluation.

Another is the tendency everyone has noticed for playing wing pawns, but I think that many human players have also forgotten why playing wing pawns is usually questionable so don't analyze critically whether engines including Leela are just playing bad moves. I theorize that all engines and Leela in particular because of the way she learns through self-play just don't know how to punish wing pawn advances so play that way all the time.

There are many other surprising positional tendencies beyond these two concrete examples, which IMO would be how I as a human would attempt to beat any of these machines. Of course, the remaining obstacle is that no matter how many mistakes these machines make, they calculate so well that they can often save themselves.

As to how fast lc0 improves, that'll be interesting to observe, and I don't know if there is anything to suggest it'll learn faster or slower at any time. IMO the problem is how to measure performance... Maybe you can set a particular engine opponent as a benchmark, but performance would be limited by what the two engines interact, there's so much more beyond that which might or might not be improving so YMMV.

dkappe
Posts: 236
Joined: Tue Aug 21, 2018 5:52 pm
Full name: Dietrich Kappe

Re: Lc0 ... the GOOD and the BAD

Post by dkappe » Wed Feb 06, 2019 12:45 am

TSU wrote:
Tue Feb 05, 2019 6:25 pm

You guys have been focusing on obvious tactical blunders.
I've been focusing on positional blunders and wide swaths where engines in general and Leela in particular have no positional understanding and play the position either aimlessly (sometimes for several moves) or make a single positional move which in one move completely changes the game from completely winning to drawish or worse... and there are lots and lots of such oddities, the biggest I dub "black holes." The biggest "black hole" I've identified is the Exchange Gruenfeld, throughout the 3rd Stage of the recent Rapid tournament, not a single engine played either side better than a C class player until the position could be transformed into something the engines were more familiar with. Not surprisingly, the finesse maneuver Bg4 provoking f3 was never played, but there were also games where material was lost outright and was refused likely due to mis-evaluation.

Another is the tendency everyone has noticed for playing wing pawns, but I think that many human players have also forgotten why playing wing pawns is usually questionable so don't analyze critically whether engines including Leela are just playing bad moves. I theorize that all engines and Leela in particular because of the way she learns through self-play just don't know how to punish wing pawn advances so play that way all the time.

There are many other surprising positional tendencies beyond these two concrete examples, which IMO would be how I as a human would attempt to beat any of these machines. Of course, the remaining obstacle is that no matter how many mistakes these machines make, they calculate so well that they can often save themselves.

As to how fast lc0 improves, that'll be interesting to observe, and I don't know if there is anything to suggest it'll learn faster or slower at any time. IMO the problem is how to measure performance... Maybe you can set a particular engine opponent as a benchmark, but performance would be limited by what the two engines interact, there's so much more beyond that which might or might not be improving so YMMV.
Can you give some positions where a particular net gets it wrong?

User avatar
M ANSARI
Posts: 3408
Joined: Thu Mar 16, 2006 6:10 pm

Re: Lc0 ... the GOOD and the BAD

Post by M ANSARI » Sun Feb 17, 2019 9:01 pm

There is a new update for Lc0 and it seems very good.
Here are two of the 2 positions that Lc0 failed earlier it seems to do much better. It plays Qd5+ winning in the first position where it played Nxb2 before and also in the second position it plays the correct Rd8 rather than the losing Rb7. But Rb7 still doesn't have a huge fail (when it should). Looks like good progress!



[d]4r3/5qpk/p5p1/1pN1n1B1/2n4P/P1P1P3/1P2Q1K1/7R b - - 0 46


Analysis by Lc0 v0.20.2:

1. -+ (-3.38): 46...Qd5+ 47.e4 Qxc5 48.h5 Kg8 49.hxg6 Nxg6 50.Qh5 Nce5 51.Qh7+ Kf7 52.Rf1+ Ke6 53.Qxg7 Rf8 54.Rf6+ Rxf6 55.Qxf6+ Kd7 56.Qd8+ Kc6 57.Qc8+ Kd6 58.Qxa6+ Nc6 59.Bf6 Qe3 60.e5+ Ngxe5 61.Bxe5+ Qxe5 62.Qb6 Qe4+ 63.Kg3 Qc4 64.Qe3 Ne5 65.Qh6+ Kd5 66.Qd2+ Ke6 67.Qh6+ Kd5 68.Qd2+ Kc6 69.Qh6+ Kb7 70.Qg7+ Nf7 71.Qg4 Nd6 72.Qd7+ Qc7
2. -/+ (-1.58): 46...Nxb2 47.e4 Nbc4 48.Nxa6 Qb7 49.Nb4 Nf7 50.Re1 Nfd6 51.Qf3 Nxe4 52.Nd3 Qd5 53.Nf2 Ncd6 54.Bf4
3. -/+ (-0.98): 46...a5 47.e4 Nxb2 48.h5 gxh5 49.Rxh5+ Kg8 50.Be3 Nbc4 51.Bd4 Qg6+ 52.Kh3 a4 53.Rf5 Qh6+ 54.Kg3 Qg6+ 55.Kh3

[d]r5k1/p2r1pp1/pn1Pp2p/4N3/3R4/2R5/1P3PPP/6K1 b - - 0 30

New game

Analysis by Lc0 v0.20.2:

1. = (-0.04): 30...Rdd8 31.Nc6 Rd7 32.Ne5 Rdd8 33.Nc6 Rd7 34.Ne5
2. +/= (0.49): 30...Rb7 31.f4 Rd8 32.Nc6 Rdd7 33.Ne5 Rd8 34.Nc6 Rdd7 35.Ne5 Rd8
3. +- (22.20): 30...Nd5 31.Nxd7 Nxc3 32.bxc3 Rd8 33.Nc5 e5 34.Rd5 Rxd6 35.Rxd6 f6 36.Rd8+




Also in TCEC there was a very promising position where Lc0 played what seemed like a very weak move Re1 instead of Qg6 in this position. This wasted tempi which allowed black King to escape and hide from heavy pieces and coordinated Knight and Queen and Bishop for good counterplay. This new version prefers Qg6 which seems much stronger ... and Re1 is not even on its top 3 best moves.

[d]2k5/1pb5/p1nqp3/2p3p1/4Q3/3PP1p1/PPP3Br/R4RK1 w - - 0 22

New game

Analysis by Lc0 v0.20.2:

1. +- (2.36): 22.Qg6 Nd4 23.Qe8+ Bd8 24.Rf8 Nf5 25.Re1 Nh4 26.Re2 Nxg2 27.Rxg2 Rh7 28.Re2 Kc7 29.a4 Qd5 30.Rg2 Rh4 31.Rf7+ Kc8 32.Rf6 Rxa4 33.Qxa4 Bxf6 34.Rxg3 Bxb2 35.Qe8+ Kc7 36.Qe7+ Kb8 37.Rxg5 e5 38.Rf5 Bc3 39.Kf2 a5 40.Rf6 e4 41.Rf8+ Ka7 42.Qxe4 Qxe4 43.dxe4 a4 44.e5 Bxe5 45.Rf5 Bb2
2. +/- (1.59): 22.Rab1 Nd8 23.c3 Qe7 24.b4 Rh4 25.Qg6 cxb4 26.cxb4 Rxb4 27.d4 Kb8 28.Qe4 Rb6 29.Rxb6 Bxb6 30.Qg4 Bc7 31.Rb1 Ka7 32.Qf3 Bd6 33.Qe4 Qc7 34.Qd3 e5 35.dxe5 Bxe5 36.Rd1 Nc6 37.Qd7 Qb6
3. +/- (1.59): 22.Rf3 Kb8 23.Raf1 Rh4 24.Rf8+ Ka7 25.Qf3 Rb4 26.Qf6 c4 27.a3 Rb5 28.dxc4 Re5 29.Qf3 g4 30.Qxg4 Rxe3 31.Kh1 Qe5 32.R8f7 Re2 33.Rh7 Rf2 34.Rd1 Re2 35.Rf1 Rf2 36.Rg1 Rxc2 37.b4 Nd4 38.Qe4 Qxe4 39.Bxe4 Rxc4 40.Rf1


So looks like very good progress!

carldaman
Posts: 1708
Joined: Sat Jun 02, 2012 12:13 am

Re: Lc0 ... the GOOD and the BAD

Post by carldaman » Sun Feb 17, 2019 11:09 pm

What network # did you use with the latest version?

Post Reply