B-STaR: Monitoring and Balancing Exploration and Exploitation in Self-Taught Reasoners

Weihao Zeng, Yuzhen Huang, Lulu Zhao, Yijun Wang, Zifei Shan, Junxian He

TL;DR

Self-improvement methods for Large Language Models (LLMs) often plateau quickly because they fail to maintain a healthy balance between discovering new solutions (exploration) and accurately selecting the best ones (exploitation). B-STaR (Balanced Self-Taught Reasoner) solves this by dynamically adjusting sampling temperatures and reward thresholds at every training iteration, leading to sustained performance gains across math, coding, and commonsense reasoning tasks.

What Problem Does This Paper Address?

Training LLMs on complex reasoning tasks is bottlenecked by the scarcity of high-quality, human-annotated data. "Self-improvement" techniques—where a model generates multiple solutions to a problem and is then fine-tuned on the ones deemed "correct" by a reward function—have emerged as a scalable alternative.

However, these methods (like STaR or Rejection Fine-Tuning) typically stall after just a few iterations. The authors identify two primary culprits:

  1. Exploration Decay: As models improve, they often become "overconfident" and less diverse, failing to generate new, high-quality reasoning paths that go beyond their current greedy decoding.
  2. Exploitation Mismatch: Reward functions (like checking a final math answer or running unit tests) can become less effective at distinguishing truly high-quality reasoning from "lucky" guesses as the model's output distribution shifts during training.

Existing methods treat hyperparameters like sampling temperature as static, which fails to account for the model's evolving needs during the training process.

Methods

The authors introduce B-STaR, a framework that treats self-improvement as a dynamic balancing act. The core innovation is the Balance Score ($bs_i$), a metric designed to capture the interplay between exploration and exploitation:

$$bs_i = \min \left( \frac{n'_i}{n^\star}, 1 \right) \cdot \frac{n'_i}{n_i}$$

Where:

  • $n_i$ is the total number of selected responses for a query.
  • $n'_i$ is the number of unique, correct responses among them.
  • $n^\star$ is a target number of correct solutions desired per query.

The first term rewards exploration (finding a sufficient quantity of unique correct solutions), while the second term rewards exploitation (ensuring a high proportion of the selected data is actually correct to avoid training set contamination).

Figure 2: Illustration of the B-STAR approach. In each iteration, we first identify the configurations – temperature ti and reward threshold τi – that maximize the average balance scores using a small subset of training queries. Next, we apply the optimal temperature and threshold to generate and reward the full set of training queries. Finally, we update the model based on the selected data.

In each iteration, B-STaR uses a small subset of training queries to find the optimal sampling temperature ($t_i$) and reward threshold ($\tau_i$) that maximize the average balance score. It then applies these "balanced configurations" to generate the full training set for that iteration.

Datasets

The authors evaluated B-STaR across several challenging benchmarks:

  • Mathematical Reasoning: GSM8K and MATH (using Mistral-7B and Llama-3.1-8B).
  • Coding: APPS (using Llama-3-8B and Llama-3.1-8B).
  • Commonsense Reasoning: ARC-Challenge (using Mistral-7B and Llama-3.1-8B).

Key Insights and Ideas

  • Static Hyperparameters are a Bottleneck: The authors discovered that the "optimal" settings change over time. Early in training, lower temperatures (for accuracy) and stricter reward thresholds are better. As the model matures, higher temperatures are needed to maintain diversity (exploration), and thresholds may need to relax to capture more complex reasoning paths.
  • Exploration Deteriorates Rapidly: Without intervention, a model's ability to generate diverse correct solutions (measured by metrics like Pass@32-4) often plateaus or even declines, even as its greedy accuracy (Pass@1) appears to improve.
  • Reward Models Help Exploration: Integrating a Process Reward Model (PRM) alongside final-answer checking significantly helps the model retain exploratory capabilities compared to using final-answer rewards alone.
Dynamic shifts in optimal temperature and threshold

Key Results

B-STaR consistently outperformed strong baselines like Online RFT and STaR/ReST-EM. Crucially, while other methods saw performance flatten out, B-STaR maintained a steady upward trajectory.

  • GSM8K: B-STaR achieved 53.8% Pass@1, a significant jump over Online RFT's 46.8%.
  • MATH: B-STaR reached 27.8% Pass@1, compared to 23.2% for Online RFT.
  • Sustained Growth: As shown in Figure 1, B-STaR avoids the early saturation seen in other iterative methods, continuing to improve throughout the training process.
Figure 1: Pass@1 accuracy over training steps on GSM8K, MATH, APPS, and ARC-Challenge. The GSM8K, MATH, and ARC-C results are from Mistral-7B, while the APPS scores are obtained based on Llama3-8B. We compare multiple baselines, including SFT, Online RFT, STaR/ReST-EM, and Iterative RFT, against our proposed B-STAR. For further details on the experimental settings, please refer to §4.1.

Limitations and Future Work

The authors acknowledge that B-STaR currently relies on manipulating high-level hyperparameter configurations (temperature and threshold). While effective, this is a relatively coarse-grained way to control exploration and exploitation.

Future work could explore:

  • Advanced Decoding: Using more sophisticated decoding strategies to directly steer exploration.
  • Dynamic Reward Updating: Iteratively updating the reward model itself to keep pace with the evolving policy model, further enhancing exploitation.
  • Broader Tasks: Applying the framework to even more open-ended reasoning tasks where "correctness" is harder to define than in math or code.

Summary updated

BibTeX
@inproceedings{zeng2025b,
  author = {Weihao Zeng and Yuzhen Huang and Lulu Zhao and Yijun Wang and Zifei Shan and Junxian He},
  title = {{B-STaR: Monitoring and Balancing Exploration and Exploitation in Self-Taught Reasoners}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=P6dwZJpJ4m},
}
Figure