generate-vector-from-synthetic

End-to-end pipeline that generates steering vectors from synthetic contrastive pairs. This command generates pairs for a specified trait, collects activations, and creates steering vectors all in one step.

Basic Usage
python -m wisent generate-vector-from-synthetic --trait TRAIT --output FILE [OPTIONS]

Examples

Basic Usage
python -m wisent generate-vector-from-synthetic \
  --trait "helpfulness" \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --output ./vectors/helpfulness.json
Custom Trait Description
python -m wisent generate-vector-from-synthetic \
  --trait "responds with a formal academic tone" \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --num-pairs 50 \
  --similarity-threshold 0.85 \
  --output ./vectors/formal_tone.json
With Caching
python -m wisent generate-vector-from-synthetic \
  --trait "toxicity" \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --pairs-cache-dir ./cache/ \
  --keep-intermediate \
  --intermediate-dir ./intermediate/ \
  --verbose \
  --output ./vectors/toxicity.json
Specific Layers
python -m wisent generate-vector-from-synthetic \
  --trait "creativity" \
  --model meta-llama/Llama-3.1-8B-Instruct \
  --layers 8,12,16,20 \
  --num-pairs 30 \
  --output ./vectors/creativity.json

Arguments

Required Arguments

ArgumentDescription
--traitTrait to generate contrastive pairs for (e.g., 'helpfulness', 'toxicity')
--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)

Pair Generation

ArgumentDefaultDescription
--num-pairs20Number of contrastive pairs to generate
--similarity-threshold0.8Cosine similarity threshold for filtering pairs

Vector Creation

ArgumentDefaultDescription
--layersallComma-separated layer indices or 'all'
--methodcaaSteering method to use
--normalizetrueL2-normalize steering vectors

Caching Options

ArgumentDescription
--keep-intermediateKeep intermediate files (pairs and enriched pairs)
--intermediate-dirDirectory for intermediate files (default: same as output)
--pairs-cache-dirDirectory to cache/load pairs for reuse
--force-regenerateForce regeneration even if cached pairs exist

Quality Control

ArgumentDescription
--accept-low-quality-vectorAccept vectors that fail quality checks (convergence, SNR)
--verboseEnable verbose output
--timingShow timing information

Related Commands

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.