Skip to main content

Overview

Generate Examples First

Analogical Prompting is a method that aims to get LLMs to generate examples that are relevant to the problem before starting to address the user’s query. This takes advantage of the various forms of knowledge that the LLM has acquired during training and explicitly prompts them to recall the relevant problems and solutions. We can use Analogical Prompting using the following template
Analogical Prompting Prompt Template
  • Problem: [user prompt]
  • Relevant Problems: Recall [n] relevant and distinct problems.
  • For each problem, describe it and explain the solution

Example

We can implement this using Instructor to solve the problem, as seen below with some slight modifications.

References

  1. Large Language Models As Analogical Reasoners