Page 1 of 6

Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 4:41 pm
by Chessqueen
Is it the Hardware speed or some breakthrough programming innovation?
So far what is the score between Komodo and Leela ?
https://www.youtube.com/watch?v=ymDA7-hdkKA

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 4:45 pm
by Robert Pope
Do you mean Leela, in general, or Leela today vs. 6 months ago?

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 6:35 pm
by MikeB
Chessqueen wrote:
Wed Jan 16, 2019 4:41 pm
Is it the Hardware speed or some breakthrough programming innovation?
So far what is the score between Komodo and Leela ?
https://www.youtube.com/watch?v=ymDA7-hdkKA
I'll take a quick stab and also try to keep it simple to understand the gist without getting mired down in all the nitty gritty details.

You might have heard phrase Neural Network or "NN". The theory of NN has been around for years - check this summer thesis submitted by Justin Boyan in 1992:

Modular Neural Networks for Learning Context􏰆 Dependent Game Strategies
http://citeseerx.ist.psu.edu/viewdoc/do ... 1&type=pdf

NN been round for over 30 years - but it's only been recently ( last ten years) where the hardware ( and the software written to take advantage of the hardware) has taken this to a much higher level than playing a game. Neural Network and its related cousin Data Analytics are huge today at major companies thought out the world - not for playing games - but for making real time business decisions. A perfect example is that my former company developed a model to predict which of their customers ( over a hundred million) will mostly likely default and use that as to how much credit will be extended and the type of remedies they will use when they do default to maximize their recovery (they called it Predictive Analytics) - and it's all automated . Google, Amazon , Facebook etc are all into this big time and they probably know you better than your friends know you.

How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move. In fact, Leela has an output option to display White or Black's "chances of winning percentage" rather than the customary centipawn evaluation. This is a gross simplification of the process - to gain a better and more compete understanding - read through this link below which has links to 20 or so other websites with more information:

https://deepmind.com/blog/alphazero-she ... gi-and-go/

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 7:12 pm
by D Sceviour
MikeB wrote:
Wed Jan 16, 2019 6:35 pm
How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move.
How does this differ from polyglot or other opening books?

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 7:30 pm
by Dann Corbit
An opening book has information in it which has been calculated a-priori either statistically, by computer analysis, or by human analysis (or some combination thereof).

Generally speaking, this information is static data which tells the engine what to do if there is a move in the book that has been stored.

What the neural net approach does is to teach the framework what to do when it sees various formations. The games are used to adjust what the evaluation will do if it sees something that is important for the game of chess. The stuff that it learns is based on the rules of the game and the formations that it sees. It writes this stuff out into a big pile of numbers (what you hear called a networks). The programmers of the network themselves do not even know what the numbers mean.

They sound a little similar but they are not similar. Let me explain. If you give the neural network a position it has not seen before ever it will return a score for that position based upon what it has learned. If you probe a book for a position that has never been stored in the book, you will get a return that says, "NO DATA". So the neural net approach is teaching an evaluation function to "think" but the polyglot book is just a pile of data for a particular collection of positions.

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 7:34 pm
by Guenther
D Sceviour wrote:
Wed Jan 16, 2019 7:12 pm
MikeB wrote:
Wed Jan 16, 2019 6:35 pm
How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move.
How does this differ from polyglot or other opening books?
Because above explanation is wrong. In reality it extracts bazillions of patterns (not positions) and tries to use them in real games.

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 7:45 pm
by MikeB
D Sceviour wrote:
Wed Jan 16, 2019 7:12 pm
MikeB wrote:
Wed Jan 16, 2019 6:35 pm
How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move.
How does this differ from polyglot or other opening books?
As noted, my simplistic explanation leaves out a lot details that occur behind the scenes - it will be best for readers to actually click the links and take a deep dive if the simplistic explanation above leaves you with more questions than answers

Here are 3 of the some of the more interesting reads;

