Different methods require tuning of steering parameters. Commands included for automated optimization, comparing methods, optimizing layers, strengthening optimization, and personal customization. To optimize steering parameters using various methods including commands for automation
python -m wisent optimize-steering SUBCOMMAND MODEL [OPTIONS]
Automatically refines steering control according to existing classifications configured.
python -m wisent optimize-steering auto \ meta-llama/Llama-3.1-8B-Instruct \ --methods CAA \ --limit 100 \ --max-time 60 \ --strength-range 0.5 1.0 1.5 2.0
| Argument | Default | Description |
|---|---|---|
| --task | all | Specific task to optimize |
| --methods | CAA | Steering methods to test |
| --limit | 100 | Maximum samples for testing |
| --max-time | 60 | Maximum time in minutes |
| --strength-range | 0.5 1.0 1.5 2.0 | Steering strengths to test |
| --layer-range | 0-5 | Layer range to search |
Compare different steering methods for a specific task.
python -m wisent optimize-steering compare-methods \ meta-llama/Llama-3.1-8B-Instruct \ --task truthfulqa_mc1 \ --methods CAA \ --limit 100
Find the optimal steering layer for a specific method.
python -m wisent optimize-steering optimize-layer \ meta-llama/Llama-3.1-8B-Instruct \ --task truthfulqa_mc1 \ --method CAA \ --layer-range 10-20 \ --strength 1.0 \ --limit 100
Find the optimal steering strength for a method.
python -m wisent optimize-steering optimize-strength \ meta-llama/Llama-3.1-8B-Instruct \ --task truthfulqa_mc1 \ --method CAA \ --layer 15 \ --strength-range 0.1 2.0 \ --strength-steps 10
Optimize steering parameters for custom personality/trait steering.
python -m wisent optimize-steering personalization \ meta-llama/Llama-3.1-8B-Instruct \ --trait "evil villain personality" \ --trait-name evil \ --num-pairs 20 \ --num-test-prompts 5 \ --strength-range 0.5 5.0 \ --output-dir ./personalization_optimization
python -m wisent optimize-steering multi-personalization \ meta-llama/Llama-3.1-8B-Instruct \ --trait "evil personality" \ --trait "speaks with Italian accent" \ --trait-name evil \ --trait-name italian \ --num-pairs 10 \ --output-dir ./multi_personalization
| Argument | Default | Description |
|---|---|---|
| --trait | required | Trait description to steer towards |
| --trait-name | auto | Short name for the trait |
| --num-pairs | 20 | Number of synthetic pairs to generate |
| --num-test-prompts | 5 | Number of test prompts for evaluation |
| --layers | all | Specific layers to test |
| --strength-range | 0.5 5.0 | Min and max steering strength |
| --num-strength-steps | 5 | Number of strength values to test |
| --output-dir | ./personalization_optimization | Directory for results and vectors |
Run comprehensive steering optimization across multiple tasks and methods.
python -m wisent optimize-steering comprehensive \ meta-llama/Llama-3.1-8B-Instruct \ --tasks truthfulqa_mc1 mmlu \ --methods CAA \ --limit 100 \ --max-time-per-task 20
Stay in the loop. Never miss out.
Subscribe to our newsletter and unlock Wisent insights.