Source-linked AI summary

SelfCheck: Using LLMs to Zero-Shot Check Their Own Step-by-Step Reasoning

Ning Miao, Yee Whye Teh, Tom Rainforth

arXiv:2308.00436v3cs.AIcs.CLcs.LG

TL;DR

Difficult multi-step reasoning remains error-prone for LLMs, motivating a way to check their own reasoning without external resources. SelfCheck performs zero-shot step verification through staged regeneration and comparison, then uses the resulting confidence scores for weighted voting, improving final predictive accuracy across three math tasks.

  • Problem

    LLMs remain prone to errors on difficult multi-step reasoning problems, while existing checks often require external resources, additional training data, or domain-specific exemplars.

  • Method

    SelfCheck uses the original LLM to extract each step’s target and context, independently regenerate the step, compare results, and combine checks into confidence-weighted voting.

  • Results

    SelfCheck significantly increases final answer accuracies over simple majority voting and other baselines on GSM8K, MathQA, and MATH.

  • Takeaways & Limitations

    SelfCheck provides a general-purpose zero-shot approach for self-checking LLM reasoning and improving final predictive accuracy without additional data or external resources.

  • Takeaways & Limitations

    The experiments omit comparisons with some training- or finetuning-based methods because their finetuned models and training resources were unavailable.

Abstract

from arXiv · show

The recent progress in large language models (LLMs), especially the invention of chain-of-thought prompting, has made it possible to automatically answer questions by stepwise reasoning. However, when faced with more complicated problems that require non-linear thinking, even the strongest LLMs make mistakes. To address this, we explore whether LLMs are able to recognize errors in their own step-by-step reasoning, without resorting to external resources. To this end, we propose SelfCheck, a general-purpose zero-shot verification schema for recognizing such errors. We then use the results of these checks to improve question-answering performance by conducting weighted voting on multiple solutions to the question. We test SelfCheck on three datasets (GSM8K, MathQA, and MATH) and find that it successfully recognizes errors and, in turn, increases final answer accuracies.

1 INTRODUCTION

SelfCheck addresses errors in difficult LLM reasoning by offering a general-purpose, zero-shot self-checking scheme that requires no external resources. It evaluates step-by-step reasoning and uses confidence-weighted voting to improve final answers across three math tasks.

  • Motivation: 42.5% of MATH problems are correctly answered by GPT-4 with CoT prompting, illustrating the difficulty of complex multi-step reasoning.Although individual-step error rates may be low, one erroneous step can undermine the final answer.
  • Motivation: Existing verification methods typically depend on external models, additional training data, or few-shot domain-specific exemplars.These requirements can restrict practical use across domains and data formats.
  • SelfCheck: SelfCheck uses the original LLM to check each reasoning step conditionally on preceding steps and integrate the checks into an overall correctness estimate.The approach is zero-shot and does not require finetuning or example crafting.
  • SelfCheck: SelfCheck decomposes checking into target extraction, information collection, independent step regeneration, and result comparison.Separate calls extract the step’s target and context, regenerate an alternative, and compare it with the original step.
  • Evaluation: Confidence scores can weight votes among multiple solutions, providing a soft way to favor more accurate solutions.The method is evaluated on GSM8K, MathQA, and MATH, where it increases final answer accuracies over simple majority voting and other baselines.

2 RELATED WORK

Prior verification approaches use few-shot examples, specialized formats, external resources, or separately trained verifiers. SelfCheck is positioned as a general zero-shot alternative, illustrated through a four-stage checking example.

  • Verification approaches: Automatic verification of reasoning-step correctness is presented as a long-standing research question.Prior LLM-oriented methods generally require problem-specific examples, an external model, or finetuning.
  • Verification approaches: Few-shot verification uses hand-crafted exemplars designed for a particular question-answering task.The cited Self-Verification approach checks whole solutions by backward prediction, supports only single-step checking, and is mainly applicable to simpler tasks such as GSM8K.
  • Verification approaches: Deductive Verification checks independent subtasks but only supports reasoning chains in the specialized Natural Programs format.This restricts it to a specific generator rather than making it a general verifier for multi-step reasoning.
  • Verification approaches: External-resource methods use symbolic logic solvers or databases, limiting verification to settings where those resources are available and to certain error types.These approaches translate questions into symbolic chains or consult external knowledge sources.
  • Verification approaches: Training-based methods finetune separate verifier models on solution-level or step-level correctness data.Examples include GSM8K-specific finetuning, domain-specific classifiers, and human-labeled stepwise correctness datasets.
  • SelfCheck example: Figure 1 illustrates SelfCheck checking Step 5 by extracting its target, selecting Step 4 as context, regenerating the step, and comparing the result.The regenerated circle center and radius differ from the original implication, so Step 5 is judged likely wrong.

