anuaralfetahe

anuaralfetahe

Preparing Data for OpenAI Fine-tuning

I have been tasked with fine-tuning an OpenAI model using our customer data, which primarily originates from a Drupal website. The data includes various types of information, such as news articles, blog posts, service descriptions, and more.

Extracting the data is relatively straightforward, but preparing it for fine-tuning is proving to be more challenging. OpenAI expects the data to be in the following format:

[
  {
    "prompt": "Question or context",
    "completion": "Desired response"
  }
]

Are there any tools I can use to transform the data into this format? I would particularly prefer an Elixir-based tool, if one exists. However, I’m open to suggestions for other tools or services that can help with this task.

I’ve considered using the OpenAI API to generate questions and answers based on the provided data, but I’m concerned this approach could become quite expensive.

Additionally, the data will likely need some preprocessing and normalization, as much of it is wrapped in HTML.

I’m new to this field and would appreciate any advice or recommendations on how to approach this problem.

Most Liked

jswny

jswny

Are you sure you want to fine tune here?

Can you provide some context around what kind of customer data you have and examples of what you’d like the model to do?

It sounds like its possible this may be a better fit for RAG, where you provide a way for a model to grab information that it thinks is relevant by providing it a function to do so, and using a vector db to find the relevant documents, data, etc.

If you want to go with fine tuning, you are going to have to do a lot of work to get the loose data in a question → completion format. If you just want to provide the model with the data required to answer questions, RAG might be a better fit.

Last Post!

anuaralfetahe

anuaralfetahe

Our customer is an energy provider. They sell liquid fuels, offer electric chargers, and provide electricity packages to their customers.

They have implemented a chat bot integrated with OpenAI to reduce the workload on customer support. Their clients can ask questions about contracts and services provided. For example: “What is the closest gas station to me with an electric charger that has a Type 2 connector?”

All this information is stored in a database and modeled as entities.
So far, we have created a separate entity storage system to hold structured datasets, which are maintained by the site editors. These datasets are categorized.

Each time a user asks the chat bot a question, we first categorize the query and then select the appropriate datasets associated with it. This dataset is then sent to OpenAI as context which helps the model generate more accurate response for the user.

Our goal is to leverage all the data stored in the system, structure it properly, and fine-tune the model with it.

So far, I have manually fine-tuned the model and observed improvements in the generated answers, even without sending any additional context.

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement