Provide a direct quote

I am trying to have openai, respond with 1-2 sentences that answers a question by providing a direct quote from the context.

Example question:
Who produced “Who Framed Roger Rabbit”?

Example context:

Link: Who Framed Roger Rabbit - Wikipedia, Content: Who Framed Roger Rabbit is a 1988 American live-action/animated comedy mystery film directed by Robert Zemeckis, produced by Frank Marshall and Robert Watts, and loosely adapted by Jeffrey Price and Peter S. Seaman from Gary K. Wolf’s 1981 novel Who Censored Roger Rabbit?. The film stars Bob Hoskins, Christopher Lloyd, Charles Fleischer, Stubby Kaye, and Joanna Cassidy. Set in a 1947 version of Hollywood where cartoon characters (commonly referred to as “toons”) and people co-exist, the film follows Eddie Valiant, a private investigator who must exonerate Roger Rabbit, a toon who has been framed for the murder of the Acme Corporation’s owner.

Response:
Per the link Who Framed Roger Rabbit - Wikipedia, “Frank Marshall and Robert Watts”

1 Like

I am wondering if it would be best to do some sort of insert?

Have you tried one or few shot?

Sorry, I am still learning the terminology and documentation, I am new to this space.

What is one or few shot? And where can I find examples?

It is when you provide it with one or several examples of what you want it to do.

The original GPT3 paper was called “large language models are few shot learners”

Got it.

I appreciate it and will look up that paper!

Like I said, I am extremely new to this whole space. And really appreciate any suggested reading!

Do you generally do this in the run-time prompt? I am assuming that is a bit costly on tokens? Or is this where it is best to use fine-tuning?

This is a good example of few shot: OpenAI API

But I don’t think you need it for yours. Here’s a prompt that worked perfectly fine for me. Temperature 0.2, Max length 256.

Read the following passage and answer the question.

Passage:

Link: Who Framed Roger Rabbit - Wikipedia, Content: Who Framed Roger Rabbit is a 1988 American live-action/animated comedy mystery film directed by Robert Zemeckis, produced by Frank Marshall and Robert Watts, and loosely adapted by Jeffrey Price and Peter S. Seaman from Gary K. Wolf’s 1981 novel Who Censored Roger Rabbit?. The film stars Bob Hoskins, Christopher Lloyd, Charles Fleischer, Stubby Kaye, and Joanna Cassidy. Set in a 1947 version of Hollywood where cartoon characters (commonly referred to as “toons”) and people co-exist, the film follows Eddie Valiant, a private investigator who must exonerate Roger Rabbit, a toon who has been framed for the murder of the Acme Corporation’s owner.

Question: Who produced “Who Framed Roger Rabbit”?

Answer:

This seems to be an easier task for GPT-3 and it answered perfectly on text-babbage-001.

2 Likes

Holy moly, this is amazing and a lot less complex!

The prompts I where trying where overly complicated I guess.

I have read the documentation on prompts a few times, but do you have any recommended reading or resources on how to write better instructions?

1 Like

How do I limit openai from making up an answer, if the question is out of context?

For example, something like the following produces a random answer.

Read the following passage and answer the question.

Passage:

Link: Who Framed Roger Rabbit - Wikipedia, Content: Who Framed Roger Rabbit is a 1988 American live-action/animated comedy mystery film directed by Robert Zemeckis, produced by Frank Marshall and Robert Watts, and loosely adapted by Jeffrey Price and Peter S. Seaman from Gary K. Wolf’s 1981 novel Who Censored Roger Rabbit?. The film stars Bob Hoskins, Christopher Lloyd, Charles Fleischer, Stubby Kaye, and Joanna Cassidy. Set in a 1947 version of Hollywood where cartoon characters (commonly referred to as “toons”) and people co-exist, the film follows Eddie Valiant, a private investigator who must exonerate Roger Rabbit, a toon who has been framed for the murder of the Acme Corporation’s owner.

Question: Who am I?

Answer:

Would I prime it like?

Read the following passage and answer the questions.

Passage:

Link: Who Framed Roger Rabbit - Wikipedia, Content: Who Framed Roger Rabbit is a 1988 American live-action/animated comedy mystery film directed by Robert Zemeckis, produced by Frank Marshall and Robert Watts, and loosely adapted by Jeffrey Price and Peter S. Seaman from Gary K. Wolf’s 1981 novel Who Censored Roger Rabbit?. The film stars Bob Hoskins, Christopher Lloyd, Charles Fleischer, Stubby Kaye, and Joanna Cassidy. Set in a 1947 version of Hollywood where cartoon characters (commonly referred to as “toons”) and people co-exist, the film follows Eddie Valiant, a private investigator who must exonerate Roger Rabbit, a toon who has been framed for the murder of the Acme Corporation’s owner.

Question: Are you God?

Answer: Please ask another question.

Question: Who am I?

Answer:

What is the best way to limit the response from drifting?

1 Like

I learned a lot from gwern. It’s a bit rambly but it gets the point across.

Personally, my attitude is to treat it like talking to a child. It’s smart enough to know a lot of things and figure things out, but you have to explain things clearly. If the prompt would confuse a child, it’ll also confuse GPT-3. And like a child, it has a good imagination and gets distracted too. Think of few shot more like roleplaying.

For the out of context case, I’d just modify it as following:

Read the following passage and answer the question. If you don’t know the answer, answer “I don’t know.”

Passage:

Link: Who Framed Roger Rabbit - Wikipedia, Content: Who Framed Roger Rabbit is a 1988 American live-action/animated comedy mystery film directed by Robert Zemeckis, produced by Frank Marshall and Robert Watts, and loosely adapted by Jeffrey Price and Peter S. Seaman from Gary K. Wolf’s 1981 novel Who Censored Roger Rabbit?. The film stars Bob Hoskins, Christopher Lloyd, Charles Fleischer, Stubby Kaye, and Joanna Cassidy. Set in a 1947 version of Hollywood where cartoon characters (commonly referred to as “toons”) and people co-exist, the film follows Eddie Valiant, a private investigator who must exonerate Roger Rabbit, a toon who has been framed for the murder of the Acme Corporation’s owner.

Question: Who am I?

Answer:

Still works fine on babbage.

1 Like

It is unclear to me what the answer is. The ‘Link’ is a description of a film, not a narration from a character.