3 SELFCHECK: USING LLMS TO CHECK THEIR OWN REASONING

SelfCheck turns self-verification into a staged regenerate-and-compare process that checks each step using its relevant context. It aggregates those checks into confidence scores that can drive weighted voting across solutions.

  • Motivation: Directly asking an LLM to verify its own reasoning is largely ineffective because it must parse the step, gather context, and assess correctness simultaneously.The task is also uncommon in training data, and checker errors may correlate with errors in the original generation.
  • Step checking: SelfCheck checks each step’s conditional correctness while assuming the question and preceding context are correct.The target is to catch errors at the current step rather than reassess all prior information.
  • Step checking: SelfCheck decomposes step checking into target extraction, information collection, step regeneration, and result comparison.The decomposition assigns simpler tasks to successive LLM calls and aims to reduce error correlation between checking and original generation.
  • Target extraction: Target extraction identifies what the current step is trying to achieve from the question and previous steps.The prompt requests a brief, single-sentence description of the specific action taken by the step.
  • Information collection: Information collection filters the question and prior steps to retain items directly related to the current step.The selected step or information identifiers are then passed to regeneration as the reduced context.
  • Step regeneration: Step regeneration independently achieves the extracted target using only the collected information and previous steps, without seeing the original step.Independent queries are used across LLMs and datasets, supporting the intended general-purpose procedure.
  • Results integration: The resulting confidence score can weight votes over multiple solutions and improve answer selection.SelfCheck generates multiple solutions, scores them, and chooses the final answer through weighted voting.

4 EXPERIMENTS

Experiments on three math-reasoning datasets evaluate SelfCheck for improving answer selection and estimating solution correctness. SelfCheck improves final accuracies over majority voting and filters solutions so higher-confidence predictions contain more correct solutions, with threshold-dependent trade-offs.

  • Experimental setup: SelfCheck is evaluated on GSM8K, MathQA, and MATH using GPT-3.5 and GPT-4, with majority voting as the main baseline.GSM8K and MathQA use their whole test sets, while MATH uses a resource-constrained subset; prompts are shared across datasets without dataset-specific tuning.
  • Final answer correctness: SelfCheck significantly outperforms majority voting for every tested number of generated solutions per question.Both methods improve as more solutions are generated, but SelfCheck’s weighted voting achieves higher accuracy by assigning larger weights to correct solutions.
  • Final answer correctness: SelfCheck significantly outperforms majority voting with GPT-3.5 and GPT-4 even when only two candidate solutions are available.Using GPT-3.5 to check GPT-4-generated answers outperforms GPT-4 checking on GSM8K and MathQA, while GPT-4 checking is better on MATH.
  • Verification performance: 67.5%→76.5%, 59.4%→82.2%, and 34.6%→50.8% are the increases in Real + in Pred + as thresholds rise on GSM8K, MathQA, and MATH.Higher thresholds retain a greater proportion of correct solutions among predicted-correct solutions, while misclassifying more genuinely correct solutions.
  • Verification performance: Directly prompting GPT-3.5 to verify whole reasoning chains provides no meaningful control over false- and true-positive rates.The checker predicts answers as correct nearly universally: both rates are 100% on MATH and 98% on GSM8K.

5 ANALYSIS

