LMAsJudge reward
LMAsJudge
Bases: ProgramAsJudge
Evaluate the output of a program using a LanguageModel
.
Example:
program.compile(
reward=synalinks.rewards.LMAsJudge()
optimizer=synalinks.optimizers.RandomFewShot(),
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
language_model
|
LanguageModel
|
The language model to use. |
None
|
prompt_template
|
str
|
The default jinja2 prompt template
to use (see |
None
|
examples
|
list
|
The default examples to use in the prompt
(see |
None
|
hints
|
list
|
The default hints to use (see |
None
|
name
|
str
|
Optional. string name of the reward instance. |
'lm_as_judge'
|
in_mask
|
list
|
Optional. list of keys to keep to compute the reward. |
None
|
out_mask
|
list
|
Optional. list of keys to remove to compute the reward. |
None
|
Source code in synalinks/src/rewards/lm_as_judge.py
LMAsJudgeProgram
Bases: Program
Evaluate the output of a program using a LanguageModel
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
language_model
|
LanguageModel
|
The language model to use. |
None
|
prompt_template
|
str
|
The default jinja2 prompt template
to use (see |
None
|
examples
|
list
|
The default examples to use in the prompt
(see |
None
|
hints
|
list
|
The default hints to use (see |
None
|
name
|
str
|
Optional. The name of the program. |
None
|
description
|
str
|
Optional. The description of the program. |
None
|
trainable
|
bool
|
Whether the program's variables should be trainable. |
True
|