discover-steering

Discover optimal steering directions for a task by searching layers and random directions against stored activations, then report the best-scoring configuration.

Basic Usage
python -m wisent discover-steering --model MODEL --task TASK --layer N --strength S [OPTIONS]

Examples

Discover on a benchmark
python -m wisent discover-steering   --model meta-llama/Llama-3.1-8B-Instruct   --task truthfulqa_custom   --layer 15 --strength 1.5   --n-test-samples 100 --n-random-directions 50   --discover-task-limit 500 --discover-train-limit 1000   --output ./discovery.json
Search a layer range
python -m wisent discover-steering   --model meta-llama/Llama-3.1-8B-Instruct   --task truthfulqa_custom   --layer 15 --layer-range 8-16 --strength 1.5   --n-test-samples 100 --n-random-directions 50   --discover-task-limit 500 --discover-train-limit 1000   --output ./discovery.json

Arguments

Required

ArgumentDescription
--modelModel name
--taskTask/benchmark name in database (e.g. truthfulqa_custom)
--layerPrimary layer to test
--strengthSteering strength multiplier
--n-test-samplesNumber of test samples for evaluation
--n-random-directionsNumber of random directions to try
--discover-task-limitMaximum task pairs to load for discovery
--discover-train-limitMaximum activation pairs to load for training
--outputOutput JSON file path

Options

ArgumentDefaultDescription
--layer-rangeonly --layerLayer range to search, e.g. 8-16
--database-urlDATABASE_URL envDatabase URL
--skip-layer-searchoffSkip the layer search (faster, less thorough)
--skip-direction-searchoffSkip the direction search (faster, less thorough)

Related Commands

Stay in the loop. Never miss out.

Subscribe to our newsletter and unlock Wisent insights.