Could someone explain in simple terms exactly what fine-tuning does? 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 reduc…
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.