generated-knowledge-prompting
---
id: generated-knowledge
title: Enhancing Response Depth with Generated Knowledge Prompting
description: Understanding and utilizing context through examples of contextual prompting
tags:
- prompt engineering
- generated knowledge prompting
sidebar_position: 10
isPublic: false
---
# Enhancing Response Depth with Generated Knowledge Prompting
`Generated Knowledge Prompting` is a prompting technique where **useful information is generated** prior to crafting the final response.
AI generates knowledge by recognizing the information necessary to solve a problem beforehand, and references this pre-generated knowledge when crafting its final response.
It employs a **single prompt** to generate knowledge and write a response or a **dual prompt** divided into two stages: one for generating knowledge and the other for using this knowledge to write a response.
Generated Knowledge Prompting is abbreviated as `GKP`. According to the [Allen Institute's paper](https://ar5iv.labs.arxiv.org/html/2110.08387), GKP improved the answer accuracy for commonsense reasoning tasks from 64.05% to 70.92%.
<br />
## How do you use it?
You can use a single prompt to generate knowledge and write a response as follows.
```text title="Single Prompt Example"
Generate four facts about Golden Retrievers,
then write a short blog post using this information.
Single Prompt Response
1. Golden Retrievers are a popular dog breed in the United States.
2. They are known for their friendly nature and intelligence, making them great family pets.
3. Golden Retrievers are often employed as service dogs due to their trainability.
4. They typically have a golden coat, from which their name is derived.
Blog Post:
Golden Retrievers are one of America's favored dog breeds, renowned for their friendly demeanor and intelligence.
These dogs are often chosen as service animals due to their high trainability, proving invaluable in supporting individuals with various needs.
Sporting a beautiful golden coat, which is their namesake, Golden Retrievers continue to win the hearts of many families across the country.
In the U.S., several initiatives are in place to encourage responsible ownership and care for...(omitted)
By using a dual prompt method as shown below, you can first generate knowledge and then craft a final response using it.
Dual Prompt Example
List 4 important considerations for stock investment during a bear market.
Dual Prompt Response
1. Keep Emotions in Check and Make Rational Decisions:
In bear markets, investors often succumb to fear.
Avoid emotional decisions and...(omitted)
2. Invest with a Long-Term Perspective:
A bear market can be temporary,
and markets tend to recover in the long term.
Do not be swayed by short-term volatility...(omitted)
3. ...(omitted)
4. ...(omitted)
Guiding Final Dual Prompt Response
Using the 4 considerations generated above,
draft a blog post outline explaining
key considerations for stock investment during a bear market.
This way, Generated Knowledge Prompting
guides AI to generate necessary information beforehand and use it to form the final response accurately.
Practice
Send prompt examples and compare the AI responses.
Want to learn more?
Join CodeFriends Plus membership or enroll in a course to start your journey.