Question around fine tuning

hey all,

Quick q around fine tuning, I’ve fine tuned a model with a jsonl file that looks like this:

{“prompt”:“Listing: Spacious 2-bedroom apartment in a pet-friendly building. Close to public transportation and shopping.\nAnswer:”, “completion”: " yes"}
{“prompt”:“Listing: Cozy 1-bedroom condo with a balcony and city views. Close to restaurants and nightlife.\nAnswer:”, “completion”: " yes"}
{“prompt”:“Listing: 2-bedroom apartment for rent to female tenants only.\nAnswer:”, “completion”: " no"}
{“prompt”:“Listing: Ideal for young professionals or students. no families or children.\nAnswer:”, “completion”: " no"}

Note I have roughly 200 of these with a short description and a competition. When I use the playground to test my model with a short description the model works great. Now what I don’t understand when I have a longer description that contains some wording from the short description the completion returns the wrong response.

Do I need to fine tune with my long description prompt and completion? Essentially I was looking to fine tune with my short descriptions with the idea that the model would then understand my long description. Unclear what I’m missing here. TIA!

Essentially you have created a 1-token categorizer. What temp are you running?

Also, not sure what the logic is here. Just say ‘no’ to unwanted or unreasonable things, and yes to everything else?

as always thank you @curt.kennedy. Essentially I’m trying to fine tune a model to understand a specific laws around what you can and can not say in a real estate listing hence the completion of yes and no, with the ultimate goal of a fine tuned model to understand an actual real estate listing and replying with Yes or No if it breaks the law or not.

I’m using a temperature of 0. Let me know if that help.

OK, sounds like you need more training data. For this kind of stuff, I have used Babbage with 4000 examples.

Keep your temperature at 0. And be sure to include your stopping “\nAnswer:” when you send the request. I use ‘\n\n###\n\n’ for this, but whatever.

Interesting, thanks! curious how you came to that conclusion for your work? Reading the fine tuning documentation "classification, we recommend you try one of the faster and cheaper models, such as ada "

Just to solidfy my use case, looking to provide prompt/completion such as:

PROMPT: Listing: 2-bedroom apartment in a building that does not allow families, children, or roommates.
Answer: No

End Goal for it classify longer descriptions such as:
Listing: Welcome to your new home! This spacious 2-bedroom apartment is perfect for those who value space and privacy. The unit features a modern layout with high-end finishes and over 1,000 square feet of living space. The bedrooms are generously sized, with plenty of room for a queen-sized bed and additional furniture. The kitchen includes stainless steel appliances, granite countertops, and ample cabinet space for storage. The building is strictly for single individuals or couples only, and does not allow families, children, or roommates, ensuring a peaceful and comfortable living environment for all. With a prime location near all the amenities, this apartment is perfect for those who value convenience and privacy. Contact us today to schedule a viewing!
Answer: No

What you could try is feeding it each sentence. Which you are going to trip on the bold part “strictly for single individuals or couples only”. So the output of each sentence in your paragraph is 0, 0, 0, 0, 0, 1, 0, 0, 0.

Since there is one “1” or in your case, “no”, you flag it as inappropriate.

The reason this works better is that by providing the AI more and more context of essentially OK stuff with only a little nugget of bad will confuse it. You are adding in noise.

So increase the SNR of the signal by locking down to one sentence at a time and flag when you see the bad…

This obviously increases the number of calls to the API, but the cost is the same and you removed the noise clutter (but latency is higher)

So you need to refactor and train on single yes/no sentences, and for-loop over each sentence to achieve what you want. Then trip the alarm if you see a single “no” on any sentence.

Otherwise, you are fighting an uphill battle with noise, especially as the descriptions get longer.

ah great idea! thank you so much again, you are truly invaluable to this community!

1 Like