Get davinci to answer with fewer sentences

I use text-davinci-002 in my Chrome extension to generate responses to Youtube comments (for channel owners).
I love davinci’s highly contextual answer. But some of them are too long-winded to be useful for my case. I would like davinci to answer in a more concise manner but I’m unsure how to design the prompt.
Since every Youtube channel has a different topic, I can’t really provide examples in my prompt. I tried adding "[username] answers in concise and very few sentences] but without examples, it didn’t seem to have any effect.

Any ideas?

Use adjectives. “short response” or “one sentence”, etc

4 Likes

That’s basically what I tried but just putting this in the prompt doesn’t really seem to do anything. I guess I have to provide examples to the AI. But since Youtube comments can be so vastly different in their topic and mood, I don’t really know how to provide examples without skewing the generated text too much.

What do you think about this prompt? It seems to be my best bet so far:

const response = await openai.createCompletion("text-davinci-002", {
            prompt: `The following is a conversation between a Youtuber named ${user.firstName} and his/her subscriber. 
            ${user.firstName} is helpful, creative, clever and very friendly.
            ${user.firstName} gives very concise answers.
            Subscriber says: ${trimmedMessage}
            ${user.firstName} responds tersely:`,
            
            temperature: 0.9,
            max_tokens: 150,
            top_p: 1,
            frequency_penalty: 0,
            presence_penalty: 0.6,
            stop: [" Subscriber:"],
            user: user._id,
        });

It works fine but sometimes davinci-002 still gives very long-winded answers that are usually not correct enough to actually use (especially to technical questions). Do you have an idea how I can remove them without hindering davinci’s ability to answer easier technical questions?

I changed the prompt and settings a bit more and I think I’m getting closer. For some reason, the AI ignores the stop sequence and continues after “Subscriber:” sometimes.

const response = await openai.createCompletion("text-davinci-002", {
            prompt: `The following is an exchange between a Youtuber named ${user.firstName} and his/her subscriber. 
            ${user.firstName} is helpful, thankful, very terse, and very friendly.
            Subscriber: ${trimmedMessage}
            Instead of giving a long winded answer, ${user.firstName} responds very concisely.
            ${user.firstName}:`,
            temperature: 0.5,
            max_tokens: 150,
            frequency_penalty: 0,
            presence_penalty: 0.6,
            stop: [" Subscriber:"],
            user: user._id,
        });

Your temperature was way too high at first. I would also remove the frequency and presence penalties. They seem to have more adverse effects than positive ones, especially on the recent engines. You also have a space before Subscriber. I would change the prompt to have the most salient instructions up front, and be as laconic as possible.

Write a pithy conversation between a YouTuber and their subscriber.

Something like that. The more concise you can make the instructions, the better.

Thank you very much for the tips! I’ll try it out and see what results I get!
I thought " Subscriber" should start with a space but I didn’t realize that we are starting a new line. Thank you for pointing that out!
Just to be sure, I’ll add both " Subscriber:" and “Subscriber:” to the stop argument.