Self-Consistency | Prompt Engineering Guide
Perhaps one of the more advanced techniques out there for prompt engineering is self-consistency. Proposed by Wang et al. (2022) (opens in a new tab) , self-consistency aims "to replace the naive greedy decoding used in chain-of-thought prompting". The idea is to sample multiple, diverse reasoning paths through few-shot CoT, and use the generations to select the most consistent answer. This helps to boost the performance of CoT prompting on tasks involving arithmetic and commonsense reasoning. Let's try the following example for arithmetic reasoning: Prompt: Output: The output is wrong! How may we improve this with self-consistency? Let's try it out. We will use the few-shot exemplars from Wang et al. 2022 (Table 17): Prompt: Output 1: Output 2: Output 3: Computing for the final answer involves a few steps (check out the paper for the details) but for the sake of simplicity, we can see that there is already a majority answer emerging so that would essentially become the final answer. S
Prompting Techniques Self-Consistency Copy page Self-Consistency Perhaps one of the more advanced techniques out there for prompt engineering is self-consistency. Proposed by Wang et al. (2022) (opens in a new tab) , self-consistency aims "to replace the naive greedy decoding used in chain-of-thought prompting". The idea is to sample multiple, diverse reasoning paths through few-shot CoT, and use the generations to select the most consistent answer. This helps to boost the performance of CoT prompting on tasks involving arithmetic and commonsense reasoning. Let's try the following example for
Explore this link on the map →saved by
related reading
- Chain-of-Thought Prompting | Prompt Engineering Guidepromptingguide.ai
- Chain-of-Thought Promptinglearnprompting.org
- Prompt Engineering | Lil'Loglilianweng.github.io
- Generated Knowledge Prompting | Prompt Engineering Guidepromptingguide.ai
- Meta-Prompt: A Simple Self-Improving Language Agentnoahgoodman.substack.com
- Position: It's Time to Optimize for Self-Consistencytime-for-consistency.github.io
- Prompt Chaining | Prompt Engineering Guidepromptingguide.ai
- Newest Annual Compilation Of The Best Prompt Engineering Techniquesforbes.com
- The Shape of AI | UX Patterns for Artificial Intelligence Designshapeof.ai
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4. · GitHubgithub.com
- Prompt Like a Data Scientist: Auto Prompt Optimization and Testing with DSPy | Towards Data Sciencetowardsdatascience.com
- Prompt engineering | OpenAI APIplatform.openai.com