Analogical Prompting
A technique that prompts AI to recall or generate relevant examples and analogies before solving a new problem.
Also known as: Analogy-Based Prompting, Self-Generated Examples, Example Recall Prompting
Category: Techniques
Tags: ai, prompting, reasoning, llm-techniques, problem-solving, analogies
Explanation
Analogical Prompting leverages the power of analogical reasoning by having the AI generate or recall similar problems and their solutions before tackling the target problem. This mimics how humans often solve new problems by drawing on past experiences.
How it works:
1. **Self-Generated Exemplars**: Instead of providing examples (few-shot), ask the model to generate its own relevant examples
2. **Analogy Identification**: Prompt the model to identify how the current problem is similar to problems it knows
3. **Solution Transfer**: Apply solution patterns from analogous problems to the new problem
Prompt pattern:
```
Before solving this problem, recall 2-3 similar problems you know how to solve. Show the problems and their solutions. Then use these as a guide to solve the new problem.
```
Advantages over traditional few-shot:
- **Self-tailored examples**: Model generates examples most relevant to its knowledge
- **No example crafting**: Removes the burden of creating good examples
- **Better coverage**: Model can draw from its full training knowledge
- **Adaptive**: Works across different problem domains
Effective applications:
- Mathematical problem-solving
- Code generation (recall similar algorithms)
- Writing tasks (recall similar formats)
- Logical reasoning
Analogical prompting often outperforms few-shot learning because the model generates examples from its own knowledge distribution, making them more actionable.
Related Concepts
← Back to all concepts