| ▲ | Train Your Own LLM from Scratch(github.com) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 points by kristianpaul 8 hours ago | 29 comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jvican 7 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
If you're interested in this resource, I highly recommend checking out Stanford's CS336 class. It covers all this curriculum in a lot more depth, introduces you into a lot of theoretical aspects (scaling laws, intuitions) and systems thinking (kernel optimization/profiling). For this, you have to do the assignments, of course... https://cs336.stanford.edu/ | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | NSUserDefaults 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Been doing it since the day I was born. The beginnings were hard but I’m getting there. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | JoeDaDude 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Coincidentally, I just started on Build a Large Language Model (From Scratch), a repo/book/course by Sebastian Raschka [0][1][2]. Maybe it is a good problem to have to have to decide which learning resource to use. [0] https://github.com/rasbt/LLMs-from-scratch [1] https://www.manning.com/books/build-a-large-language-model-f... [2] https://magazine.sebastianraschka.com/p/coding-llms-from-the... | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | antirez 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Context: he is one of the MLX developers, a skilled ML researcher. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | y42 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
shameless plug: A series of Jupyter notebooks explaining the whole machine learning mechanism, from the beginning https://github.com/nickyreinert/DeepLearning-with-PyTorch-fr... and of course also how to build an llm from scratch https://github.com/nickyreinert/basic-llm-with-pytorch/blob/... | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | kriro 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
I did it back in the day when fast.ai was relatively new with ULMFiT. This must have been when Bert was sota. The architecture allows you to train a base and specialize with a head. I used the entire Wikipedia for the base and then some GBs of tweets I had collected through the firehouse. I had access to a lab with 20 game dev computers. Must have been roughly GTX 2080s. One training cycle took about half a day for the tokenized Wikipedia so I hyper parameter tuned by running one different setting on each computer and then moving on with the winner as the starting point for the next day. It was always fun to come to work the next morning and check the results. The engineering was horrible and very ad-hoc but I learned a lot. Results were ok-ish (I classified tweets) but it gave me a good perspective on the sheer GPU power (and engineering challenges) one would need to do this seriously. I didn't fully grasp the potential of generating output but spent quite some time chuckling at generated tweets (was just curious to try it). | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | ofsen 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
This looks like exact copy of this video of andrej karpathy ( https://youtu.be/kCc8FmEb1nY ) but in a writing format, am i wrong ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | fabian_shipamax 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
If someone is interested, I am giving short courses with walkthrough on how to train you LLM from scratch via AI Study Camp. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | steveharing1 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
The documentation is really helpful enough to get started | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | hiroakiaizawa 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Nice. What scale does this realistically reach on a single machine? | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | iamnotarobotman 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
This looks great for a first introduction to training LLMs, and it looks simple enough to try this locally. Great job! | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | baalimago 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Train your LM from scratch* I doubt you have a machine big enough to make it "Large". | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | DeathArrow 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
I would start with linear algebra, some calculus and statistics and understand how a neural network - which really is just one type of ML - works, the learn the basics of CNN and RNN, then learn transformers and LLM. But that is just me. I think is more useful to understand the how and whys before training a LLM. | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | yjaspar 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
That’s actually super interesting | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | rithdmc 3 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
I know it's a bit of a joke, but "I Built a Neural Network from Scratch in SCRATCH" gave me, a complete outsider, a lot of insight into how neural networks work. | |||||||||||||||||||||||||||||||||||||||||||||||||||||