Enhancing Responses with Generated Knowledge Prompting
Generated Knowledge Prompting
is a prompt engineering technique where useful information is generated first before producing the final response.
The AI generates knowledge and recognizes the information required to solve the problem, referencing previously generated knowledge when creating the final response.
It can be structured as a single prompt that generates knowledge and writes the response in one go, or as a dual prompt that first generates knowledge and then uses it to write the response.
Generated Knowledge Prompting is abbreviated as GKP
. According to a paper by Allen Institute, GKP improved the answer accuracy for commonsense reasoning problems from 64.05% to 70.92%.
How to Use It
You can use a single prompt to generate knowledge and write the response in one step, as shown below.
Generate 4 facts about the Golden Retriever,
and then use this information to write a short blog post.
1. Golden Retrievers are one of the most popular dog breeds in the United States.
2. They are known for their friendly and tolerant attitudes.
3. Golden Retrievers are great family pets and excellent working dogs.
4. They were originally bred for retrieving game during hunting.
Blog Post:
Golden Retrievers are one of the most beloved dog breeds in the United States,
known for their friendly and tolerant attitudes.
These dogs make excellent family pets and are also great working dogs,
originally bred for retrieving game during hunting trips.
With their charming disposition and versatility,
Golden Retrievers continue to be a favorite among dog owners.
To ensure their well-being...(continued)
With a dual prompt, you can generate knowledge first and then use it to write the final response, as shown below.
Give me 4 key points to keep in mind when investing in the stock market during a downturn.
1. Avoid making decisions based on emotions:
In a downturn, investors are prone to panic. Make decisions based on rational analysis...(continued)
2. Focus on long-term investments:
A downturn may be temporary, and markets tend to recover in the long run.
Avoid getting swayed by short-term volatility...(continued)
3. ...(continued)
4. ...(continued)
Using the 4 key points generated above,
draft a blog post explaining what to keep in mind when investing in the stock market during a downturn.
By using Generated Knowledge Prompting
, the AI is guided to generate necessary information first and then use it to formulate comprehensive final responses.
Practice
Send a prompt example and compare the AI's response to see how Generated Knowledge Prompting
works.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.