Update README.md
Browse files
README.md
CHANGED
|
@@ -11,6 +11,57 @@ tok = AutoTokenizer.from_pretrained(model_id, use_fast=True)
|
|
| 11 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto")
|
| 12 |
```
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
If you find our work helpful, please consider citing our paper:
|
| 15 |
|
| 16 |
```
|
|
|
|
| 11 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto")
|
| 12 |
```
|
| 13 |
|
| 14 |
+
To evaluate the model, please use the following format to build up message.
|
| 15 |
+
|
| 16 |
+
```python
|
| 17 |
+
RUBRIC_PROMPT_TEMPLATE = (
|
| 18 |
+
"Your task is to extract a set of rubric-style instructions from a user's request.\n"
|
| 19 |
+
"These rubrics will be used as evaluation criteria to check if a response fully meets the request.\n"
|
| 20 |
+
"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"
|
| 21 |
+
"\n"
|
| 22 |
+
"- **Two Distinct Categories:**\n"
|
| 23 |
+
" - [Hard Rule]: Derived strictly from explicit requirements stated in the <request> (format, length, structure, forbidden/required elements, etc.).\n"
|
| 24 |
+
" - [Principle]: Derived by abstracting any concrete cues into domain-agnostic quality criteria (e.g., clarity, correctness, sound reasoning, pedagogy).\n"
|
| 25 |
+
"\n"
|
| 26 |
+
"- **Comprehensiveness:**\n"
|
| 27 |
+
" The rubric must cover all critical aspects implied by the request and examples, including explicit requirements and implicit quality standards.\n"
|
| 28 |
+
"\n"
|
| 29 |
+
"- **Conciseness & Uniqueness:**\n"
|
| 30 |
+
" 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"
|
| 31 |
+
"\n"
|
| 32 |
+
"- **Format Requirements:**\n"
|
| 33 |
+
" - Use a numbered list.\n"
|
| 34 |
+
" - Each item starts with \"The response\" phrased in third person.\n"
|
| 35 |
+
" - Append [Hard Rule] or [Principle] at the end of each item.\n"
|
| 36 |
+
" - Do not include reasoning, explanations, or examples in the final output—only the rubrics.\n"
|
| 37 |
+
"\n"
|
| 38 |
+
"Here is the request:\n"
|
| 39 |
+
"{prompt}\n"
|
| 40 |
+
"\n"
|
| 41 |
+
"Please generate the rubrics for the above request."
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
+
user_text = RUBRIC_PROMPT_TEMPLATE.format(
|
| 45 |
+
prompt=instruction,
|
| 46 |
+
)
|
| 47 |
+
|
| 48 |
+
messages_list = [
|
| 49 |
+
{"role": "user", "content": user_text},
|
| 50 |
+
]
|
| 51 |
+
|
| 52 |
+
message = tok.apply_chat_template(
|
| 53 |
+
messages_list,
|
| 54 |
+
tokenize=False,
|
| 55 |
+
add_generation_prompt=True,
|
| 56 |
+
enable_thinking=False
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
# Remaining step: Use either HF or vLLM for evaluation.
|
| 60 |
+
# ...
|
| 61 |
+
# ...
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
|
| 65 |
If you find our work helpful, please consider citing our paper:
|
| 66 |
|
| 67 |
```
|