Train a GPT model in my tone

For any model that uses the ChatCompletion endpoint with ChatML format, there are 3 options for roles as of now: user, assistant, and system.

The system role is usually used as start-up instructions to set the environment. I also use it for context delivery & as a reminder of instructions such as “Don’t acknowledge this message”.

3 Likes

Excellent. It’s like script-level environment variables for chat apps. Very cool. Thx.

2 Likes

Hi, I would approach this by

  1. converting as much as possible of your text snippets into a neutral (information only) tone, sort of stripping your language style. This would give you the “common style denominator” format.
  2. Train a model to convert text from this “common style denominator” back to your style language.

Then when you need to “translate” style from one person to yours, you do it in two steps:

  1. You convert their text to neutral style first to keep the information only.
  2. You use your model to convert the neutral text into your tone.

Why? This way you avoid all the issues of the original tone messing up with your tone during the translation. And also it is easier to train a general model to strip style from any narrator to a common neutral style and then convert it to a specific tone, than training models to do conversion between many possible pairs of styles…

Let me know how it goes, interested in results.

As for the chat bot - make sure you understand the concept of fact embedding / retrieval (check my previous posts for details).

1 Like

Thanks @sergeliatko for the insight. This is a lot of unpack, mind providing an example of these setups? TIA

Give me an average sample (better 3 of those) of text in “your tone”.

“Hey Jone Doe, hope all is well, you helped us few years ago with a few electrical jobs… reaching out again as we are looking to get a setup for one of those portable generators. Wondering if you do that type of work?”

“Hey Victoria. We are actually going to cancel our services with you. Honestly, the cleaning that was done last time was not good quality… even without the good vacuum a lot was missed…thank you for you time”

“Hey Jone, I was doing laundry last night. I opened the washer mid cycle to add a shirt and sparks shot out of the side. Smelled burnt but no markings. Can we have it looked at just to verify it’s safe? Also, thought process led me to look and couldn’t find a fire extinguisher. If I’m missing it let me know, if not I’ll get one so one is in the apartment. Feel free to call if you want any further details or have questions”

These are random message from my iMessage. Let me know if helps

Check this in the playground, paste any text of yours and hit the “submit” button. It will rewrite your text in “neutral style”.

Then the fine tune .jsonl file for you would be formatted like this:

{“prompt”:“<|startoftext|>HERE_GOES_THE_NO_STYLE_TEXT<|endoftext|><|startbrandedtext|>”,“completion”:" HERE_GOES_YOUR_ORIGINAL_TEXT<|endoftext|>"}

So it will be:

{“prompt”:“<|startoftext|>I understand. Thank you for the assistance, @RonaldGRuckus.<|endoftext|><|startbrandedtext|>”,“completion”:" ah I see @RonaldGRuckus thanks for the help<|endoftext|>“}
{“prompt”:”<|startoftext|>thanks @bill.french can you give me an example of what you mean by\n" create a corpus of content that reflects your tone, your expertise, and the knowledge you hope to convey in such conversations."<|endoftext|><|startbrandedtext|>“,“completion”:” Thank you, @bill.french. Could you provide an example of what you mean by "create a corpus of content that reflects your tone, your expertise, and the knowledge you hope to convey in such conversations."<|endoftext|>"}

And so on separating each pair by a new line

3 Likes

Here follow the no style sample from the playground:

Hello Jone Doe, I hope you are doing well. You provided assistance with some electrical jobs a few years ago and I am reaching out again regarding a setup for one of those portable generators. Do you offer this type of service?

Hello Victoria. We have decided to cancel our services. Unfortunately, the cleaning that was done last time did not meet our expectations. Even without the use of a good vacuum, there were still areas that were missed. Thank you for your time.

Hello Jone, I was doing laundry last night and sparks shot out of the side of the washer when I opened it mid-cycle to add a shirt. It smelled burnt but there were no markings. Could we have it inspected to ensure it is safe? Additionally, I could not locate a fire extinguisher. If I am missing one, please let me know. Otherwise, I will purchase one for the apartment. Please do not hesitate to call if you need more information or have any questions.

Basically your goal is to use the playground link I gave you or API to generate as many samples as you can (at least 400). Then use the no style text paired with original text to generate the jsonl file for fine tuning a model to rewrite no style texts into your voice.

If you do not feel comfortable with API, it’s better/faster/cheaper to hire someone.

The bot is a whole different story… Need more details on what you need it do and how you’ll be using it to say anything meaningful on the subject.

BTW I’m the tech guy here: https://www.techspokes.com

This is very cool. Had never considered the complexities of building a multi tone bot.

I recommended a straight line from the stated requirement to something that probably works. I like to start simple.

Originally the concept comes from our research on enforcing the brand voice in generated texts. The “no style” is used as an inert buffer between the source text and the brand styled text. This way we reduce the source style influence on the final text.

As a result you can use what ever input (from a standard chat bot or writing assistant) and style it to your brand with a simple “conversion” extra step. Way cheaper and simpler on a long run than complicated fine tuning to a tone. And voices become like skins you put on the text before the output…

2 Likes

Smart. Very helpful. It’s similar to separating content from presentation rendering. In doing so, your content becomes more agile and over time, you can repurpose at a far lower cost.

Straight-line implementations tend to be tactical, while strategic engineering will pay huge dividends.

3 Likes

Yes… Another benefit, you can use similar approach to shorten the text, not to the bullet points, but rather a thought / logic flow, stripping all unnecessary noise from it. Then you can reconstruct it back to any style with any degree of “decoration” you want by adding one or two simple “decompress” steps. And those texts in most cases pass the AI detection tools (at least the ones I tested).

1 Like

Great idea, never even considered something like that myself.

Thanks for sharing!

You welcome. Feel free to ask if you have some “complicated” questions.

Not at all.

If I understand correctly, I could see a huge market of this kind of data for people to spin with their personality to create unique content

2 Likes

But there are not really two people. @chirag.shah285 wants to build a chatbot so they just want the chatbot to use their tone.

Your technique is extremely cool and useful but perhaps overkill for this use-case?

1 Like

Thank you @sergeliatko for your thoughts on creating a model with a certain “personality”. I was struggling on how to do this, and the main reason was that I was puzzled is that I went about it wrong. My basic thought was training it on a back and forth “interview” of data. But there, I am not training tone or personality, I am training a poor Q/A bot. And poor because Q/A really needs to use embeddings.

So with your personality training strategy by using a neutralizer on the original text, and create a fine-tune on the inverse of this is what I was missing. This makes sense conceptually since your fine-tune only is trained on the tone and personality.

3 Likes

Thanks. Maybe you’re right. My reasoning for this is following:

1 the cost and effort to implement this “tone skin” possibility is relatively cheap and easy
2 the feature in itself allows a fair abstraction between the output content and it’s form, leaving you the possibility to “switch” brand tone later on without modifying the core bot functionality/training.
3 the two points above contribute to the ability to sell the business (and the bot) easier to a different brand that can change the tone of they need…

For several hundreds of dollars ( les than 100 for training, + extra cost of conversions in use) this adds tens of thousands of dollars to the value of the business.

As for “person” vs “bot” personality, maybe the term I used is not the most precise, but you get the idea.

1 Like

I wrote about this recently.

Creating a style guide to use in GPT Prompts

If you give it a reasonably sized sample - I just used one article - then it can generate a “style guide” that you can use in subsequent new prompts.

You can tweak the style guide as you see fit.

Stephen

1 Like