Visualize the effect of steering on a model's activation space: project base vs steered activations relative to the positive and negative concept clusters, and optionally compare generated responses. A per-concept mode driven by zwiad results is also available.
python -m wisent steering-viz --model MODEL --task TASK --layer N --strength S --output FILE [OPTIONS]
python -m wisent steering-viz --model meta-llama/Llama-3.1-8B-Instruct --task truthfulqa_custom --layer 15 --strength 1.5 --n-test-prompts 100 --n-response-samples 5 --prompt-format chat --extraction-strategy last_token --space-classifier logistic --direction-method mean_diff --steering-method linear --device cuda --classifier-test-size 0.2 --classifier-batch-size 32 --classifier-lr 0.001 --pacmap-neighbors-max 50 --pacmap-neighbors-divisor 10 --pacmap-num-iters 450 --output ./viz.png --output-dir ./viz
python -m wisent steering-viz --model meta-llama/Llama-3.1-8B-Instruct --task truthfulqa_custom --layer 15 --strength 1.5 --per-concept --zwiad-results ./zwiad.json --multipanel --n-test-prompts 100 --n-response-samples 5 --prompt-format chat --extraction-strategy last_token --space-classifier logistic --direction-method search --steering-method linear --device cuda --classifier-test-size 0.2 --classifier-batch-size 32 --classifier-lr 0.001 --pacmap-neighbors-max 50 --pacmap-neighbors-divisor 10 --pacmap-num-iters 450 --output ./viz.png --output-dir ./viz
| Argument | Description |
|---|---|
| --model | Model name |
| --task | Task/benchmark name in database |
| --layer | Layer to visualize |
| --strength | Steering strength multiplier |
| --output | Output PNG file path |
| --output-dir | Output directory for per-concept visualizations |
| --device | Device to run the model on (cuda, mps) |
| Argument | Default | Description |
|---|---|---|
| --n-test-prompts | required | Number of test prompts to run |
| --n-response-samples | required | Samples to show response comparison for |
| --prompt-format | required | chat or completion |
| --extraction-strategy | required | last_token or first_token |
| --max-new-tokens | 100 | Max tokens generated per response |
| Argument | Default | Description |
|---|---|---|
| --direction-method | required | mean_diff, search, behavioral or pca_0 |
| --steering-method | required | linear, clamping, projection, replacement, contrast, mlp, adaptive |
| --space-classifier | required | Classifier for space location: logistic or mlp |
| --per-concept | off | Per-concept visualizations (needs --zwiad-results) |
| --multipanel | off | 9-panel visualization (PCA, LDA, t-SNE, UMAP...) |
| --interactive | off | Interactive HTML instead of static PNG |
| --autotune | off | Tune threshold/strength/method on a validation split |
Classifier and PaCMAP tuning flags (--classifier-test-size, --classifier-batch-size, --classifier-lr, --mlp-hidden-dim, --pacmap-neighbors-max, --pacmap-neighbors-divisor, --pacmap-num-iters) plus multi-layer flags (--multi-layer, --layers, --layer-strengths, --layer-methods) are also available; run wisent steering-viz --help for the full list.
Stay in the loop. Never miss out.
Subscribe to our newsletter and unlock Wisent insights.