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
saved by
related reading
- Chain-of-Thought Prompting | Prompt Engineering Guidepromptingguide.ai
- Tree of Thoughts (ToT) | Prompt Engineering Guidepromptingguide.ai
- Prompt Chaining | Prompt Engineering Guidepromptingguide.ai
- Generated Knowledge Prompting | Prompt Engineering Guidepromptingguide.ai
- Few-Shot Prompting | Prompt Engineering Guidepromptingguide.ai
- Prompt Engineering Guide | Prompt Engineering Guidepromptingguide.ai
- Chain-of-Thought Promptinglearnprompting.org
- [2201.11903] Chain of Thought Prompting Elicits Reasoning in Large Language Modelsarxiv.org
- Prompt Engineering | Lil'Loglilianweng.github.io
- 2402.07927arxiv.org
- Training Large Language Models to Reason in a Continuous Latent Spacearxiv.org
- [2510.27062] Consistency Training Helps Stop Sycophancy and Jailbreaksarxiv.org