I'm new to the field of large language models (LLMs) and I'm really interested in learning how to train and use my own models for qualitative analysis. However, I'm not sure where to start or what resources would be most helpful for a complete beginner.
Could anyone provide some guidance and advice on the best way to get started with LLM training and usage? Specifically, I'd appreciate insights on learning resources or tutorials, tips on preparing datasets, common pitfalls or challenges, and any other general advice or words of wisdom for someone just embarking on this journey.
OLlama is so fucking slow. Even with a 16-core overclocked Intel on 64Gb RAM with an Nvidia 3080 10Gb VRAM, using a 22B parameter model, the token generation for a simple haiku takes 20 minutes.
No offense intended, but are you sure it's using your GPU? Twenty minutes is about how long my CPU-locked instance takes to run some 70B parameter models.
On my RTX 3060, I generally get responses in seconds.
Hmmm weird. I have a 4090 / Ryzen 5800X3D and 64GB and it runs really well. Admittedly it's the 8B model because the intermediate sizes aren't out yet and 70B simply won't fly on a single GPU.
But it really screams. Much faster than I can read. PS: Ollama is just llama.cpp under the hood.
Edit: Ah, wait, I know what's going wrong here. The 22B parameter model is probably too big for your VRAM. Then it gets extremely slow yes.
How much do you know about natural language processing? If you aren’t already familiar, you’ll probably want to start with some basics like tokenizing, lemmatizing, stemming, identifying stop words, determining parts of speech, spell checking, and vectorizing. Putting together a clean normalized training set will require some or most of these, and it should help give you some context of what you’re putting in.
I’m most familiar with python’s natural language toolkit for most of those, sklearn does also have some text tools (vectorizer for sure), or you could jump right into keras/tensorflow.
After that, look into the concept of transformer models - this tutorial does cover some of the basic cleanup steps, although I’d still want to understand them better than just copy pasting their code/regexes:
Good recommendations! I'd suggest doing some spacy tutorials as well, regarding the topics in the first paragraph. But arguably it's possible nowadays to just start at transformers without any NLP knowledge, e.g. using huggingface's AutoTrain or something similar. I wouldn't recommend it, but you definitely could.
I'm also interested, so I hope you don't mind me joining the ride. Personally, I'd like a self hosted tool, but am happy to see what the community says.
If you just want to use a local llm, using something like gpt4all is probably the easiest. Oobabooga or llama.cpp for a more advanced route.
I use ollama with llama3 on my macbook with open-webui and it works real nice. Mistral7b is another one I like. On my PC I have been using oobabooga with models I get from huggingface and I use it as an api for hobby projects.
I have never trained models, I don't have the vram. My GPU is pretty old so I just use these for random gamedev and webdev projects and for messing around with RP in sillytavern.
I managed to get ollama running through Docker easily. It's by far the least painful of the options I tried, and I just make requests to the API it exposes. You can also give it GPU resources through Docker if you want to, and there's a CLI tool for a quick chat interface if you want to play with that. I can get LLAMA 3 (8B) running on my 3070 without issues.
Training a LLM is very difficult and expensive. I don't think it's a good place for anyone to start. Many of the popular models (LLAMA, GPT, etc) are astronomically expensive to train and require and ungodly number of resources.
Month later update: This is the route I've gone down. I've used WSL to get Ollama and WebopenUI to work and started playing around with document analysis using Llama 3. I'm going to try a few other models and see what the same document outputs now. Prompting the model to chat with the documents is...a learning experience, but I'm at the point where I can get it to spit out quotes and provide evidence for it's interpretation, at least in Llama3. Super fascinating stuff.
I really appreciate all the responses, but I'm overwhelmed by the amount of information and possible starting points. Could I ask you to explain or reference learning content that talks to me like I'm a curious five year old?