Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2model_id = "OpenRubrics/RubricARROW-8B-Judge"
3tok = AutoTokenizer.from_pretrained(model_id, use_fast=True)
4model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto")rubric_item should be generated with a RubricARROW-Rubric model.1JUDGE_PROMPT_TEMPLATE = """
2Your job is to look at a conversation and a set of rubric items, and score the last turn (i.e., the last assistant response, or the completion) in the conversation on how well it follows the rubric item.
3
4# Conversation
5<<conversation>>
6
7# Rubric item
8<<rubric_item>>
9
10# Instructions
11Return a json object. For each rubric item i (starting from 1), keys must be exactly "explanation_i" and "criteria_met_i" for each i and it includes two top-level fields in the JSON object:
12- The "explanation_i" field should be a string explaining why the response does or does not meet the criteria of the rubric item.
13- The "criteria_met_i" field should be a boolean indicating (true/false) whether the response meets the criteria of the rubric item. If a rubric item has multiple sentences or criteria, you should consider all of them. If any of the criteria is not met, the answer should be false. Only return true is all of the criteria are met.
14- One important exception to the above bullet point is that if a criteria says "such as", "for example", or "including", the response does not have to include all of the examples listed to meet the criteria.
15
16# Final Output Format (a single JSON object, not an array)
17{
18 "explanation_1": "...",
19 "criteria_met_1": true/false,
20 "explanation_2": "...",
21 "criteria_met_2": true/false,
22 ... repeat this pattern for every rubric item i in order (i = 1, 2, 3, ...)
23}
24
25# Final instruction
26Return just the json object. Do not include any other text in the response.
27""".strip()
28
29conversation = f"user: {instruction}
30
31assistant: {response}"
32
33user_text = (
34 JUDGE_PROMPT_TEMPLATE
35 .replace("<<conversation>>", conversation)
36 .replace("<<rubric_item>>", rubric_item)
37)
38
39messages_list = [
40 {"role": "user", "content": user_text},
41]
42message = tok.apply_chat_template(
43 messages_list,
44 tokenize=False,
45 add_generation_prompt=True,
46 enable_thinking=False
47)
48
49# Remaining step: Use either HF or vLLM for evaluation.
50# ...
51# ...1def weight(tags):
2 t = {str(x).strip().lower() for x in (tags or [])}
3 return 3.0 if "hard rule" in t else 1.0 if "principle" in t else 0.0
4
5def group_score(rubric_outputs):
6 return sum((x.get("true_prob", 0.0) - x.get("false_prob", 0.0)) * weight(x.get("tags"))
7 for x in rubric_outputs)1@misc{jiang2026rubric,
2 title={RUBRIC-ARROW: Alternating Pointwise Rubric Reward Modeling for LLM Post-training in Non-verifiable Domains},
3 author={Haoxiang Jiang and Zihan Dong and Tianci Liu and Wanying Wang and Ran Xu and Tony Yu and Linjun Zhang and Haoyu Wang},
4 year={2026},
5 eprint={2605.29156},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/2605.29156},
9}