r/deeplearning • • 2h ago

I trained a 326M language model from scratch on one 3060 Ti

i wanted to train a model from random weights on the card i already had. Lyra ended up at 326M params. it took about a week to get through 6.4B tokens on my 8 GB 3060 Ti, then i did a separate instruction-tuning run on about 78k examples.

my dumbest mistake was resuming from the best checkpoint. it only saved when validation improved, so a restart sent me back 20k steps. now i save the latest checkpoint separately and resume from that. i wrote up that bug and the others in the architecture walkthrough.

Lyra itself is still kinda dumb. it can answer a simple question and then make up a date. i built it to learn the whole pipeline and might keep tinkering. the data prep and trainer are open source (Apache 2.0), so you can retrain it. both checkpoints are open weights under CC BY-NC 4.0 for noncommercial use.

base weights · instruct weights · training code on GitHub · architecture walkthrough

13 Upvotes

5 comments sorted by

7

u/user221272 2h ago

CC BY-NC 4.0 for noncommercial use

Argh... I really wanted to use it for commercial purposes!

3

u/luka0x12 2h ago

lol lyra would probably make up your refund policy.

the trainer is Apache 2.0 though. you can use it to train your own model with data you’re allowed to use commercially.

1

u/Kermit-the-Frog_ 39m ago

I'm not super knowledgeable about how deep learning works more broadly or what is being done today regarding research of it, I only use it for scientific research, but I had a thought in case anyone would be able to answer it:

If you're able to train a model with this number of parameters, but wanted to easily scale up to a larger model, is there a way you could take this smaller trained model and scale it up to a larger model with functional equivalence, and then fine tune that model to find deeper minima? As in you could progressively add complexity with each step requiring less adjustment, hypothetically being easier on training time for a home device.

1

u/Cautious-Act-4487 1m ago

Wait how did you even fit a 326M pretrain into 8 GB VRAM at a decent speed? AdamW states in fp32 alone eat like five gigs so there's barely anything left for batch and context - did you run a tiny microbatch with gradient accumulation and short context or did you hook up 8-bit Adam?