by gdiamos · 2y ago · 0 comments
I think many users get put off it because just pushing a button doesn’t work and the whole thing seems like a black box that you don’t know how to fix when it breaks.
It turns out that finetuning can be debugged, but the methods aren’t well documented (yet), eg by generating q/a, oversampling them, etc
When you get it to work it’s powerful - new abilities emerge beyond memorization.
Just like how llama2/claude2/gpt4 learned reasoning by memorizing sentences from Reddit posts :P
Also, I don’t get the comparison of rag vs finetuning in articles like this - why not do both. RAG is easy to setup - it’s push button. Just do it on all models (including finetuned models).
> Also, I don’t get the comparison of rag vs finetuning in articles like this - why not do both
It's interesting you say this because we are very close to adding RAG support to Helix sessions and it will be "both at the same time" not an "either or" setup. You can choose to do either or but we are interested in seeing if doing both at the same time yields better results than either or - watch this space!
disclaimer: I work on Helix
I'm interested to hear about push-button solutions for RAG that aren't a SaaS.
You can implement RAG in 80 lines of python and 0 SaaS libraries.
It's extremely easy.
1. Load your data as a giant string (streaming)
2. Chunk it (big chunk size, small chunk steps)
3. Call an LLM to convert chunk -> embedding, store in an index (or just concat it onto a numpy array)
4. Call an LLM to convert query -> embedding
5. Compute cosine similarity between the embeddings, pick the max
6. Insert the picked chunks into the LLM prompt
That's it. I'd encourage you to try to implement it yourself.
Anything beyond this is unnecessary complexity.
I walk through the code/whiteboard of the whole thing in this video: https://www.youtube.com/watch?v=Xkzd_YNbWmc&t=6003s