Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,53 +1,33 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
<p align="center">
|
| 8 |
-
<img src="
|
| 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
|
| 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="
|
| 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 |
-
|
| 39 |
-
|
| 40 |
-
|
| 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 |
-
**
|
|
|
|
|
|
|
| 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,27 +44,204 @@ Then, long-CoT data is used to obtain **AMD-0.6B**, further boosting accuracy to
|
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 76 |
|
| 77 |
-
---
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
}
|
| 88 |
```
|
| 89 |
|
|
|
|
|
|
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<p align="center">
|
| 2 |
+
<img src="img/img_logo.png" alt="ReasonLite" width="200">
|
| 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 |
+
* The project is fully open-source, including **model weights**, **training scripts**, **training data**, and the **data synthesis + filtering pipeline**.
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
<p align="center">
|
| 12 |
+
<img src="img/img_acc.png" alt="ReasonLite" height="500">
|
| 13 |
</p>
|
| 14 |
|
| 15 |
+
## Model
|
|
|
|
|
|
|
|
|
|
| 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 |
+
<p align="center">
|
| 22 |
+
<img src="img/img_model.png" alt="ReasonLite" height="500">
|
| 23 |
+
</p>
|
|
|
|
| 24 |
|
|
|
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
+
**Evaluation Results**: We evaluate model performance on math reasoning tasks.
|
| 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 |
| 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 |
+
| Model | Description | AIME24 | Link |
|
| 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 |
+
* A total of **343K math problems** originated from [Polaris](https://huggingface.co/datasets/POLARIS-Project/Polaris-Dataset-53K) and [OpenMathReasoni](https://huggingface.co/datasets/nvidia/ngOpenMathReasoni).
|
| 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 CoT | 1.8M | [π€ HuggingFace](https://huggingface.co/datasets/amd/ReasonLite-Dataset/viewer/default/high) |
|
| 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 |
+
**Generate model answers**
|
| 138 |
+
|
| 139 |
+
```bash
|
| 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 |
+
**Judge correctness using provided labels**
|
| 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 = {ReasonLite: An Ultra-Lightweight 0.6B Reasoning Model},
|
| 242 |
+
author = {An, Zihao and Chen, Chushi and Liu, Ziqiong and Li, Dong and Barsoum, Emad},
|
| 243 |
+
year = {2025},
|
| 244 |
+
url = {https://github.com/amd/ReasonLite},
|
| 245 |
+
note = {Open-source project}
|
| 246 |
+
}
|
| 247 |
+
```
|