maywell / RM-Gemma-2B

huggingface.co
Total runs: 27
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: January 26 2025

Introduction of RM-Gemma-2B

Model Details of RM-Gemma-2B

Reward Model Overview

The reward model is trained from the base model google/gemma-2b-it . See the 7B version RM-Gemma-7B .

The training script is available at https://github.com/WeiXiongUST/RLHF-Reward-Modeling .

Model Details

If you have any question with this reward model and also any question about reward modeling, feel free to drop me an email with [email protected] . I would be happy to chat!

Dataset preprocessing

The model is trained on a mixture of

The total number of the comparison pairs is 250K, where we perform the following data selection and cleaning strateges:

  • HH-RLHF: we use all the base, rejection sampling, and online subsets but delete the samples whose chosen == rejected, leading to 115547;
  • SHP: we only use the samples with score ratio > 2, for each prompt, we only take 1 comparison, leading to 55916;
  • Ultrafeedback: similar to UltraFeedback-Binarized , we use the fine-grained score instead of the overall one to rank samples. Meanwhile, for each prompt, we take the best one v.s. random chosen one in the remaining samples. Finally, we delete the selected pairs with equal scores, leading to 62793.
  • HelpSteer: we use the mean of helpfulness and correctness to rank samples. Meanwhile, we take the best sample v.s. the random chosen one in the remaining samples. Finally, we delete the selected pairs with equal scores, leading to 8206;
  • Capybara: we delete the pairs whose chosen and rejected samples are of the same rating, leading to 7562;
  • Orca: we delete the pairs whose chosen and rejected samples are of the same rating, leading to 6405.
Training

We train the model for one epoch with a learning rate of 1e-5, batch size 256, cosine learning rate decay with a warmup ratio 0.03. We present the training curve as follows.

Training Loss

Uses
  from transformers import AutoTokenizer, pipeline
  rm_tokenizer = AutoTokenizer.from_pretrained("weqweasdas/RM-Gemma-2B")
  device = 0 # accelerator.device
  rm_pipe = pipeline(
      "sentiment-analysis",
      model="weqweasdas/RM-Gemma-2B",
      #device="auto",
      device=device,
      tokenizer=rm_tokenizer,
      model_kwargs={"torch_dtype": torch.bfloat16}
  )

  pipe_kwargs = {
      "return_all_scores": True,
      "function_to_apply": "none",
      "batch_size": 1
  }

  chat = [
   {"role": "user", "content": "Hello, how are you?"},
   {"role": "assistant", "content": "I'm doing great. How can I help you today?"},
   {"role": "user", "content": "I'd like to show off how chat templating works!"},
  ]

  test_texts = [tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=False).replace(tokenizer.bos_token, "")]
  pipe_outputs = rm_pipe(test_texts, **pipe_kwargs)
  rewards = [output[0]["score"] for output in pipe_outputs]
Results

We collect the existing preference datasets and use them as a benchmark to evaluate the resulting reawrd model.

Note that for MT-Bench dataset (lmsys/mt_bench_human_judgments), we delete the samples with tie as the comparison results. The Alpaca data is from Here .

Model/Test set HH-RLHF-Helpful SHP Helpsteer helpful + correctness Helpsteer All MT Bench Human MT Bench GPT4 Alpaca Human Alpaca GPT4 Alpca Human-crossed
UltraRM-13B 0.71 0.73 0.72 0.72 0.78 0.9 0.65 0.83 0.62
Pair-RM 0.65 0.56 0.62 0.6 0.74 0.82 0.62 0.75 0.59
RM-Gemma-2B 0.68 0.73 0.68 0.72 0.77 0.87 0.63 0.78 0.59
Reference

To be added. The reward model may be readily used for rejection sampling finetuning (

@article{dong2023raft,
  title={Raft: Reward ranked finetuning for generative foundation model alignment},
  author={Dong, Hanze and Xiong, Wei and Goyal, Deepanshu and Pan, Rui and Diao, Shizhe and Zhang, Jipeng and Shum, Kashun and Zhang, Tong},
  journal={arXiv preprint arXiv:2304.06767},
  year={2023}
}

Runs of maywell RM-Gemma-2B on huggingface.co

27
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About RM-Gemma-2B huggingface.co Model

RM-Gemma-2B huggingface.co

RM-Gemma-2B huggingface.co is an AI model on huggingface.co that provides RM-Gemma-2B's model effect (), which can be used instantly with this maywell RM-Gemma-2B model. huggingface.co supports a free trial of the RM-Gemma-2B model, and also provides paid use of the RM-Gemma-2B. Support call RM-Gemma-2B model through api, including Node.js, Python, http.

RM-Gemma-2B huggingface.co Url

https://huggingface.co/maywell/RM-Gemma-2B

maywell RM-Gemma-2B online free

RM-Gemma-2B huggingface.co is an online trial and call api platform, which integrates RM-Gemma-2B's modeling effects, including api services, and provides a free online trial of RM-Gemma-2B, you can try RM-Gemma-2B online for free by clicking the link below.

maywell RM-Gemma-2B online free url in huggingface.co:

https://huggingface.co/maywell/RM-Gemma-2B

RM-Gemma-2B install

RM-Gemma-2B is an open source model from GitHub that offers a free installation service, and any user can find RM-Gemma-2B on GitHub to install. At the same time, huggingface.co provides the effect of RM-Gemma-2B install, users can directly use RM-Gemma-2B installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

RM-Gemma-2B install url in huggingface.co:

https://huggingface.co/maywell/RM-Gemma-2B

Url of RM-Gemma-2B

RM-Gemma-2B huggingface.co Url

Provider of RM-Gemma-2B huggingface.co

maywell
ORGANIZATIONS

Other API from maywell

huggingface.co

Total runs: 127
Run Growth: -376
Growth Rate: -296.06%
Updated:January 07 2024
huggingface.co

Total runs: 122
Run Growth: -349
Growth Rate: -286.07%
Updated:January 15 2024
huggingface.co

Total runs: 115
Run Growth: -14
Growth Rate: -12.17%
Updated:February 19 2024
huggingface.co

Total runs: 114
Run Growth: 22
Growth Rate: 19.64%
Updated:February 02 2024
huggingface.co

Total runs: 112
Run Growth: -353
Growth Rate: -315.18%
Updated:December 17 2023
huggingface.co

Total runs: 22
Run Growth: 14
Growth Rate: 63.64%
Updated:April 30 2024
huggingface.co

Total runs: 15
Run Growth: 10
Growth Rate: 66.67%
Updated:November 15 2023
huggingface.co

Total runs: 9
Run Growth: 5
Growth Rate: 55.56%
Updated:November 13 2023
huggingface.co

Total runs: 8
Run Growth: 0
Growth Rate: 0.00%
Updated:December 14 2024
huggingface.co

Total runs: 7
Run Growth: 2
Growth Rate: 28.57%
Updated:December 02 2023
huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:July 31 2024