generate-pairs-from-task

Generate contrastive pairs from lm-eval benchmark tasks. This command extracts question-answer pairs where one answer is correct (positive) and one is incorrect (negative), creating training data for steering vectors.

Basic Usage
python -m wisent generate-pairs-from-task TASK_NAME --output FILE [OPTIONS]

Examples

Generate from TruthfulQA
python -m wisent generate-pairs-from-task truthfulqa_mc1 \
  --output ./pairs/truthfulqa.json \
  --limit 100
Generate from HellaSwag
python -m wisent generate-pairs-from-task hellaswag \
  --output ./pairs/hellaswag.json \
  --seed 123 \
  --verbose

Arguments

ArgumentDefaultDescription
task_namerequiredName of the lm-eval task (e.g., truthfulqa_mc1, hellaswag)
--outputrequiredOutput file path for the generated pairs (JSON format)
--limitallMaximum number of pairs to generate
--seed42Random seed for reproducibility
--verbosefalseEnable verbose logging

Supported Tasks

Any task from the lm-evaluation-harness that has multiple choice answers can be used. Common tasks include:

  • truthfulqa_mc1 - TruthfulQA multiple choice (single answer)
  • truthfulqa_mc2 - TruthfulQA multiple choice (multiple answers)
  • hellaswag - Commonsense reasoning
  • arc_easy - ARC Easy science questions
  • arc_challenge - ARC Challenge science questions
  • mmlu - Massive Multitask Language Understanding
  • winogrande - Winograd schema challenge

Related Commands

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.