size_categories:n<1K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
datasets:
- yemara/best_of_n_comparison
---

# Best-of-N vs. Greedy Solutions

## Dataset Description

This dataset contains 20 math problems (levels 1–3 from MATH-500) and three sets of predictions:

- **Greedy**: Single-step deterministic decoding
- **Vanilla Best-of-N**: Highest-reward chain-of-thought out of N solutions
- **Weighted Best-of-N**: Sum of reward across identical final answers (DeepMind & Math-Shepherd approach)

### Columns

- **unique_id**: Unique identifier for the problem (e.g. “test/prealgebra/1747.json”).
- **problem**: The math question in text form.
- **ground_truth**: Official numeric or symbolic correct answer.
- **greedy_solution**: The answer from a single greedy pass.
- **vanilla_BoN_solution**: The top solution from sampling N=16, picking highest single reward.
- **weighted_BoN_solution**: The top final answer from summing rewards among identical solutions.

### Construction

1. **Data Source**: Filtered 20-problem subset of MATH-500 (levels 1–3).
2. **Greedy** generation: Qwen/Qwen2.5-1.5B-Instruct with do_sample=False, temperature=0.0, etc.
3. **Sampled** generation for Best-of-N: N=16 solutions per problem, same model but do_sample=True, temperature=0.7, top_p=0.9.
4. **Reward Model**: Skywork/Skywork-o1-Open-PRM-Qwen-2.5-1.5B, using last-step aggregator.

### Usage

```python
from datasets import load_dataset

ds = load_dataset("YourUsername/best_of_n_comparison")
print(ds)
```
