Source-linked AI summary

Forward-Backward Reasoning in Large Language Models for Mathematical Verification

Weisen Jiang, Han Shi, Longhui Yu, Zhengying Liu, Yu Zhang, Zhenguo Li, James T. Kwok

arXiv:2308.07758v6cs.CLcs.AIcs.LG

TL;DR

Self-Consistency can saturate when more reasoning chains are sampled, leaving a need for more reliable candidate-answer verification. The paper uses masked-number backward questions and combines backward with forward reasoning in FOBAR. It reports state-of-the-art mathematical results and superior performance on non-mathematical tasks.

  • Problem

    Self-Consistency may stop improving with additional sampled chains, even though some failed questions have a chain reaching the correct answer.

    Source: §1 · p. 1
  • Method

    FOBAR checks candidate answers by asking an LLM to recover a masked number from a backward question, then combines backward and forward reasoning.

    Source: §1 · p. 2
  • Results

    FOBAR achieves state-of-the-art performance on six standard mathematical datasets and three LLMs, and outperforms Self-Consistency and Self-Verification in reported comparisons.

    Source: §1 · p. 2, §5 · p. 9
  • Takeaways & Limitations

    The authors report that FOBAR also achieves superior performance on non-mathematical tasks.

    Source: §5 · p. 9

    Extensions to more complicated non-mathematical tasks such as CSQA and StrategyQA remain unexplored because identifying informative words to mask is more challenging.

    Source: Limitations and Potential Risks · p. 9

Abstract

from arXiv · show

Self-Consistency samples diverse reasoning chains with answers and chooses the final answer by majority voting. It is based on forward reasoning and cannot further improve performance by sampling more reasoning chains when saturated. To further boost performance, we introduce backward reasoning to verify candidate answers. Specifically, for mathematical tasks, we mask a number in the question and ask the LLM to answer a backward question created by a simple template, i.e., to predict the masked number when a candidate answer is provided. Instead of using forward or backward reasoning alone, we propose FOBAR to combine FOrward and BAckward Reasoning for verification. Extensive experiments on six standard mathematical data sets and three LLMs show that FOBAR achieves state-of-the-art performance. In particular, FOBAR outperforms Self-Consistency, which uses forward reasoning alone, demonstrating that combining forward and forward reasoning is better. In addition, FOBAR performs better than existing verification methods, showing the effectiveness of the simple template used in backward reasoning and the proposed combination. Extensions to non-mathematical problems are also discussed and validated empirically.

1 Introduction

Self-Consistency can stop improving once its sampled reasoning paths saturate, motivating a more reliable way to verify candidate answers. The paper introduces masked-number backward reasoning and combines it with forward reasoning in FOBAR, reporting state-of-the-art results across mathematical benchmarks.

1 Introduction

  • Self-Consistency can saturate as more reasoning paths are sampled, although about 60% of its failure questions have at least one chain reaching the correct answer.This motivates improving majority voting with a more reliable verifier.Source: §1 · p. 1
  • Backward reasoning verifies a candidate by masking a question number and asking the LLM to predict it when given that candidate answer.The backward probability is the proportion of sampled backward chains that exactly predict the masked number.Source: §1 · p. 2
  • FOBAR estimates candidate correctness using the geometric mean of its forward and backward vote proportions.Forward votes are the basis of Self-Consistency, while the backward vote checks whether the candidate helps recover the masked value.Source: §1 · p. 2
  • FOBAR achieves state-of-the-art performance across six standard mathematical benchmarks and three LLMs, outperforming Self-Consistency and Self-Verification in reported comparisons.The authors attribute these results to combining forward and backward reasoning and to the backward-question template.Source: §1 · p. 2

2 Related Work

Related work develops chain-of-thought prompting and methods for improving or selecting reasoning chains through forward reasoning. The paper contrasts these approaches with backward verification and describes existing methods that use backward reasoning differently.

