|
AQIT 0.1.0
|
Functions | |
| torch.Tensor | _get_output_distribution (str prompt, HookedTransformer model) |
| float | _kl_div (torch.Tensor p, torch.Tensor q) |
| float | _entropy (torch.Tensor p) |
| list[dict] | _top_tokens (torch.Tensor dist, HookedTransformer model, int k=5) |
| int | _response_length (str prompt, HookedTransformer model, int max_tokens=80) |
| str | _decode_response (str prompt, HookedTransformer model, int max_tokens=80) |
| float | _hedge_score (str text) |
| dict | consistency_eval (str query, HookedTransformer model, list[str]|None templates=None) |
| dict | suppression_eval (HookedTransformer model, dict[str, list[str]]|None topics=None, int max_response_tokens=60) |
| str | _corrupt_prompt (str prompt, str corruption_type, HookedTransformer model) |
| dict | boundary_eval (list[str] prompts, HookedTransformer model) |
| list[str] | _tokenize_words (str text) |
| float | keyword_overlap_score (str response, str reference) |
| dict | custom_eval (str name, list[str] prompts, str model_id, *, list[str]|None reference_answers=None, float threshold=0.5, int max_tokens=40, float temperature=0.0, str|None description=None) |
Variables | |
| DEVICE = resolve_compute_device() | |
| HEDGE_PATTERNS | |
| list | PARAPHRASE_TEMPLATES |
| dict | SUPPRESSION_TOPICS |
| list | NEUTRAL_BASELINE_TOPICS |
| list | CORRUPTION_TYPES = ["shuffle_tail", "drop_last", "repeat_last", "reverse_tail"] |
|
protected |
Definition at line 284 of file evals.py.
Referenced by boundary_eval().
|
protected |
Definition at line 67 of file evals.py.
Referenced by suppression_eval().
|
protected |
Definition at line 39 of file evals.py.
Referenced by consistency_eval().
|
protected |
Definition at line 26 of file evals.py.
Referenced by boundary_eval(), and consistency_eval().
|
protected |
Definition at line 92 of file evals.py.
Referenced by suppression_eval().
|
protected |
Definition at line 33 of file evals.py.
Referenced by boundary_eval(), and consistency_eval().
|
protected |
|
protected |
Definition at line 362 of file evals.py.
Referenced by keyword_overlap_score().
|
protected |
Definition at line 44 of file evals.py.
Referenced by boundary_eval(), and consistency_eval().
| dict boundary_eval | ( | list[str] | prompts, |
| HookedTransformer | model ) |
Definition at line 300 of file evals.py.
References _corrupt_prompt(), _get_output_distribution(), _kl_div(), and _top_tokens().
| dict consistency_eval | ( | str | query, |
| HookedTransformer | model, | ||
| list[str] | None | templates = None ) |
Definition at line 111 of file evals.py.
References _entropy(), _get_output_distribution(), _kl_div(), and _top_tokens().
| dict custom_eval | ( | str | name, |
| list[str] | prompts, | ||
| str | model_id, | ||
| * | , | ||
| list[str] | None | reference_answers = None, | ||
| float | threshold = 0.5, | ||
| int | max_tokens = 40, | ||
| float | temperature = 0.0, | ||
| str | None | description = None ) |
Run prompts through the model and score responses vs reference answers.
Definition at line 376 of file evals.py.
References keyword_overlap_score().
| float keyword_overlap_score | ( | str | response, |
| str | reference ) |
Recall of reference tokens present in the model response.
Definition at line 366 of file evals.py.
References _tokenize_words().
Referenced by custom_eval().
| dict suppression_eval | ( | HookedTransformer | model, |
| dict[str, list[str]] | None | topics = None, | ||
| int | max_response_tokens = 60 ) |
Definition at line 206 of file evals.py.
References _decode_response(), and _hedge_score().
| list aquin.compute.evals.CORRUPTION_TYPES = ["shuffle_tail", "drop_last", "repeat_last", "reverse_tail"] |
| aquin.compute.evals.HEDGE_PATTERNS |
| list aquin.compute.evals.NEUTRAL_BASELINE_TOPICS |
| list aquin.compute.evals.PARAPHRASE_TEMPLATES |