## Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

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

Moderators: Harvey Williamson, Dann Corbit, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.

## How many weights needed to play known chess very well using definitions in first post?

Fewer than 10 million
0
10 - 50 million
0
51-100 million
0
101 million - 1 billion
0
2 billion - 100 billion
0
More than 100 billion
0

towforce
Posts: 10694
Joined: Wed Mar 08, 2006 11:57 pm
Location: Birmingham UK

### Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

Thanks to AlphaZero, we know that a good game of chess can be played by a NN with 50 million weights. As explained in other threads, I am interested in building is an evaluation function as a system of linear expressions rather than an NN (an NN is actually analogous to a system of linear expressions, and, as linked from another thread, it is possible to extract a set of expressions from an NN). As far as I know, Deepmind (the authors of AlphaZero) are not interested in making their NNs smaller having trained them, but, a system of linear expressions often can be made more compact while giving equally good results (see other thread for two ways of doing this). I believe that AlphaZero could almost certainly play equally well at a much smaller size if Deepmind were interested in doing this, so for me, 50 million weights is very much an upper limit for AlphaZero's standard of play. My opinion is that optimising linear expressions to reduce the number of expression would be MUCH easier than reducing the size of an NN and getting the same result.

The human brain has 10^11 neurons, and the average neuron has connections to 10,000 other neurons, for a total of 10^11x10^4=10^15 weights.

Using linear expressions instead of NNs, call V "values and W "weights", the expressions would look roughly like this:

Output 1 = V1*W1
Output 2 = V2*W2 + V3*W3 + V4*W4

The expression for output 1 has one weight, and the expression for output 2 has 3 weights, making a total of 4.

In order to model the complexity of chess, you'd need a large number of expressions in each layer, and multiple layers of NNs. As discussed in other threads, I think you'd similarly need multiple layers of linear expressions, each layer below the surface layer being divided differences (link) of the layer above to keep it linear (but, of course, these divided differences would have new weights of their own).

The target of all this optimisation would be to model a data set of of chess positions with known evaluations, and from this model create an evaluation function that would meet the following criteria:

1. differentiate a drawing position from a lost position, so that in a drawing position the program would avoid a losing move, and hopefully choose the drawing move which is the best position

2. in a winning position, give higher scores to move positions which are on the shortest path to checkmate

Chess is a very complicated game, but it's my opinion that the number of weights needed to play known positions nearly perfectly is probably less than most people would think.

Of course, people would find positions that the program would evaluate wrongly, and these positions could be added to the data set, and the system be "retrained". I would predict that, sooner than most people would expect, it would become very difficult to find positions which it evaluated wrongly - and hence you'd have a system that could play "known" chess almost perfectly almost instantaneously. The deep hidden secrets of chess would then be unlocked.
Writing is the antidote to confusion

Posts: 10936
Joined: Wed Jul 26, 2006 8:21 pm

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

No NN, just MCTS. It will beat me.
As for an NN + MCTS on a GPU, I think even a 16x3 net will beat any human (if the engine is built well, allowing for hundreds of thousands of "nodes" per second).

Zenmastur
Posts: 914
Joined: Sat May 31, 2014 6:28 am

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

Sun Oct 20, 2019 8:45 pm
No NN, just MCTS. It will beat me.
As for an NN + MCTS on a GPU, I think even a 16x3 net will beat any human (if the engine is built well, allowing for hundreds of thousands of "nodes" per second).
Really?

That would be a novel approach. I would like to see that.
Only 2 defining forces have ever offered to die for you.....Jesus Christ and the American Soldier. One died for your soul, the other for your freedom.

jp
Posts: 1409
Joined: Mon Apr 23, 2018 5:54 am

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

Since artificial neural networks have nothing to do with human brains, I don't think comparisons between NN weights and numbers of human neurons etc. tell us much.

Ovyron
Posts: 4405
Joined: Tue Jul 03, 2007 2:30 am

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

jp wrote:
Mon Oct 21, 2019 3:17 am
Since artificial neural networks have nothing to do with human brains, I don't think comparisons between NN weights and numbers of human neurons etc. tell us much.
+1

