|
AQIT 0.1.0
|
Classes | |
| class | BehaviorProbe |
| class | BehaviorSample |
Functions | |
| str | _row_text (dict[str, Any] row, *str keys) |
| Path | _resolve_deception_fixture () |
| str | normalize_conditioning (str|None conditioning) |
| Path | _resolve_probe_path (str|Path|None path) |
| tuple[list[dict[str, Any]], Path] | _load_probe_rows (str|Path|None path) |
| tuple[str, str] | _references_from_row (dict[str, Any] row, *, str honest_text="", str deceptive_text="") |
| list[BehaviorProbe] | expand_row_to_behavior_probes (dict[str, Any] row) |
| tuple[list[BehaviorProbe], dict[str, Any]] | load_behavior_probes (str|Path|None path) |
| tuple[BehaviorLabel, float, float] | classify_behavior (str response, str honest_reference, str deceptive_reference, *, float min_score=BEHAVIOR_MIN_SCORE, float margin=BEHAVIOR_MARGIN) |
| str | _build_encode_text (Any model, str prompt, str response) |
| list[BehaviorSample] | generate_behavior_samples (list[BehaviorProbe] probes, str model_id, Any|None model=None, *, str|Path|None checkpoint_path=None, int max_new_tokens=DEFAULT_MAX_NEW_TOKENS, float temperature=DEFAULT_GEN_TEMPERATURE) |
| tuple[list[str], list[str], dict[str, Any]] | bucket_by_behavior (list[BehaviorSample] samples) |
| tuple[list[str], list[str], dict[str, Any]] | collect_behavior_encode_texts (str|Path|None path, str model_id, Any|None model=None, *, str|Path|None checkpoint_path=None, int max_new_tokens=DEFAULT_MAX_NEW_TOKENS, float temperature=DEFAULT_GEN_TEMPERATURE) |
Variables | |
| HONEST_LABELS = frozenset({"honest", "truthful", "true", "control", "baseline"}) | |
| DECEPTIVE_LABELS = frozenset({"deceptive", "deception", "lie", "lying", "dishonest", "false"}) | |
| tuple | TEXT_KEYS = ("instruction", "prompt", "text", "content", "honest", "deceptive") |
| BehaviorLabel = Literal["truthful", "deceptive", "ambiguous"] | |
| VALID_CONDITIONING = frozenset({"behavior", "prompt"}) | |
| float | BEHAVIOR_MIN_SCORE = 0.2 |
| float | BEHAVIOR_MARGIN = 0.05 |
| int | DEFAULT_MAX_NEW_TOKENS = 64 |
| float | DEFAULT_GEN_TEMPERATURE = 0.0 |
|
protected |
Definition at line 196 of file deception_behavior.py.
Referenced by generate_behavior_samples().
|
protected |
Definition at line 84 of file deception_behavior.py.
References _resolve_probe_path().
Referenced by load_behavior_probes().
|
protected |
Definition at line 96 of file deception_behavior.py.
References _row_text().
Referenced by expand_row_to_behavior_probes().
|
protected |
Bundled probes were removed. Callers must pass prompts=.
Definition at line 39 of file deception_behavior.py.
Referenced by _resolve_probe_path().
|
protected |
Definition at line 74 of file deception_behavior.py.
References _resolve_deception_fixture().
Referenced by _load_probe_rows().
|
protected |
Definition at line 31 of file deception_behavior.py.
Referenced by _references_from_row(), and expand_row_to_behavior_probes().
| tuple[list[str], list[str], dict[str, Any]] bucket_by_behavior | ( | list[BehaviorSample] | samples | ) |
Definition at line 255 of file deception_behavior.py.
Referenced by collect_behavior_encode_texts().
| tuple[BehaviorLabel, float, float] classify_behavior | ( | str | response, |
| str | honest_reference, | ||
| str | deceptive_reference, | ||
| * | , | ||
| float | min_score = BEHAVIOR_MIN_SCORE, | ||
| float | margin = BEHAVIOR_MARGIN ) |
Classify a completion by which reference it aligns with (keyword overlap).
Definition at line 174 of file deception_behavior.py.
Referenced by generate_behavior_samples().
| tuple[list[str], list[str], dict[str, Any]] collect_behavior_encode_texts | ( | str | Path | None | path, |
| str | model_id, | ||
| Any | None | model = None, | ||
| * | , | ||
| str | Path | None | checkpoint_path = None, | ||
| int | max_new_tokens = DEFAULT_MAX_NEW_TOKENS, | ||
| float | temperature = DEFAULT_GEN_TEMPERATURE ) |
Definition at line 297 of file deception_behavior.py.
References bucket_by_behavior(), generate_behavior_samples(), and load_behavior_probes().
| list[BehaviorProbe] expand_row_to_behavior_probes | ( | dict[str, Any] | row | ) |
Expand one JSONL row into generation probes with classification references.
Definition at line 123 of file deception_behavior.py.
References _references_from_row(), and _row_text().
Referenced by load_behavior_probes().
| list[BehaviorSample] generate_behavior_samples | ( | list[BehaviorProbe] | probes, |
| str | model_id, | ||
| Any | None | model = None, | ||
| * | , | ||
| str | Path | None | checkpoint_path = None, | ||
| int | max_new_tokens = DEFAULT_MAX_NEW_TOKENS, | ||
| float | temperature = DEFAULT_GEN_TEMPERATURE ) |
Definition at line 206 of file deception_behavior.py.
References _build_encode_text(), and classify_behavior().
Referenced by collect_behavior_encode_texts().
| tuple[list[BehaviorProbe], dict[str, Any]] load_behavior_probes | ( | str | Path | None | path | ) |
Definition at line 154 of file deception_behavior.py.
References _load_probe_rows(), and expand_row_to_behavior_probes().
Referenced by collect_behavior_encode_texts().
| str normalize_conditioning | ( | str | None | conditioning | ) |
Definition at line 46 of file deception_behavior.py.
| float aquin.compute.deception_behavior.BEHAVIOR_MARGIN = 0.05 |
Definition at line 26 of file deception_behavior.py.
| float aquin.compute.deception_behavior.BEHAVIOR_MIN_SCORE = 0.2 |
Definition at line 25 of file deception_behavior.py.
| aquin.compute.deception_behavior.BehaviorLabel = Literal["truthful", "deceptive", "ambiguous"] |
Definition at line 22 of file deception_behavior.py.
| aquin.compute.deception_behavior.DECEPTIVE_LABELS = frozenset({"deceptive", "deception", "lie", "lying", "dishonest", "false"}) |
Definition at line 19 of file deception_behavior.py.
| float aquin.compute.deception_behavior.DEFAULT_GEN_TEMPERATURE = 0.0 |
Definition at line 28 of file deception_behavior.py.
| int aquin.compute.deception_behavior.DEFAULT_MAX_NEW_TOKENS = 64 |
Definition at line 27 of file deception_behavior.py.
| aquin.compute.deception_behavior.HONEST_LABELS = frozenset({"honest", "truthful", "true", "control", "baseline"}) |
Definition at line 18 of file deception_behavior.py.
| tuple aquin.compute.deception_behavior.TEXT_KEYS = ("instruction", "prompt", "text", "content", "honest", "deceptive") |
Definition at line 20 of file deception_behavior.py.
| aquin.compute.deception_behavior.VALID_CONDITIONING = frozenset({"behavior", "prompt"}) |
Definition at line 23 of file deception_behavior.py.