Compute grows fast but pretraining corpora don’t, so data-constrained optimization matters!
@xingyudang1.6K followers
38,000 views
20 Comments
Comments from the original post on X (Twitter)

@xingyudang
Please check out our blog post at
28 likes

@xingyudang
On SlowRun, adding T³ to the previous record scripts with nothing else changed lowers val loss by 0.011 (1-hour) and 0.012 (15-min) across multi seeds. We further added a few tweaks pushing the 1-hour track result to 3.183
12 likes

@xingyudang
Added to the tuned data-constrained recipes of Kim et al. with no hyperparameters changed, T³ also lowers validation loss by 0.012–0.015 nats/token at 300M, 600M and 1.4B over 8 seeds.
15 likes

@xingyudang
It’s cheap and simple: a first-order step with three extra lines. Shift the weights along A’s gradient, take Q’s gradient there, shift back. No other optimizer or hyperparameter changes, and a step takes only 6 to 9% longer.
14 likes

@xingyudang
The gain comes from testing on tokens the trial step didn't see. Testing on the same tokens hurts, random or uphill trial steps don't help, and half batch with 2× steps is worse. SAM is also generally worse than the baseline, with steps 1.94× slower.
10 likes

@xingyudang
cc folks who might be interested @konwookim @kothasuhas @tatsu_hashimoto @percyliang @industriaalist @akshayvegesna @ShmuelBerman @Muennighoff @andrewgwils @jxbz @dlwh @_arohan_
12 likes

@DimitrisPapail
I think pretraining corpora are and will keep growing faster than compute
6 likes

@xingyudang
Ha, fair, code is clearly exploding. But we still don't really know how to make good use of massive synthetic data in pretraining, and even for code, people still train for multiple epochs.
1 like

@xingyudang
Nexus ( also takes trial steps on mini-batches and accumulates the first-order meta-gradient. It reaches the same loss with better downstream performance in 1-pass training.
5 likes

@jackcai1206
This is super interesting!
4 likes

@xingyudang
Thanks! Data-constrained optimization is so much fun!

@maciejpioro
Isn't this the same as ?
3 likes

@AdamKleinML
Interesting that it only improves performance when tokens repeat. This makes me think it's acting more like a regularizer than anything. Maybe optimizing the weights to be robust under noisy mini-batches pushes towards wide minima
3 likes

@jeffreycider
very cool! what do you think about hypergradient methods? i.e. for architecture f, optimizer g, parameters \theta, optimizer hyperparameters \phi parameterize step t+1's fwd pass as f(\theta_t + g(\nabla L(\theta_t), \phi_t)). backprop through hyperparameters \phi_t using the next minibatch t+1 i think (?) it looks like your method but staggered across optimizer iterations. wondering if your method's success critically depends on the two batch halves being eval'd on the same parameterization
2 likes

@xingyudang
Thanks! Online meta-gradients on hyperparameters sound cool, and it'd be exciting to see that work at pretraining scale. On your question: in our closest ablation, a trial step along the previous step's direction loses the gain (+0.002, within noise).
2 likes

@DanielLenton1
Does it still help when you fine-tune on a small dataset for a few epochs?
1 like

@xingyudang
Could be helpful. I haven’t tried it yet
1 like

@eatnow240008
This sounds a lot like Reptile, how is it different?
1 like

@ShivamGuptaim
The same-token ablation is the useful sting here: testing the move against itself makes things worse. Curious whether splitting A and Q by source rather than randomly changes the result. That would expose when “generalizes across the batch” is mostly “fits the dominant source”.

@ry4nhu
It seems that normalization here is the key? any intuition behind why normalizing gradient as the perturbation in particular here works?