hgm
Posts: 25382
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

It depends on how you define "very well". If you are happy with Stockfish, the answer is "a couple of hundred". Conventional evaluations can be implemented as Neural networks with a one or two layers. The weights are piece (or piece-square) values, passer bonuses etc.

If you are happy with micro-Max, you could do with a single layer and a few dozen weights.
Get rid of the shit: vote for SHID!

towforce
Posts: 10694
Joined: Wed Mar 08, 2006 11:57 pm
Location: Birmingham UK

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

jp wrote:
Mon Oct 21, 2019 3:17 am
Since artificial neural networks have nothing to do with human brains, I don't think comparisons between NN weights and numbers of human neurons etc. tell us much.

It sounds as though you know more about this than me. I understand that a lot of animals are good at doing things (complex behaviour), but not very good at learning (still less "working things out"). For clarity, my thinking regarding artificial NNs is as follows:

1. they have a proven ability to do useful learning

2. in operation (though not necessarily in inputs - but that isn't important for my purposes) analogous to a set of linear expressions

I am happy to learn anything that you can teach me with regards to NNs and chess!
Writing is the antidote to confusion

towforce
Posts: 10694
Joined: Wed Mar 08, 2006 11:57 pm
Location: Birmingham UK

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

Sun Oct 20, 2019 8:45 pm
No NN, just MCTS. It will beat me.
As for an NN + MCTS on a GPU, I think even a 16x3 net will beat any human (if the engine is built well, allowing for hundreds of thousands of "nodes" per second).

There's a disparity of purpose here: it looks to me as though you're trying to find an easy way to play good chess. Nothing wrong with that - I commend your purpose wholeheatedly! However, my purpose is to take an important step to solving chess (and making an unbeatable opponent along the way).

The team that published the first maps (hundreds of years ago) made an important step to solving navigation. Now, navigation on earth is more or less solved: your phone can tell you where you are, and which direction you need to move in to get to your destination.

I actually want something even bigger than that: it's possible (and I am an optimist), that there may exist in chess a way to evaluate most positions that, while too complicated to have been found by humans, is simple enough for humans to understand. This would represent a very powerful demonstration of AI capability against a finite game that's beyond the limit of humans working without computers.

Actually, I want EVEN MORE than that: I want to demonstrate a method for solving ANY closed (finite) body of knowledge!
Writing is the antidote to confusion

towforce
Posts: 10694
Joined: Wed Mar 08, 2006 11:57 pm
Location: Birmingham UK

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

hgm wrote:
Mon Oct 21, 2019 7:37 am
It depends on how you define "very well". If you are happy with Stockfish, the answer is "a couple of hundred". Conventional evaluations can be implemented as Neural networks with a one or two layers. The weights are piece (or piece-square) values, passer bonuses etc.

If you are happy with micro-Max, you could do with a single layer and a few dozen weights.

Thank you - that's very interesting!

If this is right, it supports my view that a NN to evaluate a single chess position with good accuracy (and play a game at ply 1 search) would probably require fewer neurons and weights than most people think.
Writing is the antidote to confusion

fabianVDW
Posts: 142
Joined: Fri Mar 15, 2019 7:46 pm
Location: Germany
Full name: Fabian von der Warth

### Re: Poll: How Many "Weights" Needed To Play "Known" Chess Very Well?

hgm wrote:
Mon Oct 21, 2019 7:37 am
It depends on how you define "very well". If you are happy with Stockfish, the answer is "a couple of hundred". Conventional evaluations can be implemented as Neural networks with a one or two layers. The weights are piece (or piece-square) values, passer bonuses etc.

If you are happy with micro-Max, you could do with a single layer and a few dozen weights.
This assumes preprocessed features though. I thought the questions assumes a raw board representation as input for the neural network.
Author of FabChess: https://github.com/fabianvdW/FabChess
A UCI compliant chess engine written in Rust.
FabChessWiki: https://github.com/fabianvdW/FabChess/wiki
fabianvonderwarth@gmail.com