http://science.sciencemag.org/content/3 ... siteid=sci

https://deepmind.com/documents/260/alph ... eprint.pdf

http://science.sciencemag.org/content/362/6419/1118

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 7:46 pm
by D Sceviour
Guenther wrote:
Wed Jan 16, 2019 7:34 pm
D Sceviour wrote:
Wed Jan 16, 2019 7:12 pm
MikeB wrote:
Wed Jan 16, 2019 6:35 pm
How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move.
How does this differ from polyglot or other opening books?
Because above explanation is wrong. In reality it extracts bazillions of patterns (not positions) and tries to use them in real games.
I did that for pawn structure patterns in earlier versions of Schooner. However, lack of sufficient training data gave unreliable results. It seemed to help a bit - but not enough to make a 100 elo of difference. Mostly I set intuitive values for "patterns" from experience. Are not stored position values more reliable than pattern values? This assumes that a pawn structure pattern is different from a complete chess position.

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 8:02 pm
by dkappe
There are two parts to leela or other neural network based engines: search and evaluation.

Leela (and many go programs) use a form of search called mcts, or Monte Carlo tree search (See UCT). It’s fundamentally different from the minimax search in an engine like stockfish. It uses a strategy (in it’s most primitive form, random) to pick a leaf node to expand. Then plays out a bunch of games (again, in its most primitive form, random) from that leaf node to determine how likely a win/draw/loss is. (This random playouts is where the “Monte-Carlo” comes from.) These results get backed up to the root of the tree. With almost no game strategic knowledge, you could achieve surprisingly good results.

People discovered that if you added some heuristics to guide the selection of leaf nodes and the playouts, you could significantly improve the results (see the pre-nn go program pachi for an example). Then along came DeepMind and trained a neural net to rank the most promising moves (policy) for selection of a leaf node to expand and predict outcome (value), eliminating the need for playouts (there is no “Monte-Carlo” anymore in this nn driven search).

The neural network started out as two nets — a policy net and a value net — in DeepMind’s early design, but got combined into one that takes game state and produces both outputs. The net is trained through reinforcement learning — it plays itself with 800 node searches and trains the net on the improved vale (game outcome) and policy (from the search). It learns over millions of games.

If you look at the games of an early net, it plays randomly, eventually like a child, then progressively stronger. It discovers opening by itself, often preferring openings like the French and Caro-Kann early before preferring d4 openings.

If it has one weakness, it might be the endgame, though there are differing opinions as to why that might be.

Re: Can somebody explain what makes Leela as strong as Komodo?

Posted: Wed Jan 16, 2019 8:03 pm
by MikeB
Guenther wrote:
Wed Jan 16, 2019 7:34 pm
D Sceviour wrote:
Wed Jan 16, 2019 7:12 pm
MikeB wrote:
Wed Jan 16, 2019 6:35 pm
How does Leela work - it plays scores of millions of games with itself and analyze the moves , the position, and the result of those games to come up with a predictive analytic outcome for each position. It takes the the position that has the highest chance of winning the game based on its history and analysis of its passed games and plays that move.
How does this differ from polyglot or other opening books?
Because above explanation is wrong. In reality it extracts bazillions of patterns (not positions) and tries to use them in real games.
You can be one the most miserable people on the face of the earth as you seeming have an over whelming desire to tell someone is wrong when they are not really wrong. Semantically there is no almost no difference between a chess position and a chess pattern except for what's in your head. A chess position is a chess pattern by definition. Every chess position is a chess pattern,
Criticism is vain, because in judging others, we regard ourselves as more righteous than they. For some people, their self-esteem and identity is tied to “being right” and “being knowledgeable. They feel that they are a worthwhile person if they are correct, and more importantly, if other people know it. If you derive your self-esteem from being right… why? Why is that your source of self-esteem? Do you feel embarrassed being wrong or making a mistake? by Tim Marks