Update README.md
Browse files
README.md
CHANGED
|
@@ -16,36 +16,35 @@ datasets:
|
|
| 16 |
metrics:
|
| 17 |
- accuracy
|
| 18 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
| 19 |
---
|
| 20 |
|
| 21 |
# Rune-R1 (351M) β GRPO Reasoning Model
|
| 22 |
|
| 23 |
-
**Rune-R1** is a ~351M parameter decoder-only transformer trained from scratch and
|
| 24 |
-
aligned for math reasoning via a three-stage pipeline:
|
| 25 |
|
| 26 |
```
|
| 27 |
Pretrain (FineWeb-Edu) β SFT (distilled CoT format) β GRPO (RLVR on math correctness)
|
| 28 |
```
|
| 29 |
|
| 30 |
-
This repository holds the final checkpoint: the GRPO-tuned policy, starting from
|
| 31 |
-
[Rune-R1-SFT](https://huggingface.co/samueljayasingh/Rune-R1-sft) and optimized
|
| 32 |
-
with Group Relative Policy Optimization against a verifiable, rule-based reward for
|
| 33 |
-
math answer correctness. See [Rune-R1-Base](https://huggingface.co/samueljayasingh/Rune-R1-base)
|
| 34 |
-
and [Rune-R1-SFT](https://huggingface.co/samueljayasingh/Rune-R1-sft) for the earlier
|
| 35 |
-
pipeline stages.
|
| 36 |
|
| 37 |
## Model Description
|
| 38 |
|
| 39 |
-
|
| 40 |
-
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
### Architecture
|
| 49 |
|
| 50 |
| Parameter | Value |
|
| 51 |
|---|---|
|
|
@@ -59,22 +58,16 @@ pipeline stages.
|
|
| 59 |
|
| 60 |
## Intended Uses & Limitations
|
| 61 |
|
| 62 |
-
|
| 63 |
- Research into RLVR / GRPO-style reasoning fine-tuning at small model scale.
|
| 64 |
- Reference implementation for reward-verified RL post-training pipelines (pretrain β SFT β RL).
|
| 65 |
- Studying reward hacking, KL-regularization tradeoffs, and reasoning-accuracy dynamics under a small RL step budget.
|
| 66 |
|
| 67 |
-
|
| 68 |
-
- Small model (351M) with a limited RL budget (2,000 steps) β MATH-500 accuracy
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
-
|
| 72 |
-
grading), so the model may still learn to produce well-formatted but incorrect
|
| 73 |
-
reasoning that occasionally reward-hacks the verifier.
|
| 74 |
-
- Inherits base/SFT limitations: 1024-token context, ~5B pretraining tokens, no
|
| 75 |
-
broad safety/RLHF alignment beyond the math-correctness reward.
|
| 76 |
-
- Not suitable for production or user-facing deployment β this is a research
|
| 77 |
-
artifact demonstrating the training pipeline, not a competitive reasoning model.
|
| 78 |
|
| 79 |
## How to Use
|
| 80 |
|
|
@@ -96,12 +89,25 @@ tokens = torch.tensor([enc.encode(prompt)], dtype=torch.long)
|
|
| 96 |
# See rune/generate.py in the source repo for full sampling / KV-cache generation code.
|
| 97 |
```
|
| 98 |
|
| 99 |
-
The `rune` package (model definition + generation utilities) is available at the
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
## Training & Evaluation
|
| 103 |
|
| 104 |
-
### Training
|
| 105 |
|
| 106 |
| Parameter | Value |
|
| 107 |
|---|---|
|
|
@@ -117,9 +123,8 @@ The `rune` package (model definition + generation utilities) is available at the
|
|
| 117 |
| Learning rate | 1e-6 |
|
| 118 |
| Reward function | Rule-based: extract `\boxed{}` answer, symbolically grade vs. ground truth (1.0 / 0.0) |
|
| 119 |
| Eval cadence | MATH-500 (50-example subset), every 100 steps |
|
| 120 |
-
| Hardware | 1x AMD MI300X GPU |
|
| 121 |
|
| 122 |
-
### Evaluation
|
| 123 |
|
| 124 |
| Metric | Value |
|
| 125 |
|---|---|
|
|
@@ -129,9 +134,7 @@ The `rune` package (model definition + generation utilities) is available at the
|
|
| 129 |
| Max single-step average reward | 0.75 |
|
| 130 |
| Steps with nonzero reward | 152 / 2001 |
|
| 131 |
|
| 132 |
-
MATH-500 accuracy fluctuated in the 0β4% range throughout training rather than
|
| 133 |
-
improving monotonically, reflecting the small model size and limited RL budget
|
| 134 |
-
rather than a fully converged reasoning model.
|
| 135 |
|
| 136 |
## Citation
|
| 137 |
|
|
@@ -149,4 +152,4 @@ rather than a fully converged reasoning model.
|
|
| 149 |
|
| 150 |
- [HuggingFaceFW/fineweb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) β pretraining corpus.
|
| 151 |
- [rasbt/math_distill](https://huggingface.co/datasets/rasbt/math_distill) β distilled chain-of-thought SFT data.
|
| 152 |
-
- [rasbt/LLMs-from-scratch](https://github.com/rasbt/LLMs-from-scratch) β architecture and the pretrainβSFTβGRPO reasoning-from-scratch recipe this pipeline is adapted from.
|
|
|
|
| 16 |
metrics:
|
| 17 |
- accuracy
|
| 18 |
pipeline_tag: text-generation
|
| 19 |
+
base_model:
|
| 20 |
+
- samueljayasingh/rune-0.3b-base
|
| 21 |
+
- samueljayasingh/rune-0.3b-sft
|
| 22 |
---
|
| 23 |
|
| 24 |
# Rune-R1 (351M) β GRPO Reasoning Model
|
| 25 |
|
| 26 |
+
**Rune-R1** is a ~351M parameter decoder-only transformer trained from scratch and aligned for math reasoning via a three-stage pipeline:
|
|
|
|
| 27 |
|
| 28 |
```
|
| 29 |
Pretrain (FineWeb-Edu) β SFT (distilled CoT format) β GRPO (RLVR on math correctness)
|
| 30 |
```
|
| 31 |
|
| 32 |
+
This repository holds the final checkpoint: the GRPO-tuned policy, starting from [Rune-R1-SFT](https://huggingface.co/samueljayasingh/Rune-R1-sft) and optimized with Group Relative Policy Optimization against a verifiable, rule-based reward for math answer correctness. See [Rune-R1-Base](https://huggingface.co/samueljayasingh/Rune-R1-base) and [Rune-R1-SFT](https://huggingface.co/samueljayasingh/Rune-R1-sft) for the earlier pipeline stages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
## Model Description
|
| 35 |
|
| 36 |
+
| | |
|
| 37 |
+
|---|---|
|
| 38 |
+
| **Developed by** | samueljayasingh |
|
| 39 |
+
| **Model type** | Causal language model (text-only) |
|
| 40 |
+
| **Base model** | [Rune-R1-SFT](https://huggingface.co/samueljayasingh/Rune-R1-sft) (351M, chain-of-thought SFT on top of Rune-R1-Base) |
|
| 41 |
+
| **Fine-tuning method** | GRPO (Group Relative Policy Optimization) with PPO-style clipping and a KL penalty to a frozen reference (RLVR β reinforcement learning from verifiable rewards) |
|
| 42 |
+
| **Dataset** | `data/math_train.json` (math word problems with verifiable final answers), evaluated on a 50-example MATH-500 held-out subset |
|
| 43 |
+
| **Language** | English |
|
| 44 |
+
| **Tokenizer** | GPT-2 (`tiktoken`) |
|
| 45 |
+
| **License** | Apache 2.0 |
|
| 46 |
|
| 47 |
+
### Architecture Details
|
| 48 |
|
| 49 |
| Parameter | Value |
|
| 50 |
|---|---|
|
|
|
|
| 58 |
|
| 59 |
## Intended Uses & Limitations
|
| 60 |
|
| 61 |
+
### Intended Use
|
| 62 |
- Research into RLVR / GRPO-style reasoning fine-tuning at small model scale.
|
| 63 |
- Reference implementation for reward-verified RL post-training pipelines (pretrain β SFT β RL).
|
| 64 |
- Studying reward hacking, KL-regularization tradeoffs, and reasoning-accuracy dynamics under a small RL step budget.
|
| 65 |
|
| 66 |
+
### Limitations
|
| 67 |
+
- Small model (351M) with a limited RL budget (2,000 steps) β MATH-500 accuracy remains low (0β4% across evaluation checkpoints; see table below) and should not be compared to production-scale reasoning models.
|
| 68 |
+
- Reward signal is a rule-based correctness check (`\boxed{}` extraction + symbolic grading), so the model may still learn to produce well-formatted but incorrect reasoning that occasionally reward-hacks the verifier.
|
| 69 |
+
- Inherits base/SFT limitations: 1024-token context, ~5B pretraining tokens, no broad safety/RLHF alignment beyond the math-correctness reward.
|
| 70 |
+
- **Not suitable for production or user-facing deployment** β this is a research artifact demonstrating the training pipeline, not a competitive reasoning model.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
## How to Use
|
| 73 |
|
|
|
|
| 89 |
# See rune/generate.py in the source repo for full sampling / KV-cache generation code.
|
| 90 |
```
|
| 91 |
|
| 92 |
+
The `rune` package (model definition + generation utilities) is available at the Rune-R1 GitHub repository.
|
| 93 |
+
|
| 94 |
+
## Hardware
|
| 95 |
+
|
| 96 |
+
Trained end to end β pretraining, SFT, and GRPO β on a single rented GPU instance:
|
| 97 |
+
|
| 98 |
+
| Component | Spec |
|
| 99 |
+
|---|---|
|
| 100 |
+
| GPU | 1x AMD MI300X |
|
| 101 |
+
| VRAM | 192 GB |
|
| 102 |
+
| vCPU | 20 |
|
| 103 |
+
| RAM | 240 GB |
|
| 104 |
+
| Boot disk | 720 GB NVMe SSD |
|
| 105 |
+
| Scratch disk | 5 TB NVMe SSD |
|
| 106 |
+
| Rate | $1.99/hr |
|
| 107 |
|
| 108 |
## Training & Evaluation
|
| 109 |
|
| 110 |
+
### Training Procedure
|
| 111 |
|
| 112 |
| Parameter | Value |
|
| 113 |
|---|---|
|
|
|
|
| 123 |
| Learning rate | 1e-6 |
|
| 124 |
| Reward function | Rule-based: extract `\boxed{}` answer, symbolically grade vs. ground truth (1.0 / 0.0) |
|
| 125 |
| Eval cadence | MATH-500 (50-example subset), every 100 steps |
|
|
|
|
| 126 |
|
| 127 |
+
### Evaluation Results
|
| 128 |
|
| 129 |
| Metric | Value |
|
| 130 |
|---|---|
|
|
|
|
| 134 |
| Max single-step average reward | 0.75 |
|
| 135 |
| Steps with nonzero reward | 152 / 2001 |
|
| 136 |
|
| 137 |
+
MATH-500 accuracy fluctuated in the 0β4% range throughout training rather than improving monotonically, reflecting the small model size and limited RL budget rather than a fully converged reasoning model.
|
|
|
|
|
|
|
| 138 |
|
| 139 |
## Citation
|
| 140 |
|
|
|
|
| 152 |
|
| 153 |
- [HuggingFaceFW/fineweb-edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu) β pretraining corpus.
|
| 154 |
- [rasbt/math_distill](https://huggingface.co/datasets/rasbt/math_distill) β distilled chain-of-thought SFT data.
|
| 155 |
+
- [rasbt/LLMs-from-scratch](https://github.com/rasbt/LLMs-from-scratch) β architecture and the pretrain β SFT β GRPO reasoning-from-scratch recipe this pipeline is adapted from.
|