Stan van Wingerden's Shortform

post by Stan van Wingerden (stan-van-wingerden) · 2024-12-11T18:00:53.568Z · LW · GW · 4 comments

Contents

4 comments

4 comments

Comments sorted by top scores.

comment by Stan van Wingerden (stan-van-wingerden) · 2024-12-11T18:00:53.900Z · LW(p) · GW(p)

Here's a quick interesting-seeming devinterp result:

We can estimate the Local Learning Coefficient (LLC, the central quantity of Singular learning theory, for more info see these [LW · GW] posts [LW · GW]/ papers) of a simple grokking model on its training data over the course of training. 

This yields the following plot:

(note: estimated LLC = lambdahat = )

What's interesting about this is that the estimated LLC of the model in this plot closely tracks test loss, even though it is estimated on training data.

On the one hand this is unsurprising: SLT predicts that the LLC determines the Bayes generalization error in the Bayesian setting.[1] On the other hand this is quite surprising: the Bayesian setting is not the same as SGD, an increase in training steps is not the same as an increase in the total number of samples, and the Bayes generalization is not exactly the same as test loss. Despite these differences, the LLC clearly tracks (in-distribution) generalization here. We see this as a positive sign for applying SLT to study neural networks trained by SGD.

This plot was made using the devinterp  python package, and the code to reproduce it (including hyperparameter selection) is available as a notebook at https://github.com/timaeus-research/devinterp/blob/main/examples/grokking.ipynb

Thanks to Nina Panickserry and Dmitry Vaintrob, whose earlier post on learning coefficients of modular addition [LW · GW] served as the basis for this experiment.

 

  1. ^

    More precisely: in the Bayesian setting the Bayes generalization error, as a function of the number of samples n, is λ/n in leading order.

Replies from: ryan_greenblatt, alexander-gietelink-oldenziel
comment by ryan_greenblatt · 2024-12-11T18:43:31.685Z · LW(p) · GW(p)

I'm curious how well test loss is predicted by unprincipled metrics in this setup. For instance, how well is it predicted by the l2 norm of the weights? What about average_log_probability_on_train?

(Average log prob on train is loss on test if you assume that test labels are unrelated to the model's train predictions and train log probs have the same distribution as test log probs. You could also do average_log_probability_on_test which is a metric you can run without needing test labels as long as you have test inputs.)

Replies from: Ansatz
comment by Experience Machine (Ansatz) · 2024-12-12T11:26:55.848Z · LW(p) · GW(p)

Using almost the same training parameters as above (I used full batch and train_frac=0.5 to get faster & more consistent grokking, but I don't think this matters here)

I did a few runs and the results all looked more or less like this. The training process of such toy models doesn't contain so many bits of interesting information, so I wouldn't be surprised if a variety of different metrics would capture this process in this case. (E.g. the training dynamics can be also modelled by an HMM, see here). 

comment by Alexander Gietelink Oldenziel (alexander-gietelink-oldenziel) · 2024-12-11T18:23:37.428Z · LW(p) · GW(p)

I would be interested what current SLT-dogma on grokking is. I get asked whether SLT explains grokking all the time but always have to reply with an unsatisfying 'there's probably something there but I don't understand the details'.

@Zach Furman [LW · GW] @Jesse Hoogland [LW · GW]