How to generate prompts for a paragraph?

I have bunch of books which I want to use to fine tune gpt3. What are some ideas to generate prompts for the contents of the book ?

What I tried so far ?

  1. Use text completion to ask questions like “create questions for the following paragraph ”. This gives some prompts but I wonder if there are other ways to do it.

This would be better and more effective if you were to use embedding. It involves keeping the text at your end and running a process over the text to generate embedding vectors

Then when you want to do a query, you create an embedding vector for your “query text” and compare it to all the vectors you have saved (locally)

When you have the closest match(es), you can create prompt for GPT to answer the question with the text that you found as part of the prompt (ie. “referring to the following text ” or something similar)

This way you don’t need prompts for a fine-tuning file. You don’t end up using fine-tuning at all.

2 Likes

Thanks, @raymonddavey, for this idea!

Is there a code example I can refer to understand this implementation?