Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<p align="center">
|
| 2 |
-
<img src="
|
| 3 |
</p>
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
## Introduction
|
| 7 |
|
| 8 |
* **ReasonLite is an ultra-lightweight math reasoning model.** With only 0.6B parameters, it leverages **high-quality data distillation** to achieve performance comparable to models over 10× its size, such as Qwen3-8B, **reaching 75.2 on AIME24 and extending the scaling law of small models.**
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
-
<img src="
|
| 13 |
</p>
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
The model is trained in **two progressive distillation stages**.
|
| 18 |
First, short-CoT data is used to distill **Qwen3-0.6B** into **AMD-0.6B-Turbo**, improving **AIME24 accuracy from 11.0 → 57.1**.
|
| 19 |
Then, long-CoT data is used to obtain **AMD-0.6B**, further boosting accuracy to **75.2**.
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
-
**
|
| 28 |
-
- **avg@16**: The average accuracy over 16 independently generated answers.
|
| 29 |
-
- **pass@8**: The probability that at least one correct answer appears among 8 generated samples.
|
| 30 |
|
|
|
|
|
|
|
| 31 |
|
| 32 |
| Model | Parameters | AMC23 avg@16 | AMC23 pass@8 | AIME25 avg@16 | AIME25 pass@8 | AIME24 avg@16 | AIME24 pass@8 |
|
| 33 |
|---------------------------|------------|-------------|-------------|---------------|---------------|---------------|---------------|
|
|
@@ -44,204 +64,25 @@ Then, long-CoT data is used to obtain **AMD-0.6B**, further boosting accuracy to
|
|
| 44 |
| ReasonLite-0.6B-Turbo | 0.6B | 81.6 | 99.3 | 42.7 | 69.2 | 57.1 | 79.6 |
|
| 45 |
| **ReasonLite-0.6B** | **0.6B** | **95.2** | **100** | **62.9** | **84.1** | **75.2** | **90.2** |
|
| 46 |
|
| 47 |
-
**Model Link**
|
| 48 |
|
| 49 |
-
|
| 50 |
-
| ------------------------- | ----------------------------------------------| ------ | ---- |
|
| 51 |
-
| **amd/ReasonLite-0.6B-Turbo** | Short CoT balancing performance and efficiency | 57.1 | [🤗 HuggingFace](https://huggingface.co/amd/ReasonLite-0.6B-Turbo) |
|
| 52 |
-
| **amd/ReasonLite-0.6B** | Long CoT for high performance | 75.2 | [🤗 HuggingFace](https://huggingface.co/amd/ReasonLite-0.6B) |
|
| 53 |
-
|
| 54 |
-
## Dataset
|
| 55 |
|
| 56 |
-
|
| 57 |
-
* Using the **GPT-OSS** model as the teacher, **9.1M** model-generated raw answers were collected under both medium and high reasoning modes.
|
| 58 |
-
* Pseudo-labels are created by majority voting over the model outputs.
|
| 59 |
-
* Finally, **6.1M samples** were retained, including **4.3M medium-level** and **1.8M high-level** reasoning data.
|
| 60 |
-
|
| 61 |
-
<p align="center">
|
| 62 |
-
<img src="img/img_data.png" alt="ReasonLite" height="500">
|
| 63 |
-
</p>
|
| 64 |
-
|
| 65 |
-
**Dataset Link**
|
| 66 |
|
| 67 |
| Dataset | Description | Size | Link |
|
| 68 |
| ---------------------- | ------ |---- | ---- |
|
| 69 |
| **amd/ReasonLite-Dataset** | Short CoT | 4.3M | [🤗 HuggingFace](https://huggingface.co/datasets/amd/ReasonLite-Dataset/viewer/default/medium) |
|
| 70 |
-
| **amd/ReasonLite-Dataset** | Long
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
## Setup Environment
|
| 74 |
-
|
| 75 |
-
Docker:
|
| 76 |
-
|
| 77 |
-
```bash
|
| 78 |
-
# Recommended ROCm Docker
|
| 79 |
-
rocm/vllm-dev:open-mi300-08052025
|
| 80 |
-
|
| 81 |
-
# Recommended CUDA Docker (latest vLLM)
|
| 82 |
-
docker.io/vllm/vllm-openai:latest
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
-
Install Python packages for data synthesis and evaluation:
|
| 86 |
-
|
| 87 |
-
```bash
|
| 88 |
-
pip install -r requirements.txt
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
## Model Training
|
| 92 |
-
|
| 93 |
-
This project uses [open-r1](https://github.com/huggingface/open-r1?tab=readme-ov-file#sft-distillation) as the training codebase, but you can use any other training framework as well.
|
| 94 |
-
Below are example launch scripts and YAML configurations used in our experiments.
|
| 95 |
-
|
| 96 |
-
```
|
| 97 |
-
# Stage 1 SFT
|
| 98 |
-
|
| 99 |
-
# Example training script:
|
| 100 |
-
train/stage1.sh
|
| 101 |
-
|
| 102 |
-
# Example YAML config:
|
| 103 |
-
train/config_stage1.yaml
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
# Stage 2 SFT
|
| 107 |
-
|
| 108 |
-
# Example training script:
|
| 109 |
-
train/stage2.sh
|
| 110 |
-
|
| 111 |
-
# Example YAML config:
|
| 112 |
-
train/config_stage2.yaml
|
| 113 |
-
```
|
| 114 |
-
|
| 115 |
-
## Model Evaluation
|
| 116 |
-
|
| 117 |
-
Example for evaluating **ReasonLite-0.6B on AIME24**. The evaluation scripts are based on [DeepMath](https://github.com/zwhe99/DeepMath).
|
| 118 |
-
|
| 119 |
-
```bash
|
| 120 |
-
cd eval
|
| 121 |
-
python3 start.py -c config/eval.yaml
|
| 122 |
-
```
|
| 123 |
-
|
| 124 |
-
## Data Generation Pipeline
|
| 125 |
-
|
| 126 |
-
You will need to edit the configuration file `config/oss.yaml`, or create a new one based on your own needs.
|
| 127 |
-
Then you may run through the full pipeline as follows.
|
| 128 |
-
|
| 129 |
-
### Start vLLM Server
|
| 130 |
-
|
| 131 |
-
```bash
|
| 132 |
-
python3 vllm_start.py -c config/oss.yaml
|
| 133 |
-
```
|
| 134 |
-
|
| 135 |
-
### Synthetic Data
|
| 136 |
|
| 137 |
-
|
| 138 |
|
| 139 |
-
|
| 140 |
-
python3 infer.py -c config/oss.yaml -m infer
|
| 141 |
-
```
|
| 142 |
-
|
| 143 |
-
### Pseudo-Labels via Voting (Optional)
|
| 144 |
-
|
| 145 |
-
**Obtain pseudo-labels through majority voting**
|
| 146 |
-
|
| 147 |
-
```bash
|
| 148 |
-
python3 infer.py -c config/oss.yaml -m vote
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
### Judging Answer Correctness
|
| 152 |
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
```bash
|
| 156 |
-
python3 infer.py -c config/oss.yaml -m judge
|
| 157 |
-
```
|
| 158 |
-
|
| 159 |
-
**Judge correctness using pseudo-labels** (requires running `vote` first)
|
| 160 |
-
|
| 161 |
-
```bash
|
| 162 |
-
python3 infer.py -c config/oss.yaml -m judge_vote
|
| 163 |
-
```
|
| 164 |
-
|
| 165 |
-
### Filtering and Converting to Training Format
|
| 166 |
-
|
| 167 |
-
**Filter out incorrect solutions and convert the correct ones to training format.**
|
| 168 |
-
Specify the path to the judged data:
|
| 169 |
-
|
| 170 |
-
```bash
|
| 171 |
-
python3 utils/saving_to_training_format.py -d path/to/judged/data.jsonl
|
| 172 |
-
```
|
| 173 |
-
|
| 174 |
-
### Directory Structure for Data Storage
|
| 175 |
-
|
| 176 |
-
```
|
| 177 |
-
datas/
|
| 178 |
-
└── <experiment_name>/
|
| 179 |
-
├── info.jsonl # input prompts
|
| 180 |
-
├── answer_origin/ # raw generations
|
| 181 |
-
│ └── <timestamp>/
|
| 182 |
-
│ └── 0_1.jsonl
|
| 183 |
-
├── answer_judge/ # judged generations
|
| 184 |
-
│ └── <timestamp>/
|
| 185 |
-
│ └── 0_1.jsonl
|
| 186 |
-
├── vote/ # majority votes per prompt
|
| 187 |
-
│ └── <timestamp>/
|
| 188 |
-
│ └── 0_1.jsonl
|
| 189 |
-
└── answer_judge_vote/ # judged using vote labels
|
| 190 |
-
└── <timestamp>/
|
| 191 |
-
└── 0_1.jsonl
|
| 192 |
-
```
|
| 193 |
-
|
| 194 |
-
### JSONL Examples
|
| 195 |
-
|
| 196 |
-
#### info.jsonl
|
| 197 |
-
|
| 198 |
-
The files `info.jsonl` and `vote/<timestamp>/0_1.jsonl` follow this format:
|
| 199 |
-
|
| 200 |
-
```jsonl
|
| 201 |
-
{
|
| 202 |
-
"prompt": "Solve the equation (x^2 - x - 2 = 0).",
|
| 203 |
-
"expected_answer": "5",
|
| 204 |
-
"index": "pol:0",
|
| 205 |
-
"vote": {"x=2,-1": 5, "x=2": 1} // Only in vote/<timestamp>/0_1.jsonl
|
| 206 |
-
}
|
| 207 |
-
```
|
| 208 |
-
|
| 209 |
-
* `prompt` contains the math problem
|
| 210 |
-
* `expected_answer` is the ground-truth label
|
| 211 |
-
* `index` is the global ID using the format `"dataset_name:index"`
|
| 212 |
-
* `vote` shows the voting results (only in vote files)
|
| 213 |
-
|
| 214 |
-
#### Intermediate Result JSONL
|
| 215 |
-
|
| 216 |
-
Files under
|
| 217 |
-
`answer_origin/<timestamp>/0_1.jsonl`,
|
| 218 |
-
`answer_judge/<timestamp>/0_1.jsonl`,
|
| 219 |
-
`answer_judge_vote/<timestamp>/0_1.jsonl`
|
| 220 |
-
follow this format:
|
| 221 |
-
|
| 222 |
-
```jsonl
|
| 223 |
-
{
|
| 224 |
-
"info": "<input info from info.jsonl>",
|
| 225 |
-
"index": "pol:0_3",
|
| 226 |
-
"model_input": "<full input ...>",
|
| 227 |
-
"model_output": "<full output with input prepended ...>",
|
| 228 |
-
"prompt": "The front tires of a car wear out after 25,000 km, ...",
|
| 229 |
-
"answer": "<model output ...>",
|
| 230 |
-
"judge": true // Only in answer_judge and answer_judge_vote
|
| 231 |
-
}
|
| 232 |
-
```
|
| 233 |
-
|
| 234 |
-
* Files under `answer_origin` contain raw model trajectories
|
| 235 |
-
* `answer_judge` and `answer_judge_vote` add the boolean `judge` flag indicating correctness
|
| 236 |
-
|
| 237 |
-
## Citation
|
| 238 |
-
|
| 239 |
-
```
|
| 240 |
@misc{reasonlite2025,
|
| 241 |
-
title
|
| 242 |
-
author
|
| 243 |
-
year
|
| 244 |
-
url
|
| 245 |
-
note = {Open-source project}
|
| 246 |
}
|
| 247 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
<p align="center">
|
| 8 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/66a056d0229269a861ac1245/9xXXms4ub9dzbcsN1IGqq.png" alt="ReasonLite" width="200">
|
| 9 |
</p>
|
| 10 |
|
| 11 |
+
<p align="center">
|
| 12 |
+
<a href="https://github.com/AMD-AIG-AIMA/ReasonLite"><b>GitHub</b></a> |
|
| 13 |
+
<a href="https://huggingface.co/datasets/amd/ReasonLite-Dataset"><b>Dataset</b></a> |
|
| 14 |
+
<b>Blog</b></a>
|
| 15 |
+
|
| 16 |
+
</p>
|
| 17 |
|
|
|
|
| 18 |
|
| 19 |
* **ReasonLite is an ultra-lightweight math reasoning model.** With only 0.6B parameters, it leverages **high-quality data distillation** to achieve performance comparable to models over 10× its size, such as Qwen3-8B, **reaching 75.2 on AIME24 and extending the scaling law of small models.**
|
| 20 |
+
|
| 21 |
+
* 🔥 **Best-performing 0.6B reasoning model**
|
| 22 |
+
* 🔓 Fully open-source — weights, scripts, datasets, synthesis pipeline
|
| 23 |
+
* ⚙️ Distilled in two stages for both **efficiency** and **high performance**
|
| 24 |
|
| 25 |
<p align="center">
|
| 26 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/66a056d0229269a861ac1245/2VZPy7mlgpq9vFvwDc00Q.png"" alt="ReasonLite" height="500">
|
| 27 |
</p>
|
| 28 |
|
| 29 |
+
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
# 🚀 Model
|
| 33 |
|
| 34 |
The model is trained in **two progressive distillation stages**.
|
| 35 |
First, short-CoT data is used to distill **Qwen3-0.6B** into **AMD-0.6B-Turbo**, improving **AIME24 accuracy from 11.0 → 57.1**.
|
| 36 |
Then, long-CoT data is used to obtain **AMD-0.6B**, further boosting accuracy to **75.2**.
|
| 37 |
|
| 38 |
+
| Model | Description | AIME24 | Link |
|
| 39 |
+
| ------------------------- | ----------------------------------------------| ------ | ---- |
|
| 40 |
+
| **amd/ReasonLite-0.6B-Turbo** | Short CoT balancing performance and efficiency | 57.1 | [🤗 HuggingFace](https://huggingface.co/amd/ReasonLite-0.6B-Turbo) |
|
| 41 |
+
| **amd/ReasonLite-0.6B** | Long CoT for high performance | 75.2 | [🤗 HuggingFace](https://huggingface.co/amd/ReasonLite-0.6B) |
|
| 42 |
|
| 43 |
+
---
|
| 44 |
|
| 45 |
+
# 📊 Evaluation Results
|
| 46 |
|
| 47 |
+
**Metrics**
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
* **avg@16** — average accuracy from 16 sampled answers
|
| 50 |
+
* **pass@8** — probability at least one correct answer appears among 8 samples
|
| 51 |
|
| 52 |
| Model | Parameters | AMC23 avg@16 | AMC23 pass@8 | AIME25 avg@16 | AIME25 pass@8 | AIME24 avg@16 | AIME24 pass@8 |
|
| 53 |
|---------------------------|------------|-------------|-------------|---------------|---------------|---------------|---------------|
|
|
|
|
| 64 |
| ReasonLite-0.6B-Turbo | 0.6B | 81.6 | 99.3 | 42.7 | 69.2 | 57.1 | 79.6 |
|
| 65 |
| **ReasonLite-0.6B** | **0.6B** | **95.2** | **100** | **62.9** | **84.1** | **75.2** | **90.2** |
|
| 66 |
|
|
|
|
| 67 |
|
| 68 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
+
# 📚 Dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
| Dataset | Description | Size | Link |
|
| 73 |
| ---------------------- | ------ |---- | ---- |
|
| 74 |
| **amd/ReasonLite-Dataset** | Short CoT | 4.3M | [🤗 HuggingFace](https://huggingface.co/datasets/amd/ReasonLite-Dataset/viewer/default/medium) |
|
| 75 |
+
| **amd/ReasonLite-Dataset** | Long Cot | 1.8M | [🤗 HuggingFace](https://huggingface.co/datasets/amd/ReasonLite-Dataset/viewer/default/high) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
+
---
|
| 78 |
|
| 79 |
+
# 📌 Citation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
+
```bibtex
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
@misc{reasonlite2025,
|
| 83 |
+
title={ReasonLite: Ultra-Lightweight Math Reasoning Model},
|
| 84 |
+
author={AMD AI Lab},
|
| 85 |
+
year={2025},
|
| 86 |
+
url={https://huggingface.co/amd/ReasonLite-0.6B}
|
|
|
|
| 87 |
}
|
| 88 |
```
|