Views
No views yet
1from transformers import AutoModelForCausalLM, AutoTokenizer
2model_id = "OpenRubrics/RubricRM-4B-Rubric"
3tok = AutoTokenizer.from_pretrained(model_id, use_fast=True)
4model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto")1RUBRIC_PROMPT_TEMPLATE = (
2 "Your task is to extract a set of rubric-style instructions from a user's request.\n"
3 "These rubrics will be used as evaluation criteria to check if a response fully meets the request.\n"
4 "Every rubric item must be a universal principle. If any rubric still contains topic-specific references (e.g., names, places, myths, numbers, historical facts), it is automatically invalid.\n"
5 "\n"
6 "- **Two Distinct Categories:**\n"
7 " - [Hard Rule]: Derived strictly from explicit requirements stated in the <request> (format, length, structure, forbidden/required elements, etc.).\n"
8 " - [Principle]: Derived by abstracting any concrete cues into domain-agnostic quality criteria (e.g., clarity, correctness, sound reasoning, pedagogy).\n"
9 "\n"
10 "- **Comprehensiveness:**\n"
11 " The rubric must cover all critical aspects implied by the request and examples, including explicit requirements and implicit quality standards.\n"
12 "\n"
13 "- **Conciseness & Uniqueness:**\n"
14 " Each rubric must capture a distinct evaluation criterion. Overlapping or redundant criteria must be merged into a single rubric. Wording must be precise and free of repetition.\n"
15 "\n"
16 "- **Format Requirements:**\n"
17 " - Use a numbered list.\n"
18 " - Each item starts with \"The response\" phrased in third person.\n"
19 " - Append [Hard Rule] or [Principle] at the end of each item.\n"
20 " - Do not include reasoning, explanations, or examples in the final output—only the rubrics.\n"
21 "\n"
22 "Here is the request:\n"
23 "{prompt}\n"
24 "\n"
25 "Please generate the rubrics for the above request."
26)
27
28user_text = RUBRIC_PROMPT_TEMPLATE.format(
29 prompt=instruction,
30 )
31
32messages_list = [
33 {"role": "user", "content": user_text},
34]
35
36message = tok.apply_chat_template(
37 messages_list,
38 tokenize=False,
39 add_generation_prompt=True,
40 enable_thinking=False
41)
42
43# Remaining step: Use either HF or vLLM for evaluation.
44# ...
45# ...@misc{liu2025openrubricsscalablesyntheticrubric,
title={OpenRubrics: Towards Scalable Synthetic Rubric Generation for Reward Modeling and LLM Alignment},
author={Tianci Liu and Ran Xu and Tony Yu and Ilgee Hong and Carl Yang and Tuo Zhao and Haoyu Wang},
year={2025},
eprint={2510.07743},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2510.07743},
}