Fine-Tuning / Training AI

Our platform uses OpenAI's newest AI model (GPT-4o), which is a great AI system with comprehensive intelligence across a wide variety of knowledge domains. However, it doesn't understand more niche topics, and it often has only a superficial knowledge of certain topics.

If you find that the AI is not understanding questions well, perhaps because you are in a niche industry or rely on proprietary knowledge, you can utilize the Fine-Tuning feature to significantly improve the AI's understanding and how it serves you.

Fine-Tuning is a service provided by OpenAI that allows you to tweak what the AI "thinks about" as it parses your questions and instructions. For example, if by default when a question uses a term like "facility" but in your organization that is referring to a credit line, not a building, you can help it understand this by reinforcing the association between questions that mention facility and related financial responses. Sometimes the corrections are more subtle, for example when a term takes on new meaning based on recent news in the industry. Again, you can reinforce appropriate associations to help it better answer any related queries. You do this through a process of training by guiding the answers towards the correct response.

In all cases, though, fine-tuning can help the AI better understand queries - which includes end-user questions through search, answering tickets, creating quizzes, creating policies, mitigating risks, finding evidence for compliance initiatives and much more.

Fine-Tuning Process

The basic process of fine-tuning starts with creating search tests, as follows:

  1. Create Search Tests for questions you know are being incorrectly answered.
  2. Add "Guidance Text" to those questions to help guide it towards the correct answer. For example, your guidance text could be "Facility here likely refers to a credit line".
  3. Once you have the correct answer, you can add automated question variations to reinforce that connection.

You then go to the Fine Tuning area, which you'll find under AI Options. Tip: you can get back to AI Options at any time by clicking the "AI Options" link at the top in the navigator:


So once you're on AI Options, click the Fine-Tuning / Training tab at the bottom, and click "+" on the right hand side to create that entry:

On that form you'll see a few options where you can configure which model you wish to fine-tune. (eg. gpt-4o-mini-2024-07-18 or gpt-4o-2024-08-06). You may also need to enter in custom end-points if you're using Azure. Once you click OK, continue with the following steps:

  1. Click "Create Training File". This will collect together all of the questions and answers in your search tests (leaving out the guidance text, which trains it to assume your guidance when seeing such a question). From this it'll create a "training file". You'll need at least 10 questions to get started. The more training data, the more effectively it works.
  2. Then click "Start Training". This will upload the training file to OpenAI's Fine Tuning service.
  3. Then periodically click "Get Fine Tunes" to see the status of your fine-tune job. The training process can take anywhere from 5 minutes to an hour or more, depending on the complexity.
  4. Once it completes successfully, it'll output the name of the fine-tuned model. You can then use this model name in place of the usual model you set up in Enhanced AI to use it across the system.
  5. You can then go back to your Search Tests, and there'll be a new button: "Test Fine-Tuned". Click this and it will pose the same question, without the guidance text, to the fine-tuned model that just completed. This way you can check the response to make sure it works, or if you need to go back and refine your training data.

Please note, check with OpenAI to find the latest pricing for both training and using fine-tuned models. You assume all costs associated with using OpenAI's service.

Guidance Text

When constructing the guidance text, keep in mind that what you are providing should not be just instructions, but should instead more subtly encourage the AI to consider different aspects of the question so that it arrives at the desired response indirectly. By generalizing the guidance in this way, it will more effectively learn how that guidance should be applied to a much broader set of questions than the one specified.

For example, instead of saying "The output should mention XYZ", put "Consider that X often relates to Y and this fact may impact how you evaluate X in your response".

Question Variations

Based on the importance of getting a particular question correct, you can add variations to that question. This is automated through a button on the search test called "Add Question Variations". Here you can select the number of question variations to add, which it will do underneath the search test. The variations will be generated by AI. It will pose that question with the same guidance text you have in the main search test.

Having these variations can help reinforce specific responses to a more general line of questioning, guided by your guidance text. When training AI, the more you repeat a question and answer, the more it will retain that information and change the weighting of the model to reinforce that association. By having variations of the question and answer, it trains the AI to generalize its knowledge, similar to the technique known as  Reinforcement Learning from Human Feedback. 

In our testing, we found that 5 variations is often enough to teach it effectively for most questions. If the response is significantly contradictory to its standard training, you may need to add more variations to emphasize that new understanding.

Note: if you update the search test question or guidance text, you will need to regenerate the question variations by clicking the button again. It won't do this automatically.

It can be worth investing some time in correctly fine-tuning your own trained model, as that same model can then automatically enhance all the other processing that uses AI throughout the system.


Next Topic:
v6.0.0.14101
Up Since 11/15/2024 2:42:47 PM