NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

GRACE: Discriminator-Guided Chain-of-Thought Reasoning

Muhammad Khalifa, Lajanugen Logeswaran, Moontae Lee, Honglak Lee, Lu Wang

TL;DR

GRACE (Guiding chain-of-thought ReAsoning with a CorrectnEss Discriminator) is a novel decoding strategy that improves the reasoning accuracy of language models by using a small, step-level discriminator to "steer" the generation process. Unlike traditional methods that rank full solutions after they are finished, GRACE intervenes at every reasoning step, significantly boosting performance on math and symbolic tasks without requiring expensive human-labeled data or fine-tuning the base model.

What Problem Does This Paper Address?

Large Language Models (LLMs) have revolutionized reasoning through "Chain-of-Thought" (CoT) prompting, where they solve problems step-by-step. However, these models often suffer from a "logical drift": they might assign a very high probability to a reasoning step that is factually or logically incorrect. Once a model makes one wrong turn, the rest of the solution usually falls apart.

Standard decoding strategies like greedy search or beam search are "blind" to correctness; they simply follow the path of highest likelihood according to the model's training. Existing fixes like Self-Consistency (sampling many solutions and taking the majority vote) or Verifiers (ranking completed solutions) are applied only after the model has finished generating, meaning they can't prevent the model from going off the rails in the first place. Furthermore, training step-level verifiers usually requires massive amounts of human-annotated data, which is difficult to scale.

Figure 1: A math question from GSM8K (Cobbe et al., 2021), a solution prefix, and candidate next steps sorted in descend- ing order by their average token probability according to a few-shot prompted LLaMA13B. The correct next step is as- signed a significantly lower probability than the incorrect ones. GRACE solves this issue by calibrating candidate step likeli- hoods based on the step correctness.

Methods

The authors propose a three-stage pipeline to create a "guide" for the decoding process:

  1. Negative Sampling: They first let the LM generate many solutions and keep only the ones that result in an incorrect final answer. These serve as examples of "how the model fails."
  2. Automatic Step Alignment: To identify exactly where the model failed without human help, they use a modified Needleman-Wunsch algorithm (a technique borrowed from bioinformatics for aligning DNA sequences). By comparing an incorrect sampled solution to a correct reference solution, the algorithm automatically labels individual steps as correct, incorrect, missing, or extra.
  3. Discriminator Learning: They train a relatively small model (a FLAN-T5 encoder) using a max-margin contrastive loss. This teaches the discriminator to assign higher scores to correct steps and lower scores to incorrect ones.

During Guided Stepwise Decoding, the LM generates a pool of candidate next steps. GRACE scores these candidates by combining their original LM probability with the discriminator's correctness score. The best-scoring step is selected, and the process repeats until the final answer is reached.

Figure 2: Top: The three-step process to train the discriminator. (1) Sampling solutions from a given language model with different mistakes by keeping the solutions with the incorrect final answers only. (2) Aligning the sampled solutions with the reference solutions to identify incorrect steps. (3) Learning the discriminator with a max-margin loss to assign high scores to correct steps and low scores to incorrect steps. Bottom: The guided stepwise decoding process using the trained discriminator. Given the question and the prefix, we sample a pool of candidate next steps and use the discriminator to score steps as in Equation (6). The top-scored step is then selected and added to the prefix. This process repeats until a final answer is generated.

Datasets

The researchers evaluated GRACE across six challenging benchmarks:

  • Math Reasoning: GSM8K (grade school math), MathQA-Gain, SVAMP, and MultiArith.
  • Symbolic Reasoning: Coin Flip (tracking the state of a coin) and Tracking Shuffled Objects (TSO).

For datasets lacking step-by-step gold standards, they used "distillation," prompting GPT-3.5-turbo to generate high-quality reference solutions.

Key Insights and Ideas

  • Small Guides for Big Models: One of the most striking findings is that a very small discriminator (e.g., 340M parameters) can effectively guide a much larger model (e.g., LLaMA-13B). This suggests that recognizing a correct reasoning step is a much easier task than generating one.
  • Alignment over Annotation: By using sequence alignment (Figure 3), the authors bypassed the need for human step-level labels. This makes the approach much more scalable for new domains.
  • The "Aha" Moment in Decoding: The paper shows that simply increasing the probability of the "correct" step during decoding is more efficient than sampling dozens of full solutions and hoping one is right. As shown in Figure 4, GRACE is significantly more sample-efficient than vanilla Self-Consistency.
Figure 3: An example of the alignment produced by our alignment algorithm (described in Algorithm 2). The question and the reference solutions come from GSM8K (Cobbe et al., 2021). The “—” designates an empty step placeholder. There are three possible cases when aligning a reference solution with a sampled solution: missing, extra, and comparable steps. In the comparable case, the intermediate variables (underlined) are compared to determine the correctness of the sampled step.

Key Results

  • Accuracy Boosts: On the GSM8K math benchmark, GRACE improved the accuracy of FLAN-T5-Large by 7.4% over greedy decoding. When combined with Self-Consistency, it outperformed the vanilla baseline by 10.2%.
  • Better Reasoning, Not Just Better Answers: Human evaluations confirmed that GRACE doesn't just stumble onto the right answer more often; it actually reduces the "trace error" (logical mistakes in the middle of a solution) by 44%.
  • Cross-Task Robustness: A discriminator trained on one math dataset (like GSM8K) still provided a significant performance boost when applied to a different one (like SVAMP), proving the learned notion of "correctness" generalizes well.

Limitations and Future Work

While powerful, GRACE has a few hurdles:

  • Computational Cost: Scoring multiple candidate steps at every stage increases the time and compute required for inference.
  • Candidate Quality: GRACE can only choose from the candidates the LM provides. If the base model is so weak that it doesn't generate any correct next-step options, the discriminator cannot save the solution.
  • Reference Dependency: The method still requires access to correct final answers and reference solutions to train the initial discriminator.

Future work includes applying this alignment logic to Reinforcement Learning from Human Feedback (RLHF) and extending the method to work with black-box model APIs where internal probabilities aren't visible.

Summary updated

BibTeX
@inproceedings{khalifa2023grace,
  author = {Muhammad Khalifa and Lajanugen Logeswaran and Moontae Lee and Honglak Lee and Lu Wang},
  title = {{GRACE: Discriminator-Guided Chain-of-Thought Reasoning}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.1022},
}
Figure