Ask HN: Help me understand RAG vs. fine tuning for building a coding partner
I also have been closely following gen AI and LLM developments the last few years.
So I had a thought: what if there was a Rails coding assistant, trained on all of the popular books / courses / tutorials / gem documentation / well written open source projects?
I’m imagining something where it’s not even an IDE interface, it starts with some questions about what feature I want to build, then it starts generating the code for me to review, and I can chat it further to refine the code it’s creating for the feature. Then I can test the feature, and if it all works, I can accept the pull request basically, and move on to the next feature.
(Again, ignore the fact that building something like this also requires time commitment. Also for discussion purposes, put aside copyright concerns for a second).
My question: what would be the right architecture for this? Is RAG the best way to load up the tool with the knowledge? Or do I fine tune a model with all of the content? I can’t nail down when to use each method exactly.
I found this project: https://github.com/e-p-armstrong/augmentoolkit which sounds like what I would want to use, but then I see RAGs called out constantly, so I just don’t know.
Bonus question: let’s say I have a $10k budget. Is buying a maxed out Mac Studio a good investment for training and self hosting?
7 comments
[ 3.0 ms ] story [ 31.0 ms ] threadFine tune is good for changing behavior. For example you could create a dataset that makes the model directly output fully formed projects. Using RAG alone would require a bunch of prompt engineering to get the same.
https://platform.openai.com/docs/guides/fine-tuning
“ Fine-tuning for GPT-4 is in an experimental access program - eligible users can request access in the fine-tuning UI when creating a new fine-tuning job.”
You need only have fine-tuned a 3.5 model ime.
Chatting with GPT4 and pasting into your editor code or pasting into a terminal some commands could also help alot.
My ideal scenario is defining features and reviewing proposed code changes accordingly, maybe fixing little things or tweaking it when I see my original idea isn’t really the best fit, etc.
Probably overly ambitious/not fully possible yet. But it seems like a combo of RAG/fine tuning/coding agents can be strung together to invert the software development model entirely.