| dragon_judge | R Documentation |
Two modes. With against = NULL, each reply is scored from 1 to 10 against
a rubric, using the held-out reference answer as ground truth when there
is one. With against set, the run's replies are compared pairwise with
another model's replies to the same prompts, and the judge picks a winner.
Pairwise judging asks each question twice with the two replies swapped, so
a judge that favours whichever answer comes first cannot bias the result.
dragon_judge(
x,
against = NULL,
prompts = NULL,
n = 20,
judge = NULL,
rubric = NULL,
system = NULL,
max_new_tokens = 256,
seed = 42
)
x |
A |
against |
What to compare with: |
prompts |
Prompts to use. Defaults to |
n |
How many held-out prompts to use when |
judge |
The judge: a function taking a character vector of prompts
and returning a character vector of replies, an |
rubric |
What the judge should value. A sentence or two; a sensible default covers correctness, helpfulness, and following instructions. |
system |
System prompt used when generating the replies being judged. |
max_new_tokens |
Length cap for the generated replies. |
seed |
Seed for sampling the held-out prompts. |
Prompts default to the run's held-out set, so scores are comparable across
runs that share a dataset. Results are written to judge.json in the run
directory and the summary is recorded in the run's status, where
dragon_compare() picks it up.
A dragon_judgement object: a list with mode, summary, and
details (one row per prompt).
if (interactive()) {
# Did preference optimization help? Compare the DPO run with the SFT run it started from.
j <- dragon_judge(dpo, against = "base", judge = dragon_judge_anthropic())
j$summary
# Absolute scores with a task-specific rubric.
dragon_judge(sft, rubric = "Reward replies that give concrete next steps and stay under 120 words.",
judge = dragon_judge_anthropic(model = "claude-sonnet-5"))
# A local judge: any model dragon_generate() can load.
dragon_judge(sft, against = "base", judge = "Qwen/Qwen2.5-1.5B-Instruct")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.