7
$\begingroup$

I recently heard an interesting comment from a gentleman on YouTube and it made sense instantly.

To paraphrase he explained that "fine-tuning" an LM is not necessarily adding knowledge to a model - it is rather teaching that model to do or suggest things in the style of the fine-tuning data.

So then my question is what if one does not want to change the model too much - just wants to make a model aware of a new set of data i.e.: a companies internal domain knowledge? Is there a recommended strategy?

Edit: My thought is some sort of distillation where you train a smaller or same model against itself - plus the additional data.

$\endgroup$
2
  • 1
    $\begingroup$ They are tunable. Try treating them like a machine learner (they are) and augmenting their training. Remember that in moving toward your stuff, they likely move away from their center, whatever that is. youtube.com/watch?v=8ZW1E017VEc&t=2112s $\endgroup$ Commented May 22, 2023 at 20:25
  • 1
    $\begingroup$ @EngrStudent That's a great interview. I has started it a while back. $\endgroup$
    – Edv Beq
    Commented May 22, 2023 at 22:06

3 Answers 3

4
$\begingroup$

Have a look at llamaindex or langchain for information injection in the prompt of the LLM: https://docs.llamaindex.ai/en/latest/index.html

This retrieve-augment-generate (RAG) works without Finetuning/prolonged pre-training but comes with the cost of having to pay for the additional tokens in your "pre-promt" which is where you inject your new information

Also note that

  1. pretraining or fine-tuning modifies the parameters $\theta$ of your neural net $f_\theta(x)$.
  2. RAG on the other hand improves/modifies the input $x$ supplied to your model.
$\endgroup$
2
  • $\begingroup$ Are you taking about pre-prompts - and isn't that limited to max tokens which is not a lot currently? $\endgroup$
    – Edv Beq
    Commented May 25, 2023 at 13:00
  • $\begingroup$ Yes it is pre-promts and yes those are limited to max_tokens. If the rumours are true, for gpt4 we have 32000 max_tokens when they finally release it fully. This would be ~ 64000 words. This is more than many books have. Still it would be costly but Moore's law is with us, so costs per token will only drop! $\endgroup$
    – Ggjj11
    Commented May 25, 2023 at 17:51
7
$\begingroup$

From LIMA: Less Is More for Alignment (2023) by Chunting Zhou et al.:

These results strongly suggest that almost all knowledge in large language models is learned during pretraining, and only limited instruction tuning data is necessary to teach models to produce high quality output.

From Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations? (2024) by Zorik GekhmanGal YonaRoee AharoniMatan EyalAmir FederRoi ReichartJonathan Herzig:

When large language models are aligned via supervised fine-tuning, they may encounter new factual information that was not acquired through pre-training. It is often conjectured that this can teach the model the behavior of hallucinating factually incorrect responses, as the model is trained to generate facts that are not grounded in its pre-existing knowledge. In this work, we study the impact of such exposure to new knowledge on the capability of the fine-tuned model to utilize its pre-existing knowledge. Our results highlight the risk in introducing new factual knowledge through fine-tuning, and support the view that large language models mostly acquire factual knowledge through pre-training, whereas fine-tuning teaches them to use it more efficiently.

Remains prolonged pre-training and adding information in the prompt, as Ggjj11 suggested.

$\endgroup$
4
$\begingroup$

The common way is through providing a context to a prompt. GPT type of bots' APIs allow for providing large amount of text for a context, e.g. 64K in a bot that I use. Also look up retrieval-augmented generation (RAG).

The way I use this in my teaching is by supplying the text of my slides and lecture notes to the bot when conversing with it. So that a bot can use the context to come up with better answers than a general bot.

$\endgroup$
1
  • $\begingroup$ Just curious if the large context is only available through api calls. I use ChatGpt and the UI does not allow very many words. Or perhaps, the large context is only allowed through system chat through the api as well. $\endgroup$
    – Edv Beq
    Commented Aug 11, 2023 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.