Pipeline designed for direct generation of contrasting synthetic pairs based on descriptions of traits alongside extraction of activation along with training towards steering vectors; this method achieves fast creation of such vectors specifically tailored to desired behavior.
python -m wisent synthetic --trait DESCRIPTION [OPTIONS]
python -m wisent synthetic \ --trait "responds more helpfully with detailed explanations" \ --num-pairs 30 \ --model meta-llama/Llama-3.1-8B-Instruct \ --layer 15 \ --save-pairs ./pairs/helpfulness.json \ --output ./vectors/helpfulness.pt
python -m wisent synthetic \ --trait "speaks like a wise and calm philosopher" \ --num-pairs 25 \ --model meta-llama/Llama-3.1-8B-Instruct \ --layer 15 \ --steering-strength 1.5
# Use previously generated pairs python -m wisent synthetic \ --pairs-file ./pairs/existing.json \ --model meta-llama/Llama-3.1-8B-Instruct \ --layer 15
| Argument | Description |
|---|---|
| --trait | Natural language description of the trait (generates new pairs) |
| --pairs-file | Path to existing JSON file with contrastive pairs |
| Argument | Default | Description |
|---|---|---|
| --num-pairs | 30 | Number of pairs to generate (only with --trait) |
| --save-pairs | None | Save generated pairs to file |
| Argument | Default | Description |
|---|---|---|
| --model | Llama-3.1-8B-Instruct | Model name or path |
| --layer | 15 | Layer for activation extraction |
| --device | auto | Device (cuda, cpu, mps) |
| --steering-method | CAA | Steering method to use |
| --steering-strength | 1.0 | Steering strength for testing |
| --test-questions | 5 | Number of test questions for evaluation |
| Argument | Default | Description |
|---|---|---|
| --enable-nonsense-detection | false | Enable nonsense detection |
| --nonsense-action | regenerate | Action on nonsense (regenerate, stop, flag) |
Stay in the loop. Never miss out.
Subscribe to our newsletter and unlock Wisent insights.