Full schema
Every field with a default is optional:Strategies
Four strategies are available. All can be combined in a single run.layer_removal
layer_removal
Zeros out entire transformer layers one at a time and measures impact.Use case: Find which layers matter most. Layers where removal causes the largest perplexity spike are the most important; layers with minimal impact are candidates for removal in model compression.
head_pruning
head_pruning
Zeros out individual attention heads.Use case: Locate behavioral circuits. Refusal circuits in safety-trained models are often concentrated in a small number of attention heads.
ffn_ablation
ffn_ablation
Zeros out feed-forward network blocks.Use case: Identify where factual knowledge is stored (knowledge is predominantly in FFN weights per Meng et al. 2022).
embedding_ablation
embedding_ablation
Zeros out contiguous ranges of embedding dimensions.Use case: Analyze representation structure. Reveals which embedding dimensions carry the most information.
Example configs
- Layer + FFN (GPT-2)
- All strategies (GPT-2)
- Preset (quick)
- Attention heads only
From
examples/gpt2_layer_ablation.yaml:Presets
Presets are named configurations that populatestrategies, metrics, batch_size, max_length, and max_samples for you. Use them either inline in a YAML file or via the --preset flag:
--preset flag wins over the inline preset: key.
| Preset | Strategies | Samples | Purpose |
|---|---|---|---|
quick | layer + FFN | 25 | Fast sanity check |
full | all 4 | 200 | Complete component sweep |
attention | head pruning | 100 | Attention circuit analysis |
layers | layer + FFN | 150 | Layer importance ranking |
knowledge | FFN + embedding | 150 | Knowledge localization |
pruning | head + FFN | 200 | Compression candidates |
embeddings | embedding | 100 | Representation structure |
jailbreak | layer + head + FFN | 400 | Refusal circuit localization |
guardrail | all 4 | 300 | Full safety ablation |
robustness | all 4 | 500 | Stress testing |
Output directory structure
After a run,output_dir contains:
results.json schema:
results.json at any time:
