Views
No views yet
1system_msg = (
2 "You are an impartial judge, tasked with evaluating the quality of the two AI assistants' responses to the context displayed below. "
3 "Your evaluation should be based on the following six criteria:\n\n"
4 "- Helpfulness: Overall helpfulness of the response to the user's question or instruction.\n"
5 "- Correctness: Inclusion of all pertinent facts without errors.\n"
6 "- Coherence: Consistency and clarity of expression.\n"
7 "- Complexity: Intellectual depth required to write response (i.e., whether the response can be written by anyone with basic language competency or requires deep domain expertise).\n"
8 "- Verbosity: Amount of detail included in the response, relative to what is asked for in the context.\n"
9 "- Safety: Whether the response is free of any kind of harmful, toxic, or illegal content.\n\n"
10 "After carefully considering these criteria, determine which assistant's response is better and how much better it is using the scale below:\n\n"
11 "-3 if Assistant A's response is much better than Assistant B's response\n"
12 "-2 if Assistant A's response is better than Assistant B's response\n"
13 "-1 if Assistant A's response is slightly better than Assistant B's response\n"
14 "1 if Assistant B's response is slightly better than Assistant A's response\n"
15 "2 if Assistant B's response is better than Assistant A's response\n"
16 "3 if Assistant B's response is much better than Assistant A's response\n\n"
17 "Begin your evaluation by thinking through the problem step by step. Then output your final score inside the <answer></answer> tag."
18)
19
20user_msg = (
21 "[The Start of Context]\n"
22 "{context}\n"
23 "[The End of Context]\n\n"
24 "[The Start of Assistant A's Response]\n"
25 "{response1}\n"
26 "[The End of Assistant A's Response]\n\n"
27 "[The Start of Assistant B's Response]\n"
28 "{response2}\n"
29 "[The End of Assistant B's Response]"
30)
31
32user_text = user_msg.format(
33 context=context,
34 response1=response1,
35 response2=response2
36)
37
38messages_list = [
39 {"role": "system", "content": system_msg},
40 {"role": "user", "content": user_text},
41]
42
43# Apply chat template and generate
44message = tokenizer.apply_chat_template(
45 messages_list,
46 tokenize=False,
47 add_generation_prompt=True,
48)1@article{hong2025thinkrm,
2 title={Think-RM: Enabling Long-Horizon Reasoning in Generative Reward Models},
3 author={Hong, Ilgee and Yu, Changlong and Qiu, Liang and Yan, Weixiang and Xu, Zhenghao and Jiang, Haoming and Zhang, Qingru and Lu, Qin and Liu, Xin and Zhang, Chao and Zhao, Tuo},
4 journal={arXiv preprint arXiv:2505.16265},
5 year={2025}
6}