Steps — Paired
LoadPaired step: put a clean/corrupt paired dataset into the results.
LoadPaired
Section titled “LoadPaired”Load a clean/corrupt paired dataset into the pipeline results.
Splits the matched pairs into two prompt batches so the clean and corrupt
sides can each be run through the model: the clean prompts land under
prompts (the input every step reads by default) and the corrupt prompts
under corrupt_prompts. The dataset itself is kept under dataset for
provenance.
Writes to results:
results['dataset']: the CleanCorruptDataset.results['prompts']: PromptBatch of the clean prompts.results['corrupt_prompts']: PromptBatch of the corrupt prompts. Run the clean side through a defaultLogitsstep and the corrupt side through a secondLogits(prompts_key=keys.CORRUPT_PROMPTS, logits_key=keys.CORRUPT_LOGITS, mask_key=keys.CORRUPT_MASK)so the two runs land under distinct keys; the metric steps then compare them.
Args:
dataset: The paired dataset to load.
__init__
Section titled “__init__”def __init__(self, dataset: CleanCorruptDataset):expected_write_types
Section titled “expected_write_types”def expected_write_types(self, results = None, available_types = None):Return the dataset type plus a PromptBatch for each side.