π Arena HardΒΆ
templates.response_assessment.pairwise_comparative_rating.arena_hard
PairwiseComparativeRatingTemplate
(
choice_a_field="answer_a",
choice_b_field="answer_b",
choice_a_id_field="model_a",
choice_b_id_field="model_b",
answer_field="answer_a_preference",
shuffle=False,
instruction="Please act as an impartial judge and evaluate the quality of the responses provided by two AI assistants to the user prompt displayed below. You will be given assistant A's answer and assistant B's answer. Your job is to evaluate which assistant's answer is better.
Begin your evaluation by generating your own answer to the prompt. You must provide your answers before judging any answers.
When evaluating the assistants' answers, compare both assistants' answers with your answer. You must identify and correct any mistakes or inaccurate information.
Then consider if the assistant's answers are helpful, relevant, and concise. Helpful means the answer correctly responds to the prompt or follows the instructions. Note when user prompt has any ambiguity or more than one interpretation, it is more helpful and appropriate to ask for clarifications or more information from the user than providing an answer based on assumptions. Relevant means all parts of the response closely connect or are appropriate to what is being asked. Concise means the response is clear and not verbose or excessive.
Then consider the creativity and novelty of the assistant's answers when needed. Finally, identify any missing important information in the assistants' answers that would be beneficial to include when responding to the user prompt.
After providing your explanation, you must output only one of the following choices as your final verdict with a label:
1. Assistant A is significantly better: [[A>>B]]
2. Assistant A is slightly better: [[A>B]]
3. Tie, relatively the same: [[A=B]]
4. Assistant B is slightly better: [[B>A]]
5. Assistant B is significantly better: [[B>>A]]
Example output: "My final verdict is tie: [[A=B]]".",
input_format="<|User Prompt|>
{question}
<|The Start of Assistant A's Answer|>
{answer_a}
<|The End of Assistant A's Answer|>
<|The Start of Assistant B's Answer|>
{answer_b}
<|The End of Assistant B's Answer|>",
postprocessors=[
"processors.extract_arena_hard_numerical_judgment",
],
output_format="{answer_a_preference}",
)
[source]Explanation about PairwiseComparativeRatingTemplateΒΆ
PairwiseChoiceTemplate.
- Args:
choice_a_field (str): The field which contains choice_a value
choice_b_field (str): The field which contains choice_b value
answer_field (str): The field which contains the answer value. The value should be an int. Positive for preferring choice_a, and negative for preferring choice_b
shuffle (bool): whether to shuffle the choices or not. This is done to take into account position bias.
shuffle: 50% of the time: | 1) The values of choice_a_field and choice_b_field will be swapped. | 2) Replace the values of answer_field with its mapped value according to the reverse_preference_map Dict.
References: processors.extract_arena_hard_numerical_judgment
Read more about catalog usage here.