Fine-tuning 3.5 turbo to act as conversational AI like Non-Playable Character in games

I am an educator, who is trying to use OpenAI to create conversational AI like NPCs in games.

I created such a training dataset (too long to paste everything, so I pasted like half) (total 21 rows of training data):

{"messages": [{"role": "system", "content": "You are Sally, a friendly Customer Service Officer (CSO) at Starmall. Your primary job is to assist customers in the Rental Application process for Starmall’s industrial space solutions."}, {"role": "user", "content": "Who are you?"}, {"role": "assistant", "content": "Hi, my name is Sally, and I am a Customer Service Officer at Starmall."}]}
{"messages": [{"role": "user", "content": "What is your job?"}, {"role": "assistant", "content": "My primary job is to assist customers in the Rental Application process for Starmall’s industrial space solutions."}]}
{"messages": [{"role": "user", "content": "What kind of a company is Starmall?"}, {"role": "assistant", "content": "Starmall is renowned for its industrial parks and has several developments in the western region of Singapore. StarMall markets a variety of industrial spaces such as warehouses, flatted factories and ramp-up factories for rental to light-industry players."}]}
{"messages": [{"role": "user", "content": "Can you describe how a typical rental application process is carried out?"}, {"role": "assistant", "content": "Sure thing! My work starts at 8:30am, and ends at 5:30pm, on weekdays. If there are walk-in customers requesting to rent Starmall's industrial spaces, I will check their requirements first. I will help to fill up a rental application form also. Then I'll get the Marketing Officer (MO) to meet the customers. Lastly, I'll help to collect a booking fee."}]}
{"messages": [{"role": "user", "content": "How many walk-in customers do you serve a day?"}, {"role": "assistant", "content": "On average, I serve about 25 customers a day."}]}
{"messages": [{"role": "user", "content": "What kind of rental requirements do you gather from prospective customers?"}, {"role": "assistant", "content": "I will gather requirements like the type of industrial space, the rental floor size, and the usage purpose."}]}
{"messages": [{"role": "user", "content": "What is the next step after gathering rental requirements?"}, {"role": "assistant", "content": "After helping customers to fill up the rental application form, I'll pass it to our Office Dispatcher (OD) to deliver to our Marketing Officer (MO) at the 10th floor."}]}

Once the fine-tuning is done, I went to the Playground to test it, and this is the answer to one particular question:

User: Walk me through the Rental Application process

Assistant:
Sure, let me take you through the steps of the Rental Application process at Starmall.

Step 1: Enquiry
Customers can enquire about our industrial spaces through various channels, such as our website, hotline, or visiting our sales gallery. They can view the available spaces and ask any questions they may have.

Step 2: Site Visit
If customers are interested in a particular industrial space, they can arrange for a site visit to get a better understanding of the space and its features. Our sales team will be available on-site to assist and answer any queries.

Step 3: Rental Application
Once customers have chosen a specific space, they can proceed to submit a Rental Application. They will need to fill in an application form, provide necessary documents, and pay a refundable deposit.

Step 4: Verification and Evaluation
Upon receiving the Rental Application, our leasing team will review the information and documents provided. They will conduct necessary checks and due diligence for the space and the applicant.

Step 5: Letter of Offer
If the application is successful, customers will receive a Letter of Offer from our leasing team. The letter will include the terms and conditions of the lease, such as rental rates, lease duration, and other relevant details.

Step 6: Documentation and Payments
Customers will need to sign the Letter of Offer and submit the necessary documentation, such as identification and business registration documents

The problem is that the answer created a lot of information that I did not provide, and at the same time, didn’t use key information that I want it to say e.g. about the Marketing Officer and the Office Dispatcher’s role in the business process.

Some questions I have:

  1. What can I do to make sure the fine-tuned model mentions such things, rather than invent information not included?

  2. I have a feeling that 21 rows of training data is not good enough… Any advice on how I could craft more rows of training data for this fictitious Customer Service Officer? But I want the business process described to be direct and clean…

  3. Does anybody has suggestions / experiences to share when using OpenAI for such use cases? I know the following 2 websites at least is trying to provide such a service: https://inworld.ai/, https://www.convai.com/, but I want to have more control over the AI (and decrease cost also).

  1. What was the temperature that you are using for your generation ? Higher temperature and higher values of max tokens often lead to the generations being verbose

  2. By OpenAI’s documentation, 10 is the minimum values that is required, though they also mention that the performance improves for every 2X in size till a certain limit. For my use, I used a sample like you have write now and got ChatGPT to generate similar cases for me.

By verifying what ChatGPT had generated, I was able to increase my training set (25-> 45)and my performance definitely improved.

Welcome to the OpenAI community @cookiemo

For factual QnA. embeddings is the go-to approach.

Fine-tuning is useful when you want to refine the way a model responds. In OpenAI own words:

Some common use cases where fine-tuning can improve results:

  • Setting the style, tone, format, or other qualitative aspects
  • Improving reliability at producing a desired output
  • Correcting failures to follow complex prompts
  • Handling many edge cases in specific ways
  • Performing a new skill or task that’s hard to articulate in a prompt
1 Like

You can try these solutions:

Otherwise embeddings are the way to go as @sps pointed out.
You may even be able to cut down costs and get faster responses by using a standard model with embeddings.

Thanks a lot for directing me to embeddings!

I’m now trying out some tutorials on YouTube. Seems like it is possible to use either OpenAI or HuggingFace API (free but much much slower) for embeddings, and Pinecone for persistent vector storage, and lastly some LLM like OpenAI for natural language answering.

Hope I can get the app to work.

Thanks anyway!

1 Like