Hacker News new | ask | show | jobs
Show HN: I trained a 326M language model from scratch on one RTX 3060 Ti (github.com)
5 points by Luka12-dev 3 days ago
I wanted to see how far I could get with the GPU I already had. Pretraining Lyra on 6.4B tokens took a little over a week on my 8 GB 3060 Ti. Then I fine-tuned it on about 78,000 examples to see what it would take to turn a text completer into something I could chat with.

One restart sent me back 20,000 steps. My resume command loaded the checkpoint with the best validation loss, which hadn’t improved in a while. Now I save the latest training state separately so a restart picks up where I actually left off.

You can try the instruct checkpoint locally with python chat.py. It handles simple questions and still confidently makes things up. The training code is Apache 2.0 if you want to retrain it, and both checkpoints are available under CC BY-NC 4.0.

Base checkpoint https://huggingface.co/luka0x12/Lyra-326M-base Instruct checkpoint https://huggingface.co/luka0x12/Lyra-326M-Instruct Architecture and training notes https://luka0x12.github.io/Lyra/

2 comments

It seems similar to the HuggingFace Smol models https://huggingface.co/HuggingFaceTB
Yeah, SmolLM was one of the recipes I looked at. I used FineWeb-Edu, Cosmopedia, and Python-Edu too. I wanted to see if I could train the whole thing from random weights on my 3060 Ti. I used activation checkpointing on every layer to fit the run in 8 GB.
Luka, zdravo, upravo sam pročitao vest na X-u o tvom uspehu. Molim te, možeš li me kontaktirati preko mojih društvenih mreža - moje ime je Aleksandar Stojanović, na X acastop. Pre svega, molim te, mogu li me tvoji roditelji kontaktirati, jer bi bilo najbolje razgovarati sa njima pre nego se razgovara sa tobom. Moja ideja je, da ako je ovo zaista toliko dobro - da te spojim sa nekim svojim kontaktima i da nađete modalitet saradnje. Ne razumem se u ovu vrstu projekata, ali sa obzirom da si iz moje zemlje i da si tako mlad i talentovan, voleo bih da mogu da pomognem. Pozdrav, Aleksandar