I initially also thought this would be one of the best use cases for fine-tuning (teaching the model new data), but I've seen quite a few people say fine-tuning should not be used to teach the model new data, but more like new formatting and style of response. This blog post seems to concur.
I do wonder how OpenAI does fine-tuning. I'm guessing it doesn't use Lora.
Fine-tuning shows the model examples of sequences it should produce. The model is updated to become more likely to produce sequences like those examples. What precisely 'like those examples' means for brand new prompts unlike those in the training distribution is the black magic of generalization.
>Does it show the model how to answer questions, or does it give it new information, or both?
It can be used to teach style, or information, or both.
>Is there a way to restrict answers to the fine-tuned data?
There is no foolproof way to restrict answers to fine-tuned data. You might be able to approach decent performance if you show it examples of refusing on all topics not related to X.
>For example, if one would want to use an LLM to answer questions regarding a large, private knowledge base, would it make sense to fine-tune a model on this knowledge base?
Short answer: I wouldn't recommend fine-tuning. Long answer: it depends on your task, your expertise, and your tolerance for collecting large datasets and iterating. I generally recommend retrieval. Putting info in the input has a few advantages over fine-tuning: you can check where information is coming from, and it's easier for the model to answer without hallucinating (akin to a student taking a test with open notes they can refer to, rather than trying to remember a textbook they read a week ago). Retrieval is best at lookup type questions and is worse at questions requiring comparisons or mixing of many pieces of source data; possible fine-tuning has some edge there.
> I generally recommend retrieval
Yes that's what everyone's saying and it's also what we're working on. I was wondering what fine-tuning may be used for. Are there use cases where fine-tuning might be worth it (esp; given all the hard work it entails)?
> akin to a student taking a test with open notes they can refer to, rather than trying to remember a textbook they read a week ago
Excellent analogy! Thanks!
No, it does not. Language models are not for storing or accessing data, as you have noticed when you refer to hallucination. If you wish to store and access data, use embeddings + a vector database. Fine tuning is for changing what kind of language the model generates. For example, if you want an AI that writes like a journalist you fine tune it on newspaper articles. If you want an AI that writes reviews, you fine tune it on reviews. And so on.
And yes your use case of a large private knowledge base is one of the prime examples she used in the course. Scenarios that are domain-specific or privacy conscious probably makes more sense for finetuning as opposed to prompting.
So in short - I think it's not appropriate for answering questions about a large private knowledge base and GG/RAG is better suited. (if you're interested, I wrote a blog article about this recently: https://vectara.com/fine-tuning-vs-grounded-generation/)
Does it show the model how to answer questions, or does it give it new information, or both? Is there a way to restrict answers to the fine-tuned data?
For example, if one would want to use an LLM to answer questions regarding a large, private knowledge base, would it make sense to fine-tune a model on this knowledge base?
If yes, how does one reduce hallucination? And would that perform better than feeding possible source documents as part of the prompt every time?