How can I teach new knowledge?

I want to give a list of text documents to the API and give its answers with the information it learned from this list.

How can I teach?

1 Like

You can do this either through fine-tuning the model or RAG.

2 Likes

Is there any documentation available on how this can be done ?

1 Like

For RAG you have a few options, but the easiest thing to do would be to use the Assistants API.

You can read the documentation for using retrieval here.

RAG stands for Retrieval Augmented Generation, essentially it allows you to add some additional context/information to the model. The big issue here is the quality and completeness of the text documents.

As a general rule of thumb, if a random human couldn’t perform the task or provide the output you want with the context you give the model won’t be able to either.

1 Like

RAG and Assistants API are probably best for this approach. It means parts from your documents are automatically appended to documents. The model itself stays unchanged.

Please note that “adding knowledge” is not mentioned in finetuning guide. That is because OpenAI does not allow changing the “rank” hyperparameter while training so it is likely low-rank finetuning only. OpenAI’s finetuning is useful for structure and style. High rank finetuning, such as on your own high end hardware, can add knowledge but I think of it is adding ability to “reason” within your own dataset’s capabilities. It is still useful to use RAG to reduce chance of hallucinations and use up-to-date information.