2 Related Work

  • Chain-of-thought prompting augments question-answer examples with reasoning steps, then prompts the LLM to generate a reasoning chain and answer for a new question.The cited work reports strong performance for CoT across a variety of tasks.Source: §2 · p. 2
  • ComplexCoT selects examples with more steps and PHP reuses previous answers as hints; these approaches are categorized as forward reasoning from question to answer.Self-Consistency samples diverse chains and selects the final answer by majority voting.Source: §2 · p. 3
  • Self-Verification rewrites a question with an answer into a declarative statement, while RCoT regenerates question text and checks for factual inconsistency through three steps.The authors contrast those procedures with their simpler template and string-comparison check.Source: §2 · p. 3
  • Unlike Self-Verification and RCoT, which use backward reasoning alone, FOBAR combines backward with forward reasoning for verification.MetaMath uses backward reasoning to augment questions for finetuning, whereas this paper focuses on verification.Source: §2 · p. 4

3 Forward-Backward Reasoning for Verification

The section develops FOBAR by scoring candidate answers with forward votes and backward masked-number recovery, then combining those signals for verification.

3.1 Forward Reasoning

  • Forward reasoning samples multiple answer-generating chains and estimates each candidate’s correctness from its vote share; Self-Consistency performance saturates as sampling grows.Further sampling then brings negligible performance improvement.Source: §3.1 · p. 4

3.2 Backward Reasoning

  • For each candidate answer, FOBAR masks each question number, forms backward questions with a fixed template, and scores exact masked-number predictions.The candidate’s backward probability can also be used alone to select an answer.Source: §3.2 · pp. 4–5

3.3 FOBAR (FOrward and BAckward Reasoning)

  • Because forward and backward reasoning can succeed in different cases, FOBAR combines their candidate-answer probabilities using a geometric mean with α = 0.5.It selects the candidate with the highest combined probability.Source: §3.3 · p. 5
  • FOBAR is training-free, requires no additional data collection, and adds negligible computation for its probability calculations.The backward approach can also be combined with other forward methods, including step-by-step verification.Source: §3.3 · p. 5

3.4 Extension to Non-Mathematical Tasks

  • For non-mathematical tasks, the section proposes masking an informative word and asking the LLM to recover it given a candidate answer.The example uses a word-masked Last Letter Concatenation question.Source: §3.4 · p. 5

4 Experiments

Experiments evaluate FOBAR across six mathematical benchmarks and three LLMs, testing its overall performance, design choices, and extensions. FOBAR combines forward and backward reasoning, and the experiments report benefits over forward-only and other verification methods.

4.1 Setup

  • The evaluation uses six mathematical benchmarks, three LLMs, CoT and ComplexCoT prompts, and matched forward-chain counts for FOBAR and its comparison methods.Sampling temperature is 0.7, α is 0.5, and MB is 8; MF is 40 for text-davinci-003 and 10 for GPT-3.5-Turbo and GPT-4.Source: §4.1 · pp. 5–6

4.2 Main Results

  • FOBAR with ComplexCoT achieves the highest average accuracy for all three LLMs; it outperforms Self-Consistency most of the time and Self-Verification on almost all datasets.The comparison covers six mathematical datasets; FOBAR with either CoT or ComplexCoT on GPT-4 achieves the highest average accuracy.Source: §4.2 · p. 6, Table 1 · p. 7

4.3 Combining Forward and Backward Probabilities

  • FOBAR is insensitive to α over a broad range, and the arithmetic and geometric means have comparable performance, indicating robustness to probability combination.The experiments use α = 0.5, corresponding to the geometric mean.Source: §4.3 · p. 6, Figure 3 · p. 7, Figure 4 · p. 7

4.4 Usefulness of Forward and Backward Reasoning

  • Across the tested settings, using either forward or backward reasoning beats using neither, while combining both is consistently best.The four settings are greedy decoding, Self-Consistency, backward-only selection, and FOBAR.Source: §4.4 · p. 7, Table 2

4.5 Correct Candidate Helps Backward Reasoning

  • 2× higher masked-number prediction accuracy with correct rather than wrong candidate answers supports the use of backward reasoning to verify candidates.The accuracy is averaged over backward questions across the six datasets.Source: Figure 5 · p. 8, §4.5 · p. 8

4.6.1 Varying MF; 4.6.2 Varying MB

  • FOBAR accuracy saturates quickly as MF and MB increase; very small MF (≤5) or MB (≤4) is undesirable, and FOBAR accuracy curves exceed Self-Consistency.Using small chain counts can reduce computational cost while maintaining a good performance-efficiency balance.Source: Figure 6 · p. 8, §4.6.1 · p. 8, Figure 7 · p. 8

