STaR: Bootstrapping Reasoning With Reasoning

Eric Zelikman, Yuhuai Wu, Jesse Mu, Noah D. Goodman

TL;DR

The paper introduces the Self-Taught Reasoner (STaR), a method that allows Large Language Models (LLMs) to bootstrap their own reasoning abilities. By iteratively prompting a model to generate step-by-step rationales, filtering for those that yield the correct answer, and fine-tuning on the successes, STaR enables smaller models to achieve reasoning performance comparable to much larger models without requiring massive human-annotated datasets.

The Problem: The Cost of Reasoning

Recent research has shown that prompting LLMs to generate step-by-step "chain-of-thought" reasoning (or "rationales") before outputting a final answer dramatically improves their performance on complex tasks like math and logic.

However, getting a model to reliably generate these rationales presents a dilemma. Researchers typically have to choose between two suboptimal paths:

  1. Fine-tuning the model on a massive dataset of human-written step-by-step solutions, which is prohibitively expensive and unscalable for every new problem domain.
  2. Using few-shot prompting (giving the model a few examples in the prompt), which is cheap but generally underperforms models that are fine-tuned directly on large datasets of questions and answers.

The authors tackle this gap: How can we get the high accuracy of a fine-tuned model and the reasoning benefits of chain-of-thought, without paying humans to write thousands of explanations?

Methods: The STaR Bootstrapping Loop

The authors propose STaR, an iterative bootstrapping loop that uses the model's own outputs to train itself.

The STaR bootstrapping loop with rationalization

The process works as follows:

  1. Rationale Generation: Start with a pre-trained LLM and a dataset of questions with known correct answers (but no rationales). Use a few-shot prompt to ask the model to generate a step-by-step rationale and a final answer for every question in the dataset.
  2. Filtering: Throw away any generated rationales that led to the wrong final answer. Keep the ones that led to the correct answer.
  3. Fine-tuning: Fine-tune the base LLM on the successful rationale-answer pairs.
  4. Repeat: Use this newly fine-tuned model to generate rationales for the dataset again, and repeat the loop.

The "Rationalization" Hack: The standard STaR loop eventually stalls because the model cannot learn to solve problems that are entirely beyond its current abilities. If it never guesses the right answer, it never generates training data for that problem. To fix this, the authors introduce rationalization. For problems the model fails, they provide the correct answer as a hint and ask the model to work backward to justify it. If the model successfully generates a rationale that leads to the provided answer, that rationale is added to the training set (with the hint removed).

Datasets

The authors evaluated STaR on three distinct reasoning tasks:

  • Arithmetic: A custom-generated dataset of $n$-digit integer addition (1 to 5 digits), requiring the model to generate a "scratchpad" of carry-over math.
  • CommonsenseQA (CQA): A multiple-choice question-answering dataset requiring general world knowledge and semantic reasoning.
  • Grade School Math (GSM8K): A benchmark of natural language math word problems requiring multi-step calculations.

Key Insights

  • Self-Improvement is Possible: LLMs can use their own rudimentary, pre-existing reasoning skills to generate high-quality training data, effectively pulling themselves up by their own bootstraps.
  • Working Backwards Unlocks Hard Problems: "Rationalization" is a powerful heuristic. Knowing the destination makes finding the path much easier for the model. This prevents the bootstrapping process from plateauing too early.
  • Correct Answers are a Proxy for Good Reasoning: Filtering generated rationales strictly by the correctness of the final answer acts as a highly effective, automated quality control mechanism. The authors note this approximates a Reinforcement Learning (RL) policy gradient objective.

Key Results

  • CommonsenseQA: A 6B parameter model (GPT-J) trained with STaR achieved 72.5% accuracy. This vastly outperformed a few-shot baseline (36.6%) and a direct fine-tuned baseline (60.0%). Remarkably, it performed comparably to a fine-tuned GPT-3 model that is 30x larger (73.0%).
  • Arithmetic: STaR achieved 89.5% accuracy on 1-5 digit addition after 16 iterations, compared to near 0% for few-shot prompting and 76.3% for a standard fine-tuned baseline.
  • Grade School Math (GSM8K): Accuracy improved to 10.7%, compared to 3.1% for few-shot chain-of-thought and 5.8% for direct fine-tuning.
  • Human Preference: In a small qualitative study, human evaluators actually preferred STaR-generated rationales over human-generated ones from a crowdsourced dataset 74% of the time, highlighting the high quality of the self-generated text.

Limitations and Future Work

  • Right Answer, Wrong Reason: The model sometimes generates a nonsensical, logically flawed, or biased rationale that coincidentally leads to the correct answer. Because STaR only filters by the final answer, this "bad" reasoning gets reinforced.
  • Faithfulness: It is difficult to prove that the generated text rationale actually reflects the model's internal decision-making process (it might just be generating a post-hoc justification).
  • Minimum Capability Threshold: The base model must be large/capable enough to get some questions right via few-shot prompting initially. If initial accuracy is 0%, the bootstrapping loop cannot start (e.g., the authors noted GPT-2 was too small to bootstrap).
  • Future Work: The authors suggest exploring better ways to filter out bad reasoning that accidentally yields correct answers (e.g., token-level verifiers) and formally linking the "rationalization" step to RL objectives.

Summary updated

BibTeX
@inproceedings{zelikman2022star,
  author = {Eric Zelikman and Yuhuai Wu and Jesse Mu and Noah D. Goodman},
  title = {{STaR: Bootstrapping Reasoning With Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=gZqhtYkWa6r},
}
Figure