News for hackers. Stuff that matters.
Re:An idea from physics helps AI see in higher dimensions by sillysaurusx on Thursday January 09, 2020 @12:34PM (#22003375)
One of the strangest things in AI, to me, is that you can average the weights of multiple different models to create a single model that’s better than any of the individuals.

This is how distributed training often works, for example. Data parallelism.

I don’t understand why it still works in higher dimensions, but it seems to.

The intuition is that the multiple models are “spinning” around the true solution, so averaging gives the final result more quickly. But it works even early in the training process.

Re:An idea from physics helps AI see in higher dimensions by rprenger on Thursday January 09, 2020 @01:04PM (#22003696)
When we use data parallelism, we're summing/averaging the gradients induced by different parts of the data, not the weights of the model itself. When using multiple models for ensemble methods, we're summing/averaging the output of the models for a sample. We're not summing/averaging the weights of the models themselves. While averaging the weights of several models might work on a given problem, it definitely doesn't work in general.

w2tanh(w1x) = -1w2tanh(-w1*x)

But if you average the weights in those two equivalent models you get 0.

If you're talking about asynchronous data parallelism, then there can be some averaging of weights, but they all start with the same weights and are re-synched often enough that weights are never too different to break it.

Re:An idea from physics helps AI see in higher dimensions by sillysaurusx on Thursday January 09, 2020 @01:52PM (#22004200)
https://www.docdroid.net/faDq8Bu/swarm-training-v01a.pdf

We average the weights themselves, and the efficiency seems to be similar to gradient gathering.

It’s also averaging in slices, not the full model. There’s never a full resync.

SWA is the theoretical basis for why it works, I think.

Another way of thinking about it: If the gradients can be averaged, then so can the weights.

Re:An idea from physics helps AI see in higher dimensions by uoaei on Thursday January 09, 2020 @03:39PM (#22005437)
If you are averaging weights often enough, then it's basically the same as averaging gradients. If you average the weights of a bunch of independently-trained models, you're going to have a rough time. Even if the function computes the exact same thing, the order of rows and columns in the intermediate matrices will totally ruin your averaging strategy.
Re:An idea from physics helps AI see in higher dimensions by joker3 on Thursday January 09, 2020 @12:46PM (#22003505)
Concentration of measure. If you have a quantity that depends on a large number of random variables but not too strongly on any small subset of them, it tends to behave like a constant. That's the intuition behind the law of large numbers, the central limit theorem, a bunch of concentration inequalities, and model averaging.
Re:An idea from physics helps AI see in higher dimensions by marcosdumay on Thursday January 09, 2020 @04:26PM (#22005962)
And, of course, there is nothing that says this would work for intermediate layers, since the sample dimensions may get there from any input.

What works is averaging similar networks and averaging your networks a lot of times.

Re:An idea from physics helps AI see in higher dimensions by gambler on Thursday January 09, 2020 @05:16PM (#22006494)
Are you familiar with a paper called Synergy of Monotonic Rules?

http://jmlr.csail.mit.edu/papers/volume17/16-137/16-137.pdf

The math there is above my paygrade, but it describes a way to structurally combine a certain class of ML models for very significant performance gains. More importantly, it describes why it works.

Re:An idea from physics helps AI see in higher dimensions by uoaei on Thursday January 09, 2020 @03:37PM (#22005411)
You are averaging weights in distributed training? That seems like it would be rife with pitfalls unless you average after every batch.

I always thought the preferred method was to average the gradient updates, and pass that to update the single mother-model.

Re:An idea from physics helps AI see in higher dimensions by im3w1l on Thursday January 09, 2020 @12:38PM (#22003423)
I believe it works in distributed training because the models never have time to diverge far enough to be "incompatible".
Re:An idea from physics helps AI see in higher dimensions by ghostcluster on Thursday January 09, 2020 @06:04PM (#22006834)
Isn't this sort of like "the wisdom of crowds"?

https://en.wikipedia.org/wiki/The_Wisdom_of_Crowds

Re:An idea from physics helps AI see in higher dimensions by MiroF on Friday January 10, 2020 @12:49AM (#22008633)
Even stranger is that such a misleading/false claim is upvoted here.
Re:An idea from physics helps AI see in higher dimensions by _wzsf on Sunday January 12, 2020 @01:25AM (#22024821)
I tried averaging the weights from a bunch of differently-trained neural networks for a Loss.jpg detector once.

If you think about what sort of brain you'd get if you "averaged" a few hundred geniuses' brains by blending them into a soup and adding some gelatin to a brain-sized sample, yeah, that's about the level of intelligence I saw in the "average neural net." It was basically in a constant state of seizure.

Re:An idea from physics helps AI see in higher dimensions by anonytrary on Friday January 10, 2020 @12:18AM (#22008506)
> One of the strangest things in AI, to me, is that you can average the weights of multiple different models to create a single model that’s better than any of the individuals.

I think this is one of the least strange things in AI. All you're doing is taking N overfitted models (unlikely to be overfit in the same way) and then asserting that the average of those predictions is probably not overfitted as much (regularization). Overfitting as a concept is not restricted to some number of dimensions.

Re:An idea from physics helps AI see in higher dimensions by MiroF on Friday January 10, 2020 @12:47AM (#22008625)
That would be averaging the predictions, not averaging the weights.

It doesn't really matter though, because the parent comment is nonsense and you can't just average the weights at the end and get a working neural net.

Re:An idea from physics helps AI see in higher dimensions by anonytrary on Friday January 10, 2020 @12:54AM (#22008656)
I just assumed he meant averaging the predictions but said it wrong.
Re:An idea from physics helps AI see in higher dimensions by pavanky on Thursday January 09, 2020 @01:36PM (#22004031)
The weights arent averaged unless the training step is synchronous. Even then most of the times it is the gradients that are added up rather than the actual weights.

For inference, I dont think there are many papers that claim direct average of weights perform better than any single model. It is usually the output that is accumulated in some way.

Re:An idea from physics helps AI see in higher dimensions by sillysaurusx on Thursday January 09, 2020 @02:13PM (#22004407)
https://arxiv.org/abs/1803.05407

"Averaging Weights Leads to Wider Optima and Better Generalization"

Weirdly, the averaging doesn't have to be synchronous.

Re:An idea from physics helps AI see in higher dimensions by halflings on Thursday January 09, 2020 @02:35PM (#22004687)
As others commented, you either ensemble models (average the predictions) or average the update (gradient).

For ensembling, the mathematical justification for why this surprising result is true (e.g just averaging many weak but different models gives a better model) is pretty interesting: https://en.wikipedia.org/wiki/Condorcet%27s_jury_theorem

Re:An idea from physics helps AI see in higher dimensions by ncraig on Thursday January 09, 2020 @01:08PM (#22003725)
Works for humans as well (wisdom of crowds).
Re:An idea from physics helps AI see in higher dimensions by toxik on Thursday January 09, 2020 @01:52PM (#22004202)
The claim as stated is not true, and would be equivalent to taking the average brain and it being as good as the average answer from those people. Nonsense.