I have created a fine tuning job based on the example given in open ai a sarcastic factual chat. I uploaded the training data, created a fine tuning job out of that data and even the status of job is succeeded. Now when I am prompting my questions including the generated model id I am observing unexpected responses here is the code
const testCheck = await axios.post(https://api.openai.com/v1/chat/completions
, {
messages: [{
“role”: “system”, “content”: “Marv is a factual chatbot that is also sarcastic.”
},
{
“role”: “user”, “content”: “What’s your name?”
}],
model: “ft:gpt-3.5-turbo-0125:personal::99SFj6yL”,
temperature: 0.5
},
{
headers: {
‘Authorization’: Bearer ${process.env.OPEN_AI_KEY}
,
‘Content-Type’: ‘application/json’
}
}
);
Note acc to training data this should be the response
My name is marv now will you make my aadhaar card out of it.
Last I also removed role assistant from message array and directly gave the user still I am not getting any similar fine tuned result
1 Like
Hi @kzainul22 and welcome to the Forum!
It sounds from your description that you were trying to use fine-tuning for Q&A type of tasks. Note that this is not what fine-tuning is used for. Therefore, what you are experiencing is not unusual behavior.
In the example in the OpenAI documentation about Marv the chatbot, the fine-tuning is used to get the model to respond in a certain style, i.e. sarcastic. The answers to the questions themselves, e.g. capital of France, author of Romeo & Juliet, are derived from the model’s general knowledge it was trained on, not the fine-tuning process.
Here you can find more details about when fine-tuning is a suitable solution.
Feel free to share more details about what you are trying to accomplish and we can try to point you in the right direction.
3 Likes
Thanks for your reply. I’m working on a project where users upload PDF documents, and an AI system predicts specific outcomes based on the document data. To do this, I convert the PDFs into text and feed that data to the AI. However, I encountered issues with unstructured responses from the AI, including irrelevant comments like “//more data here…” This makes it challenging to apply further logic, especially with longer documents spanning 8 to 10 pages. To address this, I aim to train the AI with specific prompts and expected responses. Before implementing it in my main project, I’m fine-tuning the AI using a sarcastic chatbot, but the responses don’t match the prompts from my training data. Can you guide me how can I achieve my goal?
2 Likes
Thank you for clarifying.
A couple of follow-up questions:
Is this about the style of responses or the content of the responses?
Are these always different PDFs that are uploaded or is it a fixed set of PDFs?
2 Likes
Yeah so about the first follow up question I want style to be in structured key value json format. Of course values can change but I want to hardcode the keys.
And about the second follow up pdf is a financial document so different people will have different pdfs and some naming convention can differ for example there is a bank A where its written paid in and paid out while there is a bank B money in and money out you see meaning is same but words are different. So you see I can ask ai to list all the transactions made in this month. And ai have to return the result of all the transaction in key value json format.
1 Like
ok, so it sounds to me like the main challgenge is to ensure that your assistant’s response adheres to the pre-defined JSON format. This could indeed be achieved through fine-tuning.
For the training data set I would include examples that consist of (1) a system message that describes the purpose of your assistant and the nature of responses including a general description of the required structure of the JSON object that it should return, (2) the user message which comprises the PDF content along with any additional user specific query, and (3) the assistant response message which would consist of the JSON in the required format with the specific values from the PDF.
2 Likes