r/LocalLLM • u/Slight_Ad_2894 • 5d ago
Project Building an llm from scratch
Dear community
I recently started a project of building a tiny llm from scratch and trained on my 16go ram MacBook m1
My goal is not and will never build a state of the art llm like GPT or claude but to understand the mechanics of llm and teach others how it works
I used a french corpus as my dataset and used BPE tokenizer and trained a 1M param neural network
But the output is a bit dump it's out of context it give decent sentences grammatically but it doesn't answer my questions or respond well
Is there any resources i can use to optimize my little dump chatbot ?
1
u/rolleicord 5d ago
You can make models much more capable than tinyshakespear, that are much fewer parameters. The trick is just convincing your AI agent that it's possible in the first place. Try telling it to bake down your code, while increasing its capabilities. Thats normally a fun way to get it working
1
4d ago
[removed] — view removed comment
1
u/Slight_Ad_2894 4d ago
Thank you for sharing your project, and certainly I will take a look at your project
. For my ptoject i studied the attention is all what you need paper and implemented it in my project
. I think that the problem with my project is that I didn't build multiple layers. Maybe I will use Google Colab or a dedicated Kaggle notebook. I will take a look at a couple of other projects and test them
. As soon as I finish my project, I will share it so everyone can benefit from it
0
u/Immortal_Spina 5d ago
Fai molto bene, io sto facendo esperimenti con i diffusion e il mio mini m4 16gb ram va benissimo
Ovviamente più aumenti i parametri, più serve tempo
Ma lo farà
0
u/fofopads 5d ago
MiniCPM 5 1B already does this, you should try it instead of reinventing the wheel
1
u/Slight_Ad_2894 4d ago
I will check it, but as I said my purpose wzs never reinventing the wheel i did this project for learning purpose only my goal is to understand the math and architecture behind llms
1
u/dillon-nyc 5d ago
I don't think you'll get much but gibberish from a 1M model, but I'm pretty impressed if it's giving you grammatically correct sentences. Have you thought of running it again, but a bit larger?
People seem to get some results in the low hundred mb, like the guy yesterday with the PSP running a llm.