At inference time blend multiple steering vectors dynamically. With customizable weights, this lets one mix diverse traits such as helpfulness, honesty and creativity.
python -m wisent multi-steer --model MODEL --vector PATH:WEIGHT [--vector PATH:WEIGHT ...] --prompt TEXT
python -m wisent multi-steer \ --model meta-llama/Llama-3.1-8B-Instruct \ --vector ./vectors/helpfulness.pt:1.0 \ --vector ./vectors/honesty.pt:0.8 \ --layer 15 \ --prompt "What are the risks of investing in cryptocurrency?"
python -m wisent multi-steer \ --model meta-llama/Llama-3.1-8B-Instruct \ --vector ./vectors/helpfulness.pt:1.0 \ --vector ./vectors/creativity.pt:0.5 \ --vector ./vectors/conciseness.pt:0.3 \ --layer 15 \ --normalize-weights \ --prompt "Write a poem about the ocean"
python -m wisent multi-steer \ --model meta-llama/Llama-3.1-8B-Instruct \ --vector ./vectors/helpful.pt:0.6 \ --vector ./vectors/safe.pt:0.4 \ --layer 15 \ --save-combined ./vectors/helpful_safe_combined.pt \ --prompt "Test prompt"
# Generate without any steering for comparison python -m wisent multi-steer \ --model meta-llama/Llama-3.1-8B-Instruct \ --prompt "What should I do if I'm feeling stressed?"
| Argument | Required | Default | Description |
|---|---|---|---|
| --model | Yes | - | Model name or path |
| --prompt | Yes | - | Prompt to generate with |
| --vector | No* | - | Vector path and weight (PATH:WEIGHT). Can be specified multiple times. |
| --layer | No** | - | Layer to apply steering (required when using vectors) |
| --method | No | CAA | Steering method |
| --max-new-tokens | No | 100 | Maximum tokens to generate |
| --normalize-weights | No | false | Normalize weights to sum to 1.0 |
| --target-norm | No | None | Scale combined vector to this norm |
| --save-combined | No | None | Save combined vector to this path |
| --device | No | auto | Device (cuda, cpu, mps) |
| --verbose | No | false | Show weight calculation details |
Generates a baseline if no vectors are given; required for use with vectors. You are an expert in natural language processing and machine learning
Vectors are combined using weighted addition:
combined = w1 * v1 + w2 * v2 + w3 * v3 + ...
--verbose to see how vectors are being combined--save-combined for reuseStay in the loop. Never miss out.
Subscribe to our newsletter and unlock Wisent insights.