|
|
Self-Consistency Prompting
Author: Venkata Sudhakar
Self-consistency prompting improves LLM reliability by sampling the same prompt multiple times with a higher temperature and then taking a majority vote over the answers. Instead of trusting a single response, you run the prompt 5 to 10 times and pick the answer that appears most frequently. This is especially powerful for reasoning tasks where the model may take different but valid paths to the same correct answer. Self-consistency is proven to outperform single-sample chain-of-thought on arithmetic, commonsense reasoning, and symbolic reasoning benchmarks. For business applications like order validation, pricing calculations, or policy compliance checks, it reduces the chance of acting on a single erroneous LLM response. The below example runs a ShopMax India discount eligibility check 5 times and uses majority voting to determine the final answer, reducing the risk of acting on a single incorrect response.
It gives the following output,
Sample 1: 20
Sample 2: 20
Sample 3: 15
Sample 4: 20
Sample 5: 20
Final answer (majority vote): 20% (appeared 4/5 times)
The correct answer is 20% (10% base + 5% premium + 5% festival = 20%, capped at max). Sample 3 gave an incorrect 15% but the majority vote correctly overrode it. For high-stakes business logic at ShopMax - such as financial calculations, eligibility decisions, or compliance checks - always use self-consistency with at least 5 samples before acting on the result.
|
|