Improve model card: Add HF paper link and fix code snippet

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +35 -13
README.md CHANGED
@@ -1,15 +1,15 @@
1
  ---
2
  base_model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
 
 
3
  library_name: transformers
 
4
  pipeline_tag: text-generation
5
  tags:
6
  - base_model:adapter:deepseek-ai/DeepSeek-R1-Distill-Llama-8B
7
  - lora
8
  - transformers
9
  - reward-model
10
- license: apache-2.0
11
- language:
12
- - en
13
  ---
14
 
15
  # gPRM-8B
@@ -18,7 +18,8 @@ language:
18
  This model is a generative outcome reward model finetuned from [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B), and the [training data](https://huggingface.co/datasets/dongboklee/train_gPRM) is generated by [QwQ-32B](https://huggingface.co/Qwen/QwQ-32B) on [this data](https://huggingface.co/datasets/dongboklee/train).
19
 
20
  For details:
21
- - **Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://arxiv.org/abs/2510.00492)
 
22
  - **Repository:** [https://github.com/db-Lee/Multi-RM](https://github.com/db-Lee/Multi-RM)
23
 
24
 
@@ -40,22 +41,40 @@ model.eval()
40
  model.to(device)
41
 
42
  # prompt formatting
43
- question = 'Question: In Python 3, which of the following function convert a string to an int in python?\nA. short(x)\nB. float(x)\nC. integer(x [,base])\nD. double(x)\nE. int(x [,base])\nF. long(x [,base] )\nG. num(x)\nH. str(x)\nI. char(x)\nJ. digit(x [,base])'
 
 
 
 
 
 
 
 
 
 
44
  solution = ["To convert a string to an integer in Python 3, we use the built-in function int().",
45
  "The int() function takes two arguments: the string to be converted and an optional base (default is 10, which is for decimal).",
46
- "For example: int(\"123\", 10) converts the string \"123\" to the integer 123.",
47
  "Looking at the options, we can see that the correct function is option E: int(x [,base]).",
48
  "The answer is (E)."]
49
  category_name = "computer science"
50
- prefix = "\n\n".join(solution)
51
- steps = [ f"Step {str(i+1)}: {step}" for i, step in enumerate(steps) ]
52
- prefix = "\n".join(steps)
53
 
54
  # Create the prompt
55
  prompt_text = (
56
- f"You are given a {category_name} problem and a proposed step-by-step solution:\n\n"
57
- f"[{category_name.capitalize()} Problem]\n{question}\n\n"
58
- f"[Solution]\n{prefix}\n\n"
 
 
 
 
 
 
 
 
59
  "Review and critique each step in the proposed solution to determine whether each step is correct. If the solution is incomplete, only verify the provided steps."
60
  )
61
 
@@ -78,7 +97,10 @@ with torch.no_grad():
78
  )
79
 
80
  # compute reward
81
- logits = outputs.logits[0, -2, :]
 
 
 
82
  yes_logit, no_logit = logits[yes_id].item(), logits[no_id].item()
83
  reward = math.exp(yes_logit) / (math.exp(yes_logit) + math.exp(no_logit))
84
  ```
 
1
  ---
2
  base_model: deepseek-ai/DeepSeek-R1-Distill-Llama-8B
3
+ language:
4
+ - en
5
  library_name: transformers
6
+ license: apache-2.0
7
  pipeline_tag: text-generation
8
  tags:
9
  - base_model:adapter:deepseek-ai/DeepSeek-R1-Distill-Llama-8B
10
  - lora
11
  - transformers
12
  - reward-model
 
 
 
13
  ---
14
 
15
  # gPRM-8B
 
18
  This model is a generative outcome reward model finetuned from [DeepSeek-R1-Distill-Llama-8B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Llama-8B), and the [training data](https://huggingface.co/datasets/dongboklee/train_gPRM) is generated by [QwQ-32B](https://huggingface.co/Qwen/QwQ-32B) on [this data](https://huggingface.co/datasets/dongboklee/train).
19
 
20
  For details:
21
+ - **Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://huggingface.co/papers/2510.00492) (Hugging Face Paper)
22
+ - **arXiv Paper:** [Rethinking Reward Models for Multi-Domain Test-Time Scaling](https://arxiv.org/abs/2510.00492)
23
  - **Repository:** [https://github.com/db-Lee/Multi-RM](https://github.com/db-Lee/Multi-RM)
24
 
25
 
 
41
  model.to(device)
42
 
43
  # prompt formatting
44
+ question = 'Question: In Python 3, which of the following function convert a string to an int in python?
45
+ A. short(x)
46
+ B. float(x)
47
+ C. integer(x [,base])
48
+ D. double(x)
49
+ E. int(x [,base])
50
+ F. long(x [,base] )
51
+ G. num(x)
52
+ H. str(x)
53
+ I. char(x)
54
+ J. digit(x [,base])'
55
  solution = ["To convert a string to an integer in Python 3, we use the built-in function int().",
56
  "The int() function takes two arguments: the string to be converted and an optional base (default is 10, which is for decimal).",
57
+ "For example: int(\\\"123\\\", 10) converts the string \\\"123\\\" to the integer 123.",
58
  "Looking at the options, we can see that the correct function is option E: int(x [,base]).",
59
  "The answer is (E)."]
60
  category_name = "computer science"
61
+ steps = [ f"Step {str(i+1)}: {step}" for i, step in enumerate(solution) ]
62
+ prefix = "
63
+ ".join(steps)
64
 
65
  # Create the prompt
66
  prompt_text = (
67
+ f"You are given a {category_name} problem and a proposed step-by-step solution:\
68
+ \
69
+ "
70
+ f"[{category_name.capitalize()} Problem]\
71
+ {question}\
72
+ \
73
+ "
74
+ f"[Solution]\
75
+ {prefix}\
76
+ \
77
+ "
78
  "Review and critique each step in the proposed solution to determine whether each step is correct. If the solution is incomplete, only verify the provided steps."
79
  )
80
 
 
97
  )
98
 
99
  # compute reward
100
+ # `outputs.scores` contains the logits for each generated token.
101
+ # The model is expected to end its generation with " Yes" or " No".
102
+ # We take the logits of the very last generated token to compute the reward.
103
+ logits = outputs.scores[-1][0]
104
  yes_logit, no_logit = logits[yes_id].item(), logits[no_id].item()
105
  reward = math.exp(yes_logit) / (math.exp(yes_logit) + math.exp(no_logit))
106
  ```