Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +121 -0
- config.json +28 -0
- generation_config.json +9 -0
- logo.svg +10 -0
- model.safetensors +3 -0
- overview.png +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +35 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
overview.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
tags:
|
4 |
+
- RLinf
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
metrics:
|
8 |
+
- accuracy
|
9 |
+
base_model:
|
10 |
+
- deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B
|
11 |
+
pipeline_tag: reinforcement-learning
|
12 |
+
model-index:
|
13 |
+
- name: RLinf-math-1.5B
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
type: math # Required. Example: automatic-speech-recognition
|
17 |
+
dataset:
|
18 |
+
type: aime_2024 # Required. Example: common_voice. Use dataset id from https://hf.co/datasets
|
19 |
+
name: AIME24 # Required. A pretty name for the dataset. Example: Common Voice (French)
|
20 |
+
metrics:
|
21 |
+
- type: accuracy # Required. Example: wer. Use metric id from https://hf.co/metrics
|
22 |
+
value: 48.03125 # Required. Example: 20.90
|
23 |
+
- task:
|
24 |
+
type: math # Required. Example: automatic-speech-recognition
|
25 |
+
dataset:
|
26 |
+
type: aime_2025 # Required. Example: common_voice. Use dataset id from https://hf.co/datasets
|
27 |
+
name: AIME25 # Required. A pretty name for the dataset. Example: Common Voice (French)
|
28 |
+
metrics:
|
29 |
+
- type: accuracy # Required. Example: wer. Use metric id from https://hf.co/metrics
|
30 |
+
value: 35.10625 # Required. Example: 20.90
|
31 |
+
- task:
|
32 |
+
type: stem # Required. Example: automatic-speech-recognition
|
33 |
+
dataset:
|
34 |
+
type: gpqa_diamond # Required. Example: common_voice. Use dataset id from https://hf.co/datasets
|
35 |
+
name: GPQA-diamond # Required. A pretty name for the dataset. Example: Common Voice (French)
|
36 |
+
metrics:
|
37 |
+
- type: accuracy # Required. Example: wer. Use metric id from https://hf.co/metrics
|
38 |
+
value: 37.509375 # Required. Example: 20.90
|
39 |
+
---
|
40 |
+
|
41 |
+
<div align="center">
|
42 |
+
<img src="logo.svg" alt="RLinf-logo" width="500"/>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
|
46 |
+
<div align="center">
|
47 |
+
<!-- <a href="TODO"><img src="https://img.shields.io/badge/arXiv-Paper-red?logo=arxiv"></a> -->
|
48 |
+
<!-- <a href="TODO"><img src="https://img.shields.io/badge/HuggingFace-yellow?logo=huggingface&logoColor=white" alt="Hugging Face"></a> -->
|
49 |
+
<a href="https://github.com/RLinf/RLinf"><img src="https://img.shields.io/badge/Github-blue"></a>
|
50 |
+
<a href="https://rlinf-docs.readthedocs.io"><img src="https://img.shields.io/badge/Documentation-Purple?color=8A2BE2&logo=readthedocs"></a>
|
51 |
+
<!-- <a href="TODO"><img src="https://devin.ai/assets/deepwiki-badge.png" alt="Ask DeepWiki.com" style="height:20px;"></a>
|
52 |
+
<a href="TODO"><img src="https://img.shields.io/badge/微信-green?logo=wechat&"></a> -->
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<h1 align="center">RLinf: Reinforcement Learning Infrastructure for Agentic AI</h1>
|
56 |
+
|
57 |
+
[RLinf](https://github.com/RLinf/RLinf) is a flexible and scalable open-source infrastructure designed for post-training foundation models (LLMs, VLMs, VLAs) via reinforcement learning. The 'inf' in RLinf stands for Infrastructure, highlighting its role as a robust backbone for next-generation training. It also stands for Infinite, symbolizing the system’s support for open-ended learning, continuous generalization, and limitless possibilities in intelligence development.
|
58 |
+
|
59 |
+
|
60 |
+
<div align="center">
|
61 |
+
<img src="overview.png" alt="RLinf-overview" width="600"/>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
## Model Description
|
65 |
+
The RLinf-math series is trained on DeepSeek-R1-Distill-Qwen (1.5B and 7B variants), using the same base models and training datasets as AReaL. Training with RLinf yields performance better than AReaL.
|
66 |
+
|
67 |
+
We adopt Group Relative Policy Optimization (GRPO) with token-level loss aggregation, focusing on mathematical reasoning and long chain-of-thought (CoT) tasks.
|
68 |
+
|
69 |
+
## Evaluation and Results
|
70 |
+
We trained and evaluated two models using RLinf:
|
71 |
+
|
72 |
+
- RLinf-math-1.5B Model (based on DeepSeek-R1-Distill-Qwen-1.5B)
|
73 |
+
- Recommended sampling settings: `temperature = 0.6`, `top_p = 0.95`
|
74 |
+
|
75 |
+
- RLinf-math-7B Model (based on DeepSeek-R1-Distill-Qwen-7B)
|
76 |
+
- Recommended sampling settings: `temperature = 1.0`, `top_p = 0.95`
|
77 |
+
|
78 |
+
### Benchmark Results
|
79 |
+
|
80 |
+
| | AIME24 | AIME25 | GPQA-diamond |
|
81 |
+
| ---------------------------------------- | ------ | ------ | ------------ |
|
82 |
+
| [DeepSeek-R1-Distill-Qwen-1.5B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B) | 28.33 | 24.90 | 27.45 |
|
83 |
+
| [DeepScaleR-1.5B-Preview](https://huggingface.co/agentica-org/DeepScaleR-1.5B-Preview) | 40.41 | 30.93 | 27.54 |
|
84 |
+
| [AReaL-1.5B](https://huggingface.co/inclusionAI/AReaL-1.5B-Preview-Stage-3) | 40.73 | 31.56 | 28.1 |
|
85 |
+
| AReaL-1.5B-retrain* | 44.42 | 34.27 | 33.81 |
|
86 |
+
| [RLinf-math-1.5B](https://huggingface.co/RLinf/RLinf-math-1.5B) | **48.44** | **35.63** | **38.46** |
|
87 |
+
|
88 |
+
|
89 |
+
| | AIME24 | AIME25 | GPQA-diamond |
|
90 |
+
| --------------------------- | ------ | ------ | ------------ |
|
91 |
+
| [DeepSeek-R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) | 54.90 | 40.20 | 45.48 |
|
92 |
+
| [AReaL-7B](https://huggingface.co/inclusionAI/AReaL-boba-RL-7B) | 62.82 | 47.29 | 46.54 |
|
93 |
+
| [RLinf-math-7B](https://huggingface.co/RLinf/RLinf-math-7B) | **68.33** | **52.19** | **48.18** |
|
94 |
+
|
95 |
+
\* We retrain the model using the default settings for 600 steps.
|
96 |
+
|
97 |
+
## How to Use
|
98 |
+
Example with Hugging Face `transformers`:
|
99 |
+
|
100 |
+
```python
|
101 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
102 |
+
|
103 |
+
model_name = "RLinf/RLinf-math-1.5B"
|
104 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
105 |
+
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
|
106 |
+
|
107 |
+
prompt = "Solve: If x^2 + 2x + 1 = 0, what is x?"
|
108 |
+
|
109 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
110 |
+
outputs = model.generate(
|
111 |
+
**inputs,
|
112 |
+
max_new_tokens=512,
|
113 |
+
temperature=0.6, # recommended for 1.5B
|
114 |
+
top_p=0.95
|
115 |
+
)
|
116 |
+
|
117 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
118 |
+
```
|
119 |
+
|
120 |
+
## License
|
121 |
+
This code repository and the model weights are licensed under the MIT License.
|
config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"Qwen2ForCausalLM"
|
4 |
+
],
|
5 |
+
"attention_dropout": 0.0,
|
6 |
+
"bos_token_id": 151643,
|
7 |
+
"eos_token_id": 151643,
|
8 |
+
"hidden_act": "silu",
|
9 |
+
"hidden_size": 1536,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 8960,
|
12 |
+
"max_position_embeddings": 131072,
|
13 |
+
"max_window_layers": 21,
|
14 |
+
"model_type": "qwen2",
|
15 |
+
"num_attention_heads": 12,
|
16 |
+
"num_hidden_layers": 28,
|
17 |
+
"num_key_value_heads": 2,
|
18 |
+
"rms_norm_eps": 1e-06,
|
19 |
+
"rope_theta": 10000,
|
20 |
+
"sliding_window": 4096,
|
21 |
+
"tie_word_embeddings": false,
|
22 |
+
"torch_dtype": "bfloat16",
|
23 |
+
"transformers_version": "4.44.0",
|
24 |
+
"use_cache": true,
|
25 |
+
"use_mrope": false,
|
26 |
+
"use_sliding_window": false,
|
27 |
+
"vocab_size": 151936
|
28 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bos_token_id": 151646,
|
4 |
+
"eos_token_id": 151643,
|
5 |
+
"do_sample": true,
|
6 |
+
"temperature": 0.6,
|
7 |
+
"top_p": 0.95,
|
8 |
+
"transformers_version": "4.39.3"
|
9 |
+
}
|
logo.svg
ADDED
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:370fd2626a722bb952db60d7203f83bedffb1798c353d99d83d5f1c937ea3583
|
3 |
+
size 3554214416
|
overview.png
ADDED
![]() |
Git LFS Details
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"bos_token": {
|
5 |
+
"__type": "AddedToken",
|
6 |
+
"content": "<|begin▁of▁sentence|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"clean_up_tokenization_spaces": false,
|
13 |
+
"eos_token": {
|
14 |
+
"__type": "AddedToken",
|
15 |
+
"content": "<|end▁of▁sentence|>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": true,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"legacy": true,
|
22 |
+
"model_max_length": 16384,
|
23 |
+
"pad_token": {
|
24 |
+
"__type": "AddedToken",
|
25 |
+
"content": "<|end▁of▁sentence|>",
|
26 |
+
"lstrip": false,
|
27 |
+
"normalized": true,
|
28 |
+
"rstrip": false,
|
29 |
+
"single_word": false
|
30 |
+
},
|
31 |
+
"sp_model_kwargs": {},
|
32 |
+
"unk_token": null,
|
33 |
+
"tokenizer_class": "LlamaTokenizerFast",
|
34 |
+
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% set ns = namespace(is_first=false, is_tool=false, is_output_first=true, system_prompt='') %}{%- for message in messages %}{%- if message['role'] == 'system' %}{% set ns.system_prompt = message['content'] %}{%- endif %}{%- endfor %}{{bos_token}}{{ns.system_prompt}}{%- for message in messages %}{%- if message['role'] == 'user' %}{%- set ns.is_tool = false -%}{{'<|User|>' + message['content']}}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is none %}{%- set ns.is_tool = false -%}{%- for tool in message['tool_calls']%}{%- if not ns.is_first %}{{'<|Assistant|><|tool▁calls▁begin|><|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{%- set ns.is_first = true -%}{%- else %}{{'\\n' + '<|tool▁call▁begin|>' + tool['type'] + '<|tool▁sep|>' + tool['function']['name'] + '\\n' + '```json' + '\\n' + tool['function']['arguments'] + '\\n' + '```' + '<|tool▁call▁end|>'}}{{'<|tool▁calls▁end|><|end▁of▁sentence|>'}}{%- endif %}{%- endfor %}{%- endif %}{%- if message['role'] == 'assistant' and message['content'] is not none %}{%- if ns.is_tool %}{{'<|tool▁outputs▁end|>' + message['content'] + '<|end▁of▁sentence|>'}}{%- set ns.is_tool = false -%}{%- else %}{% set content = message['content'] %}{% if '</think>' in content %}{% set content = content.split('</think>')[-1] %}{% endif %}{{'<|Assistant|>' + content + '<|end▁of▁sentence|>'}}{%- endif %}{%- endif %}{%- if message['role'] == 'tool' %}{%- set ns.is_tool = true -%}{%- if ns.is_output_first %}{{'<|tool▁outputs▁begin|><|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- set ns.is_output_first = false %}{%- else %}{{'\\n<|tool▁output▁begin|>' + message['content'] + '<|tool▁output▁end|>'}}{%- endif %}{%- endif %}{%- endfor -%}{% if ns.is_tool %}{{'<|tool▁outputs▁end|>'}}{% endif %}{% if add_generation_prompt and not ns.is_tool %}{{'<|Assistant|><think>\\n'}}{% endif %}"
|
35 |
+
}
|