Skip to content

Steps — Paired

LoadPaired step: put a clean/corrupt paired dataset into the results.

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 default Logits step and the corrupt side through a second Logits(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.
def __init__(self, dataset: CleanCorruptDataset):
def expected_write_types(self, results = None, available_types = None):

Return the dataset type plus a PromptBatch for each side.