3 ms·
I mean are you trying to just use LLMS? or Learn how to build and train them? If you are just looking to use LLMs, you are basically either going to be using o
by ActorNightly 2y ago
I mean are you trying to just use LLMS? or Learn how to build and train them?
If you are just looking to use LLMs, you are basically either going to be using ollama with the smaller size models to run on hardware, or you are going to be using an API online to run inference in the cloud. All of this is pretty easy.
If you are trying to learn ML in depth, then you just have to basically start from scratch.
Start with Karpathy Micrograd project. It basically shows you how stuff works under the hood. Get the repo, run the examples, play around with it. Try to figure out how to approximate a mathematical function, i.e you give it one input and then the output is a single value.
Then familiarize yourself with Pytorch. Start with the official tutorials, and try stuff.
This is also a good read.https://pytorch.org/blog/inside-the-matrix/ https://pytorch.org/blog/inside-the-matrix/
Then you have to basically grind out the following steps
1. Read a paper about some model. Start with small papers like digit recognition with MINST. Then move onto things like image recognition, e.t.c. Generally you want to cover basic classification models, image detection models that draw bounding boxes around stuff, and things like auto encoder.
2. Implement the model in Pytorch (or model application, like for example recreate the deepfake face swap with autoencoders). This is going to be the hardest part to grind out, but it gets exponentially easier after you start cause you will realize that a good portion of the stuff is boilerplate code.
3. Load the weights downloaded from the internet
4. Run the model and verify it works.
5. Retrain the model. If you don't want to generate a dataset, you can basically just shuffle up the labels. But you can find different datasets for different models available.
As a cheat, tinygrad repo has some of these implemented in tinygrad, so you can look at the code and reimplement it in pytorch. https://github.com/tinygrad/tinygrad/tree/master/examples https://github.com/tinygrad/tinygrad/tree/master/examples
Then, familiarize yourself with the LLMs. Karpathy Nano GPT is a good start. Then same idea, read->recreate For example, read about flash attention and then try to recreate it.
Also separately, you want to look at Hugging Face Accelerate library and learn how to work with available hardware for both inference and training. I.e try to use all compute resources (CPU/GPU/Disk/Ram) on your box to run stuff.
If you can do all of this, you will be significantly more skilled than a lot of ML people in Big Tech.
As a bonus, you can also explore tinygrad, and how things actually happen on the gpu when you run a model.
- akudha 2y agoThank you so much for the detailed answer. One more question if it is okay - Is there a structured course that you can recommend, from a university? I understand that things are moving fast, but it would be nice to hear from someone who has the knowledge/expertise and gone through the learning phase themselves. I read through a bunch of course descriptions from a handful of leading universities, most of them seem to be interested in riding the hype train by selling certifications to management people for easy money, kinda confusing and disappointing. Thank you again
- ActorNightly 2y agoAgain, its not worth it to do courses. If you just want to memorize patterns and recall them, skip all of the above, and just use chat gpt right now - it can easily generate Pytorch code for you to do things, without you understanding what actually goes on. Its a much better use of time to actually start typing the code yourself if you want to learn.