4.7 Extension to Non-Mathematical Tasks

  • On Date Understanding and Last Letter Concatenation, FOBAR outperforms all baselines with either CoT or ComplexCoT as the base prompt.All CoT-based methods significantly outperform ICL on these tasks.Source: Table 3 · p. 8, §4.7 · p. 9

4.8 Failure Cases of Self-Consistency and FOBAR

  • About 60% of Self-Consistency failure cases contain at least one correct chain, and FOBAR rectifies 54 of the 294 such cases.The remaining 40% have no correct chain and thus cannot be solved by backward reasoning.Source: Table 4 · p. 9, Table 5 · p. 9, §4.8 · p. 9

5 Conclusion

The paper studies verification of candidate answers to mathematical problems and introduces backward reasoning and FOBAR to combine it with forward reasoning. Experiments across six mathematical data sets and three LLMs report state-of-the-art performance, with extensions to non-mathematical tasks also performing well.

5 Conclusion

  • FOBAR combines forward and backward reasoning to verify candidate answers to mathematical problems.Backward reasoning is introduced to complement using only forward reasoning for verification.Source: §5 · p. 9
  • Across six standard mathematical data sets and three LLMs, FOBAR achieves state-of-the-art performance on mathematical reasoning tasks.Source: §5 · p. 9
  • FOBAR is also used on non-mathematical tasks and achieves superior performance.Source: §5 · p. 9

Limitations and Potential Risks

The paper focuses on mathematical reasoning, while reporting two non-mathematical extensions; more complicated tasks remain to be explored. The appendices demonstrate backward questions and contrast FOBAR’s template with a rewriting approach.

Limitations and Potential Risks

  • The study focuses on mathematical reasoning and two non-mathematical tasks; CSQA and StrategyQA remain unexplored because informative words are harder to identify for masking.Source: Limitations and Potential Risks · p. 9
  • Superfluous numbers may be unpredictable from a candidate answer, but FOBAR remains applicable; detecting redundant numbers is challenging and left for future work.Source: Limitations and Potential Risks · p. 9
  • The datasets contain no information identifying individuals and no offensive content, so the authors report no ethical or data-privacy concerns.Source: Limitations and Potential Risks · p. 9

A Question-Answer Demos of Backward Reasoning

B Example Rewriting Mistake in Self-Verification

C Example Cases showing that Forward and Backward Reasoning are Complementary

The examples illustrate complementary failures: forward reasoning can fail where backward reasoning succeeds, and vice versa. FOBAR chooses the correct answer in both cases.

C Example Cases showing that Forward and Backward Reasoning are Complementary

D.1 Comparison between FOBAR and Trained Verifiers

The paper compares FOBAR with a trained verifier on GSM8K, reporting a higher accuracy for FOBAR. It also emphasizes that backward-reasoning verification is training-free and needs no additional data collection.

D.1 Comparison between FOBAR and Trained Verifiers

  • Unlike training an LLM for verification, backward-reasoning verification is training-free and requires no additional data collection.Source: §D.1 · p. 14
  • +14.8: FOBAR performs better than the trained verifier on GSM8K accuracy.Source: Table 6 · p. 14, §D.1 · p. 14
  • The comparison concerns FOBAR and a trained verifier on GSM8K.Source: Table 6 · p. 14

D.2 Comparison between FOBAR and Step-by-Step Forward Verification

FOBAR's backward answer verification complements step-by-step forward verification, and combining them consistently boosts performance.

D.2 Comparison between FOBAR and Step-by-Step Forward Verification

  • Compared with Lightman et al. (2023), backward reasoning is training-free for verification and requires no additional data annotation.The passage characterizes Lightman et al.'s approach as computationally expensive to train and labor-intensive to label.Source: §D.2 · p. 14
  • Unlike Ling et al. (2023), which verifies forward-chain steps, backward reasoning verifies candidate answers and can complement step-by-step methods.Source: §D.2 · p. 14
  • The paper reports that combining backward reasoning with forward-reasoning methods consistently boosts performance; it evaluates Ling et al.’s (2023) step-by-step verification on AddSub, GSM8K, and AQuA using GPT-3.5-Turbo.Source: §D.2 · pp. 14–15

E Data Sets

The section reports statistics for the data sets used in the experiments.

E Data Sets

Loading 2308.07758v6…