Source-linked AI summary
Universal Self-Consistency for Large Language Model Generation
Xinyun Chen, Renat Aksitov, Uri Alon, Jie Ren, Kefan Xiao, Pengcheng Yin, Sushant Prakash, Charles Sutton, Xuezhi Wang, Denny Zhou
TL;DR
Standard self-consistency is limited by answer extraction, which prevents its use on free-form outputs. USC instead uses an LLM to select the most consistent candidate, matching established consistency methods on applicable tasks and improving performance on open-ended generation.
Problem
Standard self-consistency requires comparable, extractable final answers, limiting its use for free-form tasks such as summarization and open-ended question answering.
Method
USC samples multiple responses and prompts an LLM to select the most consistent response without exact answer counting or task-specific answer parsing.
Results
USC improves open-ended question answering and long-context summarization, matches standard self-consistency on mathematical reasoning, and matches execution-based consistency on code generation without execution results.
Takeaways & Limitations
USC extends consistency-based selection to free-form generation while retaining comparable performance on tasks where standard answer extraction is feasible.
Takeaways & Limitations
The most consistent response is not necessarily the best response, and USC remains below oracle reranking scores.
Abstract
from arXiv · showhide
Self-consistency with chain-of-thought prompting (CoT) has demonstrated remarkable performance gains on various challenging tasks, by utilizing multiple reasoning paths sampled from large language models (LLMs). However, self-consistency relies on the answer extraction process to aggregate multiple solutions, which is not applicable to free-form answers. In this work, we propose Universal Self-Consistency (USC), which leverages LLMs themselves to select the most consistent answer among multiple candidates. We evaluate USC on a variety of benchmarks, including mathematical reasoning, code generation, long-context summarization, and open-ended question answering. On open-ended generation tasks where the original self-consistency method is not applicable, USC effectively utilizes multiple samples and improves the performance. For mathematical reasoning, USC matches the standard self-consistency performance without requiring the answer formats to be similar. Finally, without access to execution results, USC also matches the execution-based voting performance on code generation.
1 INTRODUCTION
LLM responses can improve through consistency-based selection, but standard self-consistency depends on extracting comparable final answers and therefore struggles with free-form generation. USC addresses this limitation by asking an LLM to select the most consistent candidate, and performs competitively across diverse tasks.
- Standard self-consistency samples multiple reasoning paths and selects the most common final answer, improving performance across reasoning and code-generation benchmarks.
- USC asks an LLM to select the most consistent response from multiple candidates, removing the need for a task-specific answer-extraction process.
- USC supports free-form generation tasks, where standard self-consistency cannot aggregate answers through majority voting.
- Across mathematical reasoning, code generation, long-context summarization, and open-ended question answering, USC generally matches applicable consistency baselines and improves performance where standard self-consistency is unavailable.
2 BACKGROUND: SELF-CONSISTENCY
Self-consistency improves reasoning by sampling diverse chains and voting on their final answers, but this strategy requires a unique, closed-form answer. That requirement excludes open-ended tasks and code settings where semantic equivalence depends on execution.
- Self-consistency samples multiple reasoning chains and uses a majority vote over final answers instead of relying on one greedily decoded chain.
- For code generation, consistency-based selection executes predicted programs, clusters identical execution outputs, and selects a program from the largest cluster.
- Its answer-voting requirement makes standard self-consistency applicable mainly to problems with unique, closed-form answers such as single-number outputs.
- This restriction challenges open-ended generation tasks including summarization, creative writing, and open-ended question answering.
3 UNIVERSAL SELF-CONSISTENCY
USC samples multiple responses, then uses an LLM to select the most consistent one rather than counting exact answer frequencies. This enables consistency-based selection across diverse formats, including free-form answers.
- USC samples multiple LLM responses, concatenates them, and prompts the LLM to select the most consistent response as the final answer.
- The workflow avoids exact answer-frequency counting and relies on the LLM to assess consistency across candidate responses.
- For an entity-list answer with no exact-match duplicate predictions, USC selects the response whose individual entities appear most frequently across candidates.
- Across multiple tasks, LLMs are empirically able to examine response consistency, including code generation without execution outputs and long-context summarization.
- USC handles diverse mathematical response formats that make rule-based answer extraction difficult, while preserving final-answer consistency assessment.
4 EXPERIMENTS
USC is evaluated across mathematical reasoning, code generation, long-context summarization, and open-ended question answering, using multiple candidate responses and LLM-based selection. It generally matches established consistency methods where applicable and improves performance on free-form tasks, while response ordering has minimal effect overall.
- Benchmarks: USC is evaluated on mathematical reasoning, code generation, long-context summarization, and open-ended question answering benchmarks.The experiments include GSM8K and MATH, BIRD-SQL and ARCADE, GovReport and SummScreen, and TruthfulQA.
- Experimental setup: USC uses the same initial response set as competing sampling schemes, with eight samples by default.The implementation uses instruction-tuned PaLM 2-L and gpt-3.5-turbo models.
- Mathematical reasoning: USC generally matches standard self-consistency on mathematical reasoning without requiring answer parsing for voting.Across GSM8K and MATH, USC improves over greedy decoding and random selection while remaining generally comparable to standard self-consistency.
- Code generation: USC matches execution-based self-consistency on BIRD-SQL and ARCADE without using code execution to vote.BIRD-SQL is evaluated with execution accuracy and valid efficiency, while ARCADE covers Python code generation.
- Summarization: USC improves over baselines across GovReport summarization metrics, while standard self-consistency is unavailable for free-form summaries.Selecting the most detailed summary produces additional gains of about 2 ROUGE-1 and ROUGE-Lsum points.
- TruthfulQA: USC produces the highest truthfulness on TruthfulQA for both evaluated models and the highest or statistically indistinguishable informativeness.It has the highest informativeness with PaLM 2-L and is 0.1 below the highest score with gpt-3.5-turbo, a difference not considered significant.
- Response ordering: USC performance remains similar across five random response orders, indicating minimal overall sensitivity to candidate ordering.The ablation reports means and standard deviations over five runs.
- Number of responses: More samples consistently benefit TruthfulQA and BIRD-SQL, but 16 samples reduce GSM8K accuracy and stop improving SummScreen after five samples.The authors identify eight samples as a practical balance between accuracy and compute cost.
5 RELATED WORK
USC extends consistency-based response selection by having the generating LLM select among multiple candidates, avoiding explicit pairwise similarity definitions and additional labeled training or external rerankers. The paper positions this approach alongside reranking, voting-based consistency methods, candidate-based response improvement, and LLM evaluation.
- USC uses the same LLM to generate and select responses, without additional labeled training data or an external reranking model.
- Unlike prior consistency approaches that typically vote for the most common response, USC directly instructs the LLM to perform consistency-based selection.
- USC differs from related consistency-based reranking by avoiding an explicit definition of pairwise similarity while applying selection across diverse tasks.
- Prior candidate-based methods use multiple responses to iteratively improve outputs, whereas USC selects a final response from the candidates.
- USC assumes LLMs can evaluate consistency among their own outputs, relating the method to findings on LLM-based evaluation of generated text.
6 LIMITATIONS AND FUTURE WORK
USC expands self-consistency to free-form outputs but has limitations involving context length, inference cost, confidence estimation, and the possibility that consistency selects a non-best response. The authors identify calibration, efficiency improvements, and task-specific criteria as future directions.
- Although USC generally matches standard self-consistency where both apply, its current implementation has method-specific limitations.
- USC supports fewer samples than extraction-based self-consistency because its candidate set is bounded by the underlying LLM’s context length.The authors state that practical sample counts are generally small enough for context length to remain sufficient.
- Unlike voting-based self-consistency, USC does not yet provide confidence or uncertainty estimates for each response.Developing calibration through output clustering and pairwise self-consistency is proposed as future work.
- USC requires an additional LLM query, increasing inference costs despite producing only a short response index.The paper suggests lightweight selection models and more efficient long-context encoding as possible cost reductions.
- Consistency is not guaranteed to select the best response, and USC remains below oracle reranking performance.The limitation applies to both standard self-consistency and USC, motivating task-specific selection criteria and further framework refinement.
7 CONCLUSION
USC extends standard self-consistency to free-form generation tasks and boosts performance across diverse applications. Where answer extraction is feasible, it performs on par with standard self-consistency.
- USC extends standard self-consistency to support free-form generation tasks.
- USC boosts performance across diverse applications.
- USC performs on par with standard self-consistency when answer extraction is feasible for voting.
- Mitigating position bias and improving long-context understanding are identified as future work for enhancing USC's effectiveness and robustness.
A COMPARISON TO ORACLE SELECTION
The oracle comparison uses the same eight samples as standard self-consistency and USC, revealing a notable performance gap that motivates improved ranking methods.
- The oracle selects the best response among candidates for each task.
- The oracle selection uses the same 8 samples as standard self-consistency and USC.
- A notable gap remains between USC and oracle performance across multiple tasks.
- Developing ranking methods to bridge the gap is identified as future work.
B EXAMPLES OF USC PROMPTS
The appendix presents full USC prompts with candidate responses for mathematical reasoning and TruthfulQA, alongside oracle-comparison tables for several benchmarks.
- Figures 6 and 7 present full USC prompts with candidate responses for different tasks.
- Tables 10 and 11 compare oracle selection on long-context summarization and TruthfulQA benchmarks.
- The examples include generated responses about three-digit numbers divisible by 3 and comparative coffee consumption.
- Figure 6 gives a full USC prompt for mathematical reasoning.
- Figure 7 gives a full USC prompt for TruthfulQA.