RubricsAsJudge reward
Rubric
One rubric criterion for RubricsAsJudge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Short identifier used as the JSON property name. It is normalized to snake_case. |
required |
description
|
str
|
Description of what the judge should evaluate. |
required |
weight
|
float
|
Positive relative weight. Defaults to 1.0. |
1.0
|
Source code in synalinks/src/rewards/rubrics_as_judge.py
RubricsAsJudge
Bases: ProgramAsJudge
Grade an answer against named criteria and combine them by weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
language_model
|
LanguageModel
|
The language model that grades. |
None
|
rubrics
|
list | str
|
Criteria. Each item can be a |
None
|
prompt_template
|
str
|
Optional Jinja2 prompt template. |
None
|
examples
|
list
|
Optional examples for the prompt. |
None
|
instructions
|
str
|
Optional judge instructions. |
None
|
score_type
|
type | str
|
Per-criterion score scale. Defaults to |
None
|
reduction
|
str
|
Reward reduction. Defaults to |
'mean'
|
name
|
str
|
Optional reward name. |
'rubrics_as_judge'
|
in_mask
|
list
|
Optional fields to keep before judging. |
None
|
out_mask
|
list
|
Optional fields to remove before judging. |
None
|
in_mask_pattern
|
str
|
Optional regex of fields to keep. |
None
|
out_mask_pattern
|
str
|
Optional regex of fields to remove. |
None
|
Source code in synalinks/src/rewards/rubrics_as_judge.py
RubricsAsJudgeProgram
Bases: Module
Score each criterion with a language model, then combine in Python.
Source code in synalinks/src/rewards/rubrics_as_judge.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | |
default_rubrics_prompt_template()
Return the default prompt template used by RubricsAsJudge.
Source code in synalinks/src/rewards/rubrics_as_judge.py
normalize_rubric_name(name)
Normalize a rubric name into a JSON property name.
Source code in synalinks/src/rewards/rubrics_as_judge.py
rubrics_schema(rubrics, score_type)
Return the constrained grade-sheet schema for a list of rubrics.
Source code in synalinks/src/rewards/rubrics_as_judge.py
rubrics_schema_with_reward(schema)
Return a copy of the grade-sheet schema with the computed reward field.