The analysis shows that SelfCheck’s benefits persist as solution ensembles grow, while majority voting saturates. Ablations further indicate that effective verification requires multi-stage step checking and regenerate-and-compare rather than direct or global checking.

  • More solutions per question?: Majority-voting accuracy saturates at n = 9, while SelfCheck continues improving and already outperforms majority voting with smaller ensembles.SelfCheck lowers the weights of incorrect solutions, helping select correct answers even when their generation probabilities are low.
  • More solutions per question?: SelfCheck’s weighted voting increases the chance of selecting correct answers by assigning lower confidence weights to incorrect solutions.The weighting provides a soft way to focus on more accurate solutions.
  • Global v.s. step-by-step checking: Global checking rarely recognizes errors, yielding verification accuracy of 55.0%, only marginally above the 50.0% random-guess baseline.Its final answer accuracies are consequently close to majority voting.
  • Single-stage v.s. multiple-stage step checking: Single-stage step checking performs better than global checking but remains significantly worse than SelfCheck’s multi-stage checking.The results indicate that step checking must be decomposed into a pipeline of easier subtasks.
  • Error check v.s. regenerate and compare: Direct error checking performs worse than regenerate-and-compare, even when supplemented with a detailed one-shot exemplar.This supports the finding that LLMs are better at generation than checking.

6 CONCLUSIONS

SelfCheck is a general-purpose, zero-shot step-by-step checking scheme that uses an LLM to identify errors in its own reasoning without additional data or external resources. Its regenerate-and-compare checks support weighted voting over multiple solutions, increasing final predictive accuracy.

  • Conclusions: SelfCheck is a general-purpose, zero-shot scheme that checks LLM reasoning step by step without additional data or external resources.It uses a novel regenerate-and-compare approach to identify errors in the LLM’s own reasoning.
  • Conclusions: SelfCheck’s checking results support weighted voting over different solutions, increasing final predictive accuracy.Confidence scores are used to weight candidate answers.

APPENDIX A

Appendix A illustrates SelfCheck on a complex-number problem by decomposing step checking into targeted extraction, context selection, regeneration, and comparison stages.

  • Variable definition extraction: SelfCheck extracts variable definitions so later regeneration preserves the meanings of variables used in the reasoning.The example identifies z as a complex number of the form x + yi, with x and y real.
  • Target extraction: Target extraction converts the current reasoning step into a brief action description rather than copying the original steps.For completing the square, the extracted target is rewriting the equation in the standard form of a circle.
  • Information Collection: Information collection selects question sentences and previous steps directly related to the current step.For completing the square, the selected prior result is 6x = x2 + y2, while unrelated question content is omitted.
  • Step regeneration: Step regeneration asks the LLM to achieve the extracted target using the collected context and variable definitions.The regenerated step rewrites 6x = x2 + y2 as (x −3)2 + y2 = 9, identifying center (3, 0) and radius 3.
  • Result comparison: Result comparison labels the regenerated step as contradicting the original when their circle centers and radii differ.The example compares centers (3, 0) and (3/2, 0), and radii 3 and 3/2, then assigns contradiction.

APPENDIX B EXAMPLAR FOR ONE-SHOT ERROR CHECKING

Appendix B demonstrates one-shot error checking through grounding, reasoning, and calculation checks, declaring the solution incorrect when any check fails.

  • Grounding check: Grounding checking traces each quantity in the reasoning to the given information and fails when numbers are ungrounded.The example marks 3 and 6 as ungrounded while linking 5, 50%, $1, and $2 to the supplied information.
  • Reasoning check: Reasoning checking tests whether the logic correctly answers the question and identifies mistakes in the fruit-counting argument.The example says calculating Alice’s total number of fruits is unnecessary for answering the cost question.
  • Calculation check: Calculation checking verifies consistency between equations and answers, distinguishing a correct cost calculation from an inconsistent fruit-count equation.The $1 * (5 - 3) = $2 calculation is consistent, whereas 5 + x + 2x is inconsistent with 5 + 4x.
  • Check results: The example concludes that the reasoning is incorrect because grounding, reasoning, and calculation checks all fail.The rule states that any failed check makes the reasoning incorrect, producing the answer “no.”
Loading 2308.00436v3…