Improve language tag
#3
by
lbourdois
- opened
README.md
CHANGED
|
@@ -1,98 +1,110 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
datasets:
|
| 4 |
-
- virtuoussy/Math-RLVR
|
| 5 |
-
- virtuoussy/Multi-subject-RLVR
|
| 6 |
-
language:
|
| 7 |
-
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
>
|
| 33 |
-
>
|
| 34 |
-
>
|
| 35 |
-
>
|
| 36 |
-
>
|
| 37 |
-
>
|
| 38 |
-
>
|
| 39 |
-
>
|
| 40 |
-
>
|
| 41 |
-
>
|
| 42 |
-
> **
|
| 43 |
-
>
|
| 44 |
-
>
|
| 45 |
-
>
|
| 46 |
-
>
|
| 47 |
-
>
|
| 48 |
-
> **
|
| 49 |
-
>
|
| 50 |
-
>
|
| 51 |
-
>
|
| 52 |
-
>
|
| 53 |
-
>
|
| 54 |
-
>
|
| 55 |
-
> question
|
| 56 |
-
>
|
| 57 |
-
>
|
| 58 |
-
>
|
| 59 |
-
>
|
| 60 |
-
>
|
| 61 |
-
>
|
| 62 |
-
>
|
| 63 |
-
>
|
| 64 |
-
>
|
| 65 |
-
>
|
| 66 |
-
>
|
| 67 |
-
>
|
| 68 |
-
>
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
#
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- virtuoussy/Math-RLVR
|
| 5 |
+
- virtuoussy/Multi-subject-RLVR
|
| 6 |
+
language:
|
| 7 |
+
- zho
|
| 8 |
+
- eng
|
| 9 |
+
- fra
|
| 10 |
+
- spa
|
| 11 |
+
- por
|
| 12 |
+
- deu
|
| 13 |
+
- ita
|
| 14 |
+
- rus
|
| 15 |
+
- jpn
|
| 16 |
+
- kor
|
| 17 |
+
- vie
|
| 18 |
+
- tha
|
| 19 |
+
- ara
|
| 20 |
+
base_model:
|
| 21 |
+
- Qwen/Qwen2.5-7B-Instruct
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
Model Details
|
| 25 |
+
|
| 26 |
+
The generative reward model used in paper "Expanding RL with Verifiable Rewards Across Diverse Domains".
|
| 27 |
+
|
| 28 |
+
Inputting the question, label and the response to be evaluated, the model will judge if the response is right.
|
| 29 |
+
|
| 30 |
+
## **Quick start**
|
| 31 |
+
|
| 32 |
+
> ```python
|
| 33 |
+
> # Load model directly
|
| 34 |
+
> from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 35 |
+
>
|
| 36 |
+
> tokenizer = AutoTokenizer.from_pretrained("virtuoussy/Qwen2.5-7B-Instruct-RLVR")
|
| 37 |
+
> model = AutoModelForCausalLM.from_pretrained("virtuoussy/Qwen2.5-7B-Instruct-RLVR")
|
| 38 |
+
>
|
| 39 |
+
> PROMPT= '''
|
| 40 |
+
> Given a problem, determine whether the final answer in the provided (incomplete) solution process matches the reference answer.
|
| 41 |
+
> The reference answer may be one single option character (e.g., A, B, C, D), a numerical value, an expression, or a list of answers if multiple questions are involved.
|
| 42 |
+
> **The reference answer may be in Chinese or another language, but your evaluation should be language-agnostic.**
|
| 43 |
+
>
|
| 44 |
+
> Your task:
|
| 45 |
+
> - Compare the final output of the solution process with the reference answer.
|
| 46 |
+
> - If they **match exactly**, output **YES**.
|
| 47 |
+
> - If they **do not match**, output **NO**.
|
| 48 |
+
> - If the solution process is unclear, incomplete, or ambiguous, assume it is incorrect and output **NO**.
|
| 49 |
+
>
|
| 50 |
+
> Your output must be strictly **'YES'** or **'NO'**, with no additional words, punctuation, or explanation.
|
| 51 |
+
>
|
| 52 |
+
> ---
|
| 53 |
+
>
|
| 54 |
+
> **Question:**
|
| 55 |
+
> {question}
|
| 56 |
+
>
|
| 57 |
+
> **Solution Process (Final Step Only):**
|
| 58 |
+
> {response}
|
| 59 |
+
>
|
| 60 |
+
> **Reference Answer:**
|
| 61 |
+
> {reference}
|
| 62 |
+
>
|
| 63 |
+
> **Output:**
|
| 64 |
+
> '''
|
| 65 |
+
>
|
| 66 |
+
>
|
| 67 |
+
> question="The founder of China's first public kindergarten teacher training school - Jiangxi Experimental Kindergarten Teacher School is ( )."
|
| 68 |
+
> label="Chen Heqin"
|
| 69 |
+
> answer="heqin chen"
|
| 70 |
+
>
|
| 71 |
+
> prompt_question = PROMPT.format(question=question, reference=label, response=answer)
|
| 72 |
+
> messages=[
|
| 73 |
+
> {"role": "system", "content": "You are a helpful assistant."},
|
| 74 |
+
> {"role": "user", "content": prompt_question},
|
| 75 |
+
> ]
|
| 76 |
+
> input_ids=tokenizer.apply_chat_template(messages,return_tensors="pt")
|
| 77 |
+
> output=model.generate(input_ids,do_sample=False)
|
| 78 |
+
> judgement=tokenizer.decode(output[0][input_ids.shape[1]:],skip_special_tokens=True)
|
| 79 |
+
> print("Model judgement: ",judgement)
|
| 80 |
+
> ```
|
| 81 |
+
|
| 82 |
+
## Use as a remote reward
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
# launch a remote reward
|
| 86 |
+
bash launch_reward.sh {MODEL_PATH} {ANSWER_PATH} {METRIC}
|
| 87 |
+
|
| 88 |
+
# MODEL_PATH: the path of our generative reward model.
|
| 89 |
+
# ANSWER_PATH: the path of the training data.
|
| 90 |
+
# METRIC: greedy/prob
|
| 91 |
+
# This will launch a reward at http://127.0.0.1:8000/get_reward
|
| 92 |
+
|
| 93 |
+
# train
|
| 94 |
+
bash train.sh {METHOD} {PRETRAIN_PATH} {DATA_PATH} {REWARD_API}
|
| 95 |
+
|
| 96 |
+
# Both train.sh and launch_reward.sh can be found in the model directory.
|
| 97 |
+
# We will release our github repo soon!
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
```bibtex
|
| 104 |
+
@article{su2025expanding,
|
| 105 |
+
title={Expanding RL with Verifiable Rewards Across Diverse Domains},
|
| 106 |
+
author={Su, Yi and Yu, Dian and Song, Linfeng and Li, Juntao and Mi, Haitao and Tu, Zhaopeng and Zhang, Min and Yu, Dong},
|
| 107 |
+
journal={arXiv preprint arXiv:2503.23829},
|
| 108 |
+
year={2025}
|
| 109 |
+
}
|
| 110 |
```
|