Paraphrasing prompt

Hi, my use-case is to paraphrase an input sentence (change the wording and keep the meaning as much as possible).

I am trying to use curie text (not sure if it is the best option?).

I try to give few-shot examples with the hope to get better results.

But my prompt below is not working well, the order of samples and the instruction could be wrong?

You feedback would be great.

Thanks.

Paraphrase the following sentence in the indicated mood;

SENTENCE: <>
MOOD: <>
PARAPHRASED SENTENCE: <>

SENTENCE: <>
MOOD: <>
PARAPHRASED SENTENCE: <>

SENTENCE: <>
MOOD: <>
PARAPHRASED SENTENCE: <>

SENTENCE: <>
MOOD: <>
PARAPHRASED SENTENCE: <>

SENTENCE: <>
MOOD: <>
PARAPHRASED SENTENCE:

1 Like

GPT-3 isn’t great with formats that don’t resemble natural writing or conversation. Try to write more human-like and you’ll get better results.

I also suggest providing plenty of examples in your prompt so that there’s no mistake on how output should be generated. I provided davinci2 and carie with the same two examples:

Paraphrase the following sentences in accordance with the listed mood.

“I’m contacting you in regards to last week’s discussion”
Paraphrase in an annoyed mood: “Look, I need to talk to you about last week. Let’s make this quick.”

“Yeah, ol’ Roger kicked the bucket recently and it’s been doing a number on me.”
Paraphrase in a somber mood: “Ever since Roger’s tragic passing, I’ve been trapped in a state of despair.”

Here is text-davinci-002’s output for my actual paraphrasing:

“Let’s get ready to RUMBLE!!”
Paraphrase in a tired mood: “I’m just so tired. Let’s just get this over with.”

“Careful, man. Don’t spill it.”
Paraphrase in an anxious mood: “Be careful! You’re making me really nervous.”

Here’s carie’s output:

“Let’s get ready to RUMBLE!!”
Paraphrase in a tired mood: “I hope this meeting is over soon. I’m exhausted.”

“Careful, man. Don’t spill it.”
Paraphrase in an anxious mood: “I’m really scared you’re going to drop the coffee. What if it stains the carpet?”

So far, a bit hit or miss. I suggest adding a lot more examples for actual use.

I then let both models paraphrase the same sentence numerous times in any way they’d like, requesting that they specify the target mood.

davinci2:

Now, produce five paraphrased variants of the following sentence in any mood if your choosing. Specify your mood of choice.
“The moral of the story is to never give up on your dreams, even though they may seem impossible.”

  1. Paraphrase in an optimistic mood: “The moral of the story is to never give up on your dreams, because anything is possible if you believe in yourself.”

  2. Paraphrase in a determined mood: “The moral of the story is that you should never give up on your dreams, no matter how difficult they may seem.”

  3. Paraphrase in a hopeful mood: “The moral of the story is to never give up on your dreams, because someday they may come true.”

  4. Paraphrase in a inspirational mood: “The moral of the story is that you should never give up on your dreams, because they are what make life worth living.”

  5. Paraphrase in a naive mood: “The moral of the story is that you should never give up on your dreams, because if you do, then you’ll never achieve them.”

Carie did not understand at all, though.

Now, produce five paraphrased variants of the following sentence in any mood if your choosing. Specify your mood of choice.
“The moral of the story is to never give up on your dreams, even though they may seem impossible.”

“I’m glad you liked it. The moral of the story is to never give up on your dreams, even though they may seem impossible.”

“I’m glad you liked it. The moral of the story is to never give up on your dreams, even though you may not have the support you need.”

“I’m glad you liked it. The moral of the story is to never give up on your dreams, even though it may take a lot of hard work.”

“I’m glad you liked it. The moral of the story is to never give up on your dreams, even though it’s not always easy.”

“The moral of the story is to never give up on your dreams, even though sometimes you have to face obstacles.”

“The moral of the story is to never give up on your dreams, even though you may have to face obstacles. The best way to overcome them is to keep pushing forward.”

In conclusion: Davinci 2 is OpenAI’s ideal model for any use case given its power and that generally, other models are only used when there’s a cost factor involved. You’ll need to do some more experimenting if you really want to find the ideal outcome for your specific circumstances, though. If you’re going commercial you’ll want to look into fine tuning but if this is just for yourself, you’ll just need to drop some examples in your prompt and it should help.

Don’t be afraid to request multiple variants of your sentence so you can get variety and choose the best one.

1 Like

thank you for the detailed reply, I will experiment the way you proposed, regards…

1 Like

Thank you, quite explanatory.

I used placeholders in my OP just because I am using prompts in txt files in my Python code.

In my use case, I will paraphrase long form text (each around 3000-4000 tokens), so providing examples in each prompt is not practical.

I guess fine-tuning with a proper dataset is the way to get quality output.

Regards.

1 Like

Quick solution - maybe check neuralfinity for paraphrasing/summarizing long text.

Custom solution for very long text:

Work on engineering a prompt that does exactly what you require with zero examples - this is possible but will involve a lot of testing/refinement to get it perfect.

2 Likes

thank you Jeff, I will also check neuralfinity…

1 Like

paraphrase “active travel can help reduce emissions to achieve global targets. Cities contribute 70% of the world’s greenhouse gas emissions and 21% of these come from urban transport alone.”