How should I balance learning rate and data sampling during CPT on multiple datasets? #3868
-
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
|
I personally don't have experience in data mixing recipe. @felipemello1 @slimfrkha @rakkit @haydn-jones in case you could help |
Beta Was this translation helpful? Give feedback.
-
can you confirm that they are actually being sampled at this rate? In our design, we went with having an entire packed row being of just one dataset. e.g. [ Looking back, i think that this was not ideal, and we should have allowed: [ So i wonder if your cfg matches the true distribution If the dataset is small and batchsize is relatively small, then one train step would be heavily weighted towards that dataset, but then multiple training steps wouldnt have that dataset at all, possibly leading to forgetting. We will have a refactor soon and we can address that there. Meanwhile, perhaps ask some AI to refactor the packing, to allow multiple datasets in the same row. You can check if that solves your issue with learning/forgetting. |
Beta Was this translation helpful? Give feedback.
-
|
I would do a WSD LR regime where with a mixture focused on dominant datasets (eg fine web edu) on the warm+constant regime then switch in decay stage to data mix focused on the small HQ datasets (keeping small portion of fine web edu to avoid catastrophic forgetting). |
Beta Was this translation helpful? Give feedback.
-
|
Hey @jefcoder. I don't think there's a magic solution here, but @felipemello1 and @slimfrkha have made the right points separately so I'll (try) to tie them together. There are roughly three "easy" approaches to a multi dataset recipe:
For your LR question specifically, I don't think there's a single LR that serves both regimes. "Which LR does this dataset want" should be "at which point in the LR decay does this dataset get sampled." Your observation that small datasets only improve at tiny LR is the right observation, so merge it into the LR schedule. TLDR: Try (3). |
Beta Was this translation helpful? Give feedback.
-
|
i think its better to rephrase question 2) then i think what you really want to solve is, how to mix of your 8 datasets to minimal val loss of your "averaged target", for that there is no magic solution, if you do pre-train, you can go e.g. remix or olmix, train proxy model and predict combination for minimal loss. there are also some methods suggest you can train model on each dataset and merge checkpoint to see data mix. For your CPT case, i think its not avoidable to run lots of short runs and fiting the data mix predict like loss = (pct of data1, pct of data 2 ...) and you can usually use linear model to solve it to get best pct s.t lowest loss. for you question 1, its easier to solve. for you "production" run, saying you solved 2 already and know the mix. then you just need to tune LR and BS (you need proper combination of these hyper-partermers instead of tune LR or BS seprately).
one of the concern of higher LR is forgotten, so your base model's pre train knowledge get affected.
then you can extrapolate this to your target training horizon (e.g. 200B here), by LR |
Beta Was this translation helpful? Give feedback.


Ok actually two more things.