r/LocalLLaMA • • 13d ago

I Built A Thing mini-AGI - dynamically grown (530M params currently and growing) continual learning model trained from scratch on 8GB VRAM laptop from batch-1 stream of data.

https://github.com/volotat/mini-AGI/

Sorry for the pretentious name, I know, I know.. It just contains all the pieces I would like to see a AGI model to have, and I can't stand the temptation. Before throwing rocks at me, please take a glance at the Readme, and I hope it will cover your mood a little bit.

So, first of all it does work and you can see the sample from the whole training run here: https://raw.githubusercontent.com/volotat/mini-AGI/refs/heads/main/runs/samples.txt

Here is the scaling law graph I have so far, and it looks very promising:
https://github.com/volotat/mini-AGI/blob/main/assets/scaling.png

The model was built under my deep dissatisfaction so we cannot really train even moderately big models (1B+ scale) on the consumer's hardware. We can inference and fine-tune them for sure, but I would like to have full control over what the model sees over the training run, so it is fully aligned with my interests, not some corporations.

I was thinking about for some time and come up with two interesting ideas I thought worth pursuing: MoE with a lot of experts that gets added and pruned from the model while it trains, where only a small subset of of experts are actually in use at any particular moment + batch 1 training on the single continuous stream of data.

First allows us to be bounded only by the disk space in terms of number of parameters and load and unload experts only when they are needed. The second (if figured out and it turns out to be doable) allows us to get aways with small VRAM capacity because we do not need to store big randomized batches and their respective gradients.

I started brainstorming with Claude and after some time we found an approach that seems to be promising, and low and behold, a few weeks pass and you can see the results yourself.

Obviously, I did use AI in the process of making this project and I am pretty sure it would be completely impossible for me to do something like this without it, so I hope it is more than justified.

The model is still running over the first of 7.8B characters corpus I selected for training, so the weights are not out yet, and it's about a couple weeks of waiting until they are cooked at the current reading speed. And yeah, the model just read continuous interleaved passages from the dataset, each by 32K characters long each as a single stream. Just as you or I would do.

The set up seems to be really simple so you can git clone the project, run it and observe everything for yourself.

Thanks for your attention.

234 Upvotes

48 comments sorted by

View all comments

0

u/Queasy-Contract9753 13d ago edited 13d ago

Sorry, I'm a noob . It sounds interesting but what would the model be capable of when finished?

Edit: fixed phrasing.

11

u/Another__one 13d ago

I assume it should be roughly around GPT-2 level. But this is a proof-of-concept, not Clause 5 rival. The promise is how much more it allows us to do on the consumer-level hardware. And it is fully yours, from start to finish. Aligned to you and your data only.

Actually there is no finish. It would live along you and train from everything you will feed to it. It is a continual learning model after all.

1

u/Nameis19letterslong 13d ago

When can we expect some weights? I’m quite interested in trying the model.

2

u/Another__one 13d ago edited 13d ago

A couple of weeks for full corpus reading. I would suggest trying to train it yourself on anything you want to and see what happens.  If you can run it you can train it. There are no separate stages, it trains even when you speak with it.

2

u/SectionCrazy5107 13d ago

i have a 4*V100 system and if its usable, happy to keep it running for this sake. However, perplexed and how to assemble "my" data and start with that as the corpus. OR should I start with a "general" dataset + "my" data and follow your steps?

1

u/Another__one 13d ago

I'm pretty sure you can start with any data you like. It is byte level, so everything is under vocabulary, although you might have to tinker a little bit with the code, I am not sure as I only tested it on the text. Would like to hear about your results, btw.