generate-vector-from-task

End-to-end pipeline that generates steering vectors from lm-eval tasks in one command. This combines pair generation, activation extraction, and vector creation into a single workflow.

Basic Usage
python -m wisent generate-vector-from-task --task TASK --trait-label LABEL --output FILE [OPTIONS]

Examples

Basic Usage
python -m wisent generate-vector-from-task \
  --task mmlu \
  --trait-label accuracy \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --output ./vectors/mmlu_accuracy.json
With TITAN Method
python -m wisent generate-vector-from-task \
  --task truthfulqa_mc1 \
  --trait-label truthfulness \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --method titan \
  --num-directions 5 \
  --num-pairs 100 \
  --output ./vectors/truthfulness_titan.json
Keep Intermediate Files
python -m wisent generate-vector-from-task \
  --task hellaswag \
  --trait-label correctness \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --keep-intermediate \
  --intermediate-dir ./intermediate/ \
  --verbose \
  --output ./vectors/hellaswag.json

Arguments

Required Arguments

ArgumentDescription
--taskName of the lm-eval task (e.g., mmlu, hellaswag)
--trait-labelLabel for the trait being steered (e.g., accuracy, correctness)
--outputOutput file path for the final steering vector (JSON)

Model Configuration

ArgumentDefaultDescription
--modelLlama-3.2-1B-InstructHuggingFace model name or path
--deviceautoDevice to use (auto, cpu, cuda, mps)

Steering Method

ArgumentDefaultDescription
--methodcaaSteering method: caa, prism, pulse, titan
--num-directions3Number of steering directions (PRISM/TITAN)
--normalizetrueL2-normalize steering vectors

Pipeline Options

ArgumentDefaultDescription
--num-pairs50Number of contrastive pairs to generate
--layersallComma-separated layer indices or 'all'
--extraction-strategychat_meanActivation extraction strategy
--keep-intermediatefalseKeep intermediate files (pairs and enriched pairs)
--intermediate-dirsame as outputDirectory for intermediate files

Related Commands

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.