May 15, 2024

Recitation-augmented and Dual Prompting

Single Prompt Approach

The single prompt approach is a significant improvement upon the zero-shot in the sense that it allows the model to gather additional context and direction before the main generation. Let's look at an example:

Give me a list of topics from the 5th grade maths curriculum, 
then use it to write a test for 20 questions.

Albeit already good, this can be further improved.

Benefits of Dual Prompt Approach

Double Prompting can produce longer content more reliably and is recommended over the single prompt approach.

Prompt 1:

Give me a list of topics from the 5th grade maths curriculum

Answer 1:

Topics:
Operations with whole numbers
Decimals
Fractions
Geometry
Measurement

And now we feed it into Prompt 2:

Topics:
Operations with whole numbers
Decimals
Fractions
Geometry
Measurement

Use those topics to generate a 5th grade test for 20 questions.

The dual prompt approach helps AI models improve response accuracy by anchoring the response in factual information related to the prompt topic. This leads to more accurate and contextually-grounded answers, enhancing the overall performance of your chatbot.

You can test this with our ChatGPT 4o API starting today!

Recitation-Augmented Approach

The Recitation-Augmented Approach is a simpler version of the Generated Knowledge Approach. What sets it apart is that it fewsshot prompts the LLM to generate information and answer the question in the same step. This means the model recites or generates knowledge and provides the response simultaneously.

Recitation approach, Sun et. al (2023)

The Recitation-Augmented Approach is a less complex strategy, skipping on a few complex steps - but still effective in improving the response accuracy of AI models. It is a great starting point if you're just beginning to explore the world of prompt engineering.

Remember, both the Generated Knowledge and Recitation-Augmented Approaches have their advantages. When deciding which method to use for your chatbot, consider the nature of the conversation, the complexity of the question, and the desired length and depth of the response.

Test out the prompts with AI/ML AI Playground.

We're excited to see what amazing projects you will bring to life. Happy prompting!